claude-code - 💡(How to fix) Fix Agent View: undocumented behavior — are run_in_background child processes killed when the supervisor reaps an idle session after ~1h?

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

Summary

The Agent View docs state that once a session finishes and sits unattached for ~1 hour, the supervisor stops its process to free resources, then restarts a fresh process on next attach/peek/reply. What happens to background child processes spawned via run_in_background during that reaping window is not documented.

Scenario

  1. A background session's agent launches a long-running task (e.g. a multi-hour simulation) via run_in_background: true.
  2. The agent's turn ends, so the session is "finished"/idle while the detached child keeps running.
  3. The session sits unattached for ~1 hour and the supervisor stops the parent Claude Code process.

Questions / gap

  • Does the supervisor kill the background child process when it stops the parent? (Normally a child would die with its parent.)
  • Does an active tracked background task prevent the ~1h reaping? The UI already shows Cannot open agents — N background task(s) running, implying background tasks are tracked.
  • If the child is killed, the harness's "re-invoke the agent when a background task completes" contract can never fire — the task and its completion callback are silently lost.

Requests

  1. Document the exact interaction between the ~1h supervisor reaping and in-flight run_in_background tasks.
  2. Ideally handle it: keep a session exempt from reaping while it has tracked background tasks still running, so long jobs and the completion callback survive.

Affected docs

Filed via Claude Code.

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 Agent View: undocumented behavior — are run_in_background child processes killed when the supervisor reaps an idle session after ~1h?