claude-code - 💡(How to fix) Fix Phantom background-task chips persist after /compact; stop and session-restart both no-op

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…

Code Example

stop_task task_id "b2c..."  -> RPC response: hasError=false
stop_task task_id "bm4..."  -> hasError=false
stop_task task_id "b07m..." -> hasError=false
... (repeats for all 9, every one hasError=false, chip stays "running")
RAW_BUFFERClick to expand / collapse

Environment: Claude Code via ccd-cli 2.1.142, remote server, Linux, Opus 4.7 (1M context)

What happens

  • Several long-running background tasks (bash run_in_background) were spawned, then their underlying processes died / were killed out-of-band.
  • After a /compact, the CLI's in-memory task registry is wiped, but the UI still shows ~9 tasks as running.
  • Clicking Stop in the UI sends a stop_task control request → the server returns hasError=false → but the chip never clears. The CLI has no matching task record, so the stop is a silent no-op that reports success.
  • The CLI's own TaskStop / TaskOutput return "No task found" for those same IDs.
  • The chips are reconstructed on resume from the session transcript (<session>.jsonl), which logs each task start but has no terminal event for these tasks — so a CLI restart re-reads the transcript and the chips reappear.

Verification

  • Zero backing processes alive (no java/lein/child processes for the tasks).
  • No open output file descriptors for the task .output files.
  • No separate on-disk task database — the only persisted references are inside the conversation transcript JSONL.
  • Conclusion: purely a stale-state / transcript-replay artifact with no user-reachable reconcile path.

Server log evidence

stop_task task_id "b2c..."  -> RPC response: hasError=false
stop_task task_id "bm4..."  -> hasError=false
stop_task task_id "b07m..." -> hasError=false
... (repeats for all 9, every one hasError=false, chip stays "running")

Expected behavior

  1. stop_task for an unknown/already-dead task should reconcile the chip (mark it stopped/errored) rather than no-op while reporting success.
  2. /compact should either preserve the task registry or write terminal events for any in-flight tasks it abandons.
  3. Transcript replay on resume should reconcile task chips against actual process liveness instead of resurrecting started-but-unterminated tasks indefinitely.

Impact

Cosmetic but persistent: orphaned "running" chips that cannot be cleared by Stop, by CLI restart, or by session resume — the only escape is abandoning the session entirely.

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…

FAQ

Expected behavior

  1. stop_task for an unknown/already-dead task should reconcile the chip (mark it stopped/errored) rather than no-op while reporting success.
  2. /compact should either preserve the task registry or write terminal events for any in-flight tasks it abandons.
  3. Transcript replay on resume should reconcile task chips against actual process liveness instead of resurrecting started-but-unterminated tasks indefinitely.

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 Phantom background-task chips persist after /compact; stop and session-restart both no-op