claude-code - 💡(How to fix) Fix [Windows] Background session supervisor exits after 5s idle instead of documented ~1 hour [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#60455Fetched 2026-05-20 03:58:08
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Author
Timeline (top)
labeled ×4commented ×1

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.

Root Cause

  • 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.

Fix Action

Fix / Workaround

[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

Code Example

[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
RAW_BUFFERClick to expand / collapse

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.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [Windows] Background session supervisor exits after 5s idle instead of documented ~1 hour [1 comments, 2 participants]