Claude Code Background Subagents Move Long Shell Commands to the Background After 3 Minutes

Claude CodeView original changelog

Claude Code 2.1.318 changes how subagents behave in two cases. Background subagents now move a running shell command to the background after 3 minutes on every provider, so the prompt cache does not expire while the command runs. When the "Switch models when a message is flagged" setting is "Ask each time", subagents now stop instead of silently switching models.

Key Takeaways

  • Background subagents now move shell commands to the background after 3 minutes, on all providers.
  • The goal is to keep the prompt cache from expiring while a long command runs.
  • On Bedrock, Vertex, Foundry or with telemetry off, a progress summary may now wait up to 5 minutes on a cold cache.
  • With "Switch models when a message is flagged" set to "Ask each time", subagents now stop instead of switching models.
  • That change keeps the decision about model switching with the user, not the subagent.
  • Both changes ship in Claude Code 2.1.318.

Shell commands go to the background after 3 minutes

Claude Code 2.1.318 changes background subagents so that a shell command is moved to the background after 3 minutes, on all providers. Anthropic gives the reason: the prompt cache must not expire while the command is running. A subagent that waits on a long build or test run would otherwise let the cache lapse and pay for a cold start on the next turn.

A related change affects subagent progress summaries on Bedrock, Vertex, Foundry, or with telemetry off. On a cold prompt cache, one summary can now wait up to 5 minutes for the subagent's pending response.

Subagents stop instead of switching models

The second change concerns the "Switch models when a message is flagged" setting. When it is set to Ask each time, subagents used to switch models without the user being asked. In 2.1.318 they stop instead. The prompt that the main conversation raises is the only place the user can decide, so a subagent now halts rather than picking a model on the user's behalf.

Who should care

Anyone who runs long commands inside background subagents will see them hand off to the background sooner. People who set model switching to "Ask each time" get a more predictable result: a stopped subagent, not an unrequested model change.