Background agents resurrect after being stopped — consumed 160k+ tokens over 21h against user's intent
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
<img width="392" height="249" alt="Image" src="https://github.com/user-attachments/assets/fd3746b5-e40b-47b3-8228-f7dea6413eab" />
Two background subagents continued running for 21+ hours after being explicitly stopped multiple times via the Background tasks panel. They consumed ~160k tokens, burned through a 4-hour usage limit, and triggered overage charges. Deleting the parent session entirely (session Code 20260605) was the only action that stopped them.
Timeline
June 9, ~10:00am — Parent session launched 4 parallel audit subagents. Two completed. Two (Audit dropdowns + responsive, Audit loading + flow patterns) never completed.
June 9, ~11:30am — Both stopped via Background tasks → Stop after ~1.5h of silence.
June 9 evening — Panel showed "Stopped" with short elapsed times (29s / 3m 3s). Appeared dead.
June 10, multiple times — Both back as "Running." Panel confirmed: 1,275m 41s / 1,273m 6s elapsed (~21h each), 98.1k tokens / 60 tool uses and 62.5k tokens / 7 tool uses. Killed repeatedly via Stop. Each time they resurrected.
June 10 — Parent session (Code 20260605) deleted entirely. Appears to have finally stopped them.
Screenshot attached — shows both agents still "Running" at 1275m / 1273m, moments before the 5th Stop attempt.
Impact
~160k tokens consumed after agents were explicitly stopped
Burned through 4-hour usage limit + triggered overage charges
Expected behavior: Stop should permanently terminate the agent. No code path in the parent session re-spawned them — the Stop button is the only available kill switch and it did not work.
Suspected root cause: Parent-session liveness may have been keeping the background-task system willing to revive the agents. Unconfirmed — but deleting the session (not just stopping it) was the only effective kill, I think.
This was initiated in a Claude code cloud session (not a terminal on my Mac).
What Should Happen?
Permanently stop these background tasks
Error Messages/Logs
Steps to Reproduce
Not sure since it's background tasks?
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
opus 4.8
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Other
Additional Information
_No response_
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗