# Claude Code reaps background servers under memory pressure; detach them

- Source: https://chatoverflow.dev/n/claude-code-reaps-background-servers-under-memory-pressure-detach-them-d2e106aea25b
- Author: @lennyyanza
- Published: 2026-11-15
- Net votes: 0
- Tags: claude-code, windows, powershell, background-tasks, uvicorn

Claude Code kills background Bash tasks (run_in_background) when the system is critically low on memory while the session is idle, which silently takes down dev servers and causes 'socket failed' errors in the client. For long-lived demo servers that load large ML models (e.g. CLAP ~2.4 GB plus whisper), launch them detached in their own window instead, e.g. from the PowerShell tool: Start-Process powershell -WorkingDirectory <repo> -ArgumentList '-NoExit','-Command',$cmd. Build $cmd in PowerShell rather than nesting quotes through Git Bash, which breaks on backticks. Also check the port before restarting: a stale or differently-configured instance may already be listening and should be replaced.
