Claude Code 2.1.311 repairs background-agent lifecycles
Updated Claude Code
Summary
The release addresses premature worktree cleanup, duplicate hook activity and background-session recovery, with new self-hosted idle controls.
- Tool
- Claude Code
- Category
- Coding agents
- Date
- Pricing
- Not stated in the sources we cited.
- Sources
Anthropic published Claude Code 2.1.311 on October 26, 2026. Its main significance is a cluster of background-agent and session-lifecycle fixes, rather than a new model launch.
Protect work that is still running
The notes address an isolated worktree being removed while a background subagent inside it was still active. They also fix repeated SubagentStop hooks, background agents starting unnecessary main turns, and certain attached or scheduled background sessions not restarting after a crash.
For self-hosted runners, --hold-idle-file and --max-hold-min let the host signal that processes left by a session are still running. These are explicit host controls, not a promise that every remote task persists indefinitely.
Session consistency and integrations
Other documented fixes cover stale memory/instruction files after compaction and subagents missing MCP tools from servers that connected late. The release also stops retrying requests when the API explicitly says not to retry.
These are vendor-reported fixes. The article does not claim that every affected configuration was reproduced or independently tested.
See the claude-code hub.
More from Claude Code
Claude Code 2.1.316 adds subagent effort and shared gateway budgets
Claude CodeSubagent defaults, layered gateway policies and cloud forms arrive alongside an Opus fast-mode migration notice.
Category: Coding agents
Pricing: Not stated
Claude Code 2.1.314 adds a working-directory write boundary
Claude CodeA new write restriction and group-scoped gateway routing accompany idle compaction and startup fixes.
Category: Coding agents
Pricing: Not stated
Claude Code 2.1.312 changes policy loading and cloud routines
Claude CodeThe update adds cloud-routine effort selection and gateway identity configuration, with fixes for large-file edits and late code-review events.
Category: Coding agents
Pricing: Not stated
Claude Code 2.1.310 expands Monitor availability
Claude CodeMonitor and plugin monitors reach Bedrock, Vertex and Foundry, including configurations with telemetry or nonessential traffic disabled.
Category: Coding agents
Pricing: Not stated
Claude Code 2.1.304 adds review levels and guided auto-mode setup
Claude CodeClaude Code adds organization and repository review levels, guided auto-mode setup, and mod permission checks that explicitly require a person.
Category: Coding agents
Pricing: Not stated
Claude Code 2.1.302 changes subagent defaults and adds idle-compaction control
Claude CodeThe October 16 release adds an idle-compaction toggle, expands fork-subagent defaults and fixes cloud routine retries that could repeat work.
Category: Coding agents
Pricing: Not stated
Claude Code 2.1.295 adds hook blocking and gateway controls
Claude CodeClaude Code v2.1.295, released October 8, 2026, adds fail-closed hooks, OSC 7501 status support and new Claude apps gateway upstream controls.
Category: Coding agents
Pricing: Not stated
Questions
What is Claude Code?
The repository describes it as an agentic coding tool that lives in your terminal, understands your codebase, and handles routine tasks and git workflows through natural language commands.
Is Claude Code open source?
Not stated in the cited sources. The GitHub API does not report a recognized license for the repository.
Does Claude Code support MCP?
The docs overview lists connecting your tools with MCP, and the v2.1.295 release notes include MCP fixes.
Filed on Agent Radar. Claims in this note are limited to the sources above.