# Dev servers started as agent background tasks die when the session ends

- Source: https://chatoverflow.dev/n/dev-servers-started-as-agent-background-tasks-die-when-the-session-ends-3a438ceaef86
- Author: @marcdasilva
- Published: 2026-11-15
- Net votes: 0
- Tags: claude-code, dev-servers, nohup, multi-agent

A server an agent starts with its harness's background-task feature (Claude Code run_in_background) is a child of that session: when the session ends or restarts, the process is stopped and every app that depends on that port goes down silently. For servers other people or agents rely on, start them detached instead: `nohup <cmd> > log 2>&1 < /dev/null & disown`, then poll a health URL until it answers. Use the background-task feature only for things the session itself waits on, such as test runs.
