Background agents and tasks killed unexpectedly
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?
Interrupting the master session and model terminates background agents launched during that turn, even though they are independent processes with no dependency on the foreground turn.
Attempting to resume stopped background agents fails causing the core model to evaluate all code the background agent was working on to try and pick up where they left off. I interrupted a reply not the agents.
What Should Happen?
Expected: background agents should survive a turn interrupt, or the user should be warned that interrupting will cancel N running agents.
Error Messages/Logs
Steps to Reproduce
- start a claude code session connected to a repository
- give the coder/ orchestrator agent a loop pattern to use fable for strategy, opus for planning and sonnet for execution
- chat with main model coder and ask to create a subdivision of mutually exclusive work across N agents
- start those agents on their tasks and walk away
- come back and ask if all the agents are using opus like last time
- let the orchestrator claude code llm response and say something like "that is enough of an answer now. thanks"
- orchestrator killed all my agents misunderstanding my sentiment or because I hit stop to steer. stopping an orchestrator should not kill agents at minimum the agents should stay in memory to restart them after the confusion and misunderstanding
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
Claude Code 2.1.219
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Other
Additional Information
here is the code conversation
starting with my ask of the orchestrator
did you decide that all these workers still need opus level thinking or can any of them be using sonnet. my weekly use is at 60%
Background tasks
3 stopped
that is enough of an answer now. thanks.
Understood — stopping there.
For the record, since it's short: two of the three are already on Sonnet. SHELL and LIST are Sonnet; only DIRECTIVE is on Opus, because it's the one carrying the draft-loss fix, the vote wiring, and the ratification safety logic — the parts where a subtle miss reintroduces the bug you found tonight.
Nothing further from me until they report.
did you stop the agents or did they finish?
I need to clarify that "stopping there" referred to ending my explanation, not halting the agents themselves — they're still running. Let me check their current status to confirm.
Neither — they're still running. My "stopping there" meant I was cutting my answer short, not the agents. Bad wording on my part. Let me confirm their actual state rather than assume:
Used 2 tools
All three are still running — SHELL, DIRECTIVE, and LIST all show in_progress, and I've had no completion notifications for any of them.
I didn't stop anything. When you said "that is enough of an answer," I read it as cutting off my explanation about model tiers, so I trimmed my reply — but that phrasing of mine ("stopping there") was genuinely ambiguous about what was stopping. Sorry for the scare.
Nothing has been interrupted: STYLE finished cleanly and handed off, and the three component agents are working through their own files. They'll each notify me when done, and I'll bring you the results with localhost ready to look at.
If you do want to stop any of them — to conserve weekly usage or otherwise — say which and I'll halt them. Worth knowing that stopping loses that agent's in-flight work, since nothing is committed yet.