[FEATURE] Make background session idle timeout configurable

Status Open
Maintainer reply None cached
Activity 1 comment · opened Jul 20, 2026

Currently the supervisor stops an idle, unattached background session (dispatched via --bg, /bg, or /fork) after approximately one hour (documented in agent-view.md). The only way to prevent this is pinning the session with Ctrl+T in the agents view, which keeps it running indefinitely.

Related but distinct existing issues (none request configurability):

  • #60455 (closed) - Windows-specific bug where the timeout fired at 5s instead of ~1h
  • #59691 (closed) - question about whether background child processes survive the reap
  • #70691 (open) - docs describe auto-resurrect behavior that no longer matches reality

Request: expose the idle timeout duration as a setting (e.g. a settings.json key or environment variable) rather than a hardcoded ~1 hour, or document an existing override if one already exists.

Use case: long-running background agents (multi-step research, large refactors, multi-hour builds) that a user steps away from for longer than an hour but intends to reattach to later. Today the only workaround is remembering to pin every session immediately after dispatch, which is easy to forget and has no bulk/default option.

Suggested options (any one would help):

  1. A settings.json key, e.g. backgroundSessionIdleTimeoutMs
  2. An environment variable, e.g. CLAUDE_CODE_BG_IDLE_TIMEOUT_MS
  3. A CLI flag on --bg / /bg to set idle timeout per-session
  4. A default-pin option so all bg sessions are pinned unless explicitly unpinned

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗