[Windows] Background session supervisor exits after 5s idle instead of documented ~1 hour
Summary
On Windows, the background-session supervisor exits after 5 seconds of idle, while the official docs state it should remain alive for about an hour before exiting. When the supervisor dies, all bg-session workers also become unreachable (named pipes collapse), and the agent dashboard cannot reattach to them after restarting Claude Code.
This does not happen on macOS — bg sessions reconnect normally there.
Environment
- OS: Windows 11 (10.0.19045)
- Claude Code version:
2.1.144 - Shell: PowerShell 5.1 + Git Bash
- Working directory: under
C:\Users\<user>\OneDrive\...(Korean characters in path)
Reproduction
- From an active
claudesession, spawn a bg session (or openclaude agentsdashboard). - Send the bg session to the dashboard so it runs in the background.
- Close all
claude agentsclients and let any bg worker finish. - Wait > 5 seconds.
- Start
claude agentsagain and try to reattach to the previous session → fails. The roster shows the entry but the worker process is gone.
Evidence — ~/.claude/daemon.log
[2026-05-19T03:08:46.741Z] [supervisor] ─── daemon start ─── version=2.1.143 pid=202596 origin=transient
[2026-05-19T03:08:47.874Z] [supervisor] auth: scheduling proactive refresh in 5s
[2026-05-19T03:08:48.339Z] [supervisor] auth: scheduling proactive refresh in 28560s
[2026-05-19T03:08:48.366Z] [supervisor] workers=0
[2026-05-19T03:08:48.549Z] [bg] bg: low memory — skipping spare dispatch 78e9509a
[2026-05-19T03:09:03.741Z] [bg] bg spawned 78e9509a (spare)
[2026-05-19T03:09:23.940Z] [bg] bg settled 78e9509a (killed)
[2026-05-19T03:09:28.943Z] [supervisor] idle 5s with no clients — exiting
[2026-05-19T03:09:28.943Z] [supervisor] shutting down
The line idle 5s with no clients — exiting recurs throughout the log — this is not a one-off.
Documentation conflict
The Agent View docs state:
"Once a session finishes and sits unattached for about an hour, the supervisor stops its process to free resources."
claude daemon --help also says:
"Service install is disabled in this version — the daemon runs on demand and exits when the last client disconnects."
The 5-second behavior contradicts the "~1 hour" guarantee.
Impact
- bg sessions become unreconnectable after even a brief Claude Code restart on Windows.
- macOS users do not see this — likely either a different idle constant or Unix-socket recovery semantics that don't apply on Windows named pipes.
- The new agent dashboard feature is significantly less useful on Windows because session continuity is lost on every close.
Request
Any one of the following would solve this:
- Make idle timeout configurable — e.g.,
settings.jsonkeydaemon.idleTimeoutMsor env varCLAUDE_DAEMON_IDLE_MS. - Restore the documented ~1 hour idle behavior on Windows.
- Add
claude agents --keep-aliveflag that keeps the supervisor resident. - Re-enable service install on Windows (
launchctl/systemdequivalent — Task Scheduler entry) so the supervisor can persist across logon sessions.
Happy to provide more diagnostic data (full daemon.log, roster.json, daemon.status.json) if useful.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗