[Windows] Background session supervisor exits after 5s idle instead of documented ~1 hour

Resolved 💬 2 comments Opened May 19, 2026 by akira8900 Closed Jun 18, 2026

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

  1. From an active claude session, spawn a bg session (or open claude agents dashboard).
  2. Send the bg session to the dashboard so it runs in the background.
  3. Close all claude agents clients and let any bg worker finish.
  4. Wait > 5 seconds.
  5. Start claude agents again 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:

  1. Make idle timeout configurable — e.g., settings.json key daemon.idleTimeoutMs or env var CLAUDE_DAEMON_IDLE_MS.
  2. Restore the documented ~1 hour idle behavior on Windows.
  3. Add claude agents --keep-alive flag that keeps the supervisor resident.
  4. Re-enable service install on Windows (launchctl/systemd equivalent — 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.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗