Source · release
Claude Code release 2.1.314
Summary
Claude Code 2.1.314 was released on 2026-10-30 (there was no public 2.1.313). It adds a setting that blocks file writes outside the working directories in every permission mode, idle compaction for long conversations in VS Code and the Desktop Code tab, and IdP-group routing on the Claude apps gateway. The rest is a long list of fixes, several of them to hooks, auto mode, and headless runs.
Key points
- Write fence:
permissions.blockWritesOutsideWorkingDirectories: trueinsettings.jsonmakes Write, Edit, and NotebookEdit refuse paths outside the working directories in every permission mode, including auto and bypass. It pairs with the existingblockReadsOutsideWorkingDirectories. - Idle compaction: in VS Code and Claude Desktop's Code tab, a conversation over 200K tokens that sits idle is summarised in the background; the summary is used on your next message if the prompt cache has expired by then. It also runs on Bedrock, Vertex, Foundry, and gateways once the one-hour prompt cache is on.
- Headless fix:
claude -pnow prints the error and exits 1 when startup fails, instead of exiting 0 with no output. Useful for cron jobs and CI. - Hooks: Bash hooks now also run on shell commands started by the Monitor tool, and
ifconditions likeMonitor(tail *)match them. PreCompact hook output is cut at 10,000 characters. - Auto mode: blocked calls now name the command and point to
/permissions, whose review tab is renamed "Recently blocked". - Effort caps: if an admin caps a model's effort, Claude Code lowers the effort and retries instead of failing every turn.
- Gateway: upstreams take an optional
groupslist so only listed IdP groups are routed to them; Bedrock upstreams can log which guardrail filter fired (guardrail_trace). - Cloud routines: scheduled tasks in Anthropic's cloud now load the plugins enabled on your claude.ai account.
- Memory use: long headless and SDK turns that run many subagents no longer keep each subagent's tool results until the turn ends.
- The Python Agent SDK 0.2.175 (2026-10-30) bundles this CLI version.
Why it matters
The write fence is a simple, mode-independent guard for unattended runs: even in bypass mode the agent cannot edit files outside the repository. Idle compaction cuts the cost of coming back to a long session after the cache has expired.