DEV Community

Cover image for Claude Code 2.1.326 Hardens Sandbox and Auto Mode Defaults
Shamuddin
Shamuddin

Posted on Originally published at aitecharchive.com

Claude Code 2.1.326 Hardens Sandbox and Auto Mode Defaults

Verdict: Claude Code 2.1.326 is a security-hardening release, not a feature drop. Out November 16, 2026, it narrows what sandboxed commands may write, starts HIPAA-organization sessions in auto mode by default, ignores broad wildcard allow rules, and makes a hook's "decision": "block" actually hold — all per Anthropic's v2.1.326 release notes. For solo developers the practical cost is a few new permission prompts; for teams running agents unattended, the defaults now close gaps that mattered the week Cursor disclosed a vendor-key breach. Update, expect a couple of prompts, and add a one-line allowlist where the new sandbox refuses a path you need.

What changed in Claude Code 2.1.326

Anthropic published v2.1.326 on GitHub on November 16, 2026 (tagged at 22:11 UTC). Most of it is fixes, but five changes alter behavior for existing setups:

Change Before 2.1.326 After 2.1.326
Sandbox writes (macOS, Linux, WSL) Sandboxed commands could write widely No writes to some sensitive home folders by default; opt back in per path
HIPAA org sessions Mode depended on setup Start in auto mode by default; disableAutoMode turns it off
Sessions with no mode set Started in Manual mode when org policy hadn't loaded Start in auto mode when the organization's policy hasn't loaded
Wildcard allow rules Bash(*)-style rules were honored Auto mode ignores rules naming no program or starting with $HOME
Hook block decisions A "block" could be bypassed in some cases Holds in more cases — a hook that always blocks now really blocks

Two more defaults shifted quietly: the PowerShell tool asks before some additional commands and refuses them in unattended runs unless an allow rule or auto mode permits them, and the Bash sandbox now keeps its state within a session until you run /sandbox or /cd, so a permission decision can stick. Settings values nested more than 64 levels are dropped with a warning, replaced by a crash or partial application.

Why the defaults moved now

This is the third Claude Code release in five days to touch trust boundaries. 2.1.323 introduced Code Mode and tightened Bash and sandbox permission checks, and 2.1.325 made sandboxed Bash ask for permission by default after fixing a zstd decoding issue. The context: an attacker reached Cursor's extension marketplace through a key stolen from vendor Fireworks AI and put a trojanized Claude Code extension in front of up to 5,000 users for roughly 11 hours in late October — Cursor's own incident update documents the chain. OpenAI's Codex CLI 0.169 moved the same direction, keeping project configuration and MCP servers disabled in untrusted directories unless you pass --trust explicitly (OpenAI's own changelog documents the change), which our Codex 0.169 trust guide covers in depth. Coding agents are converging on the same lesson: ship restrictive, let users widen.

Setup guide: fix the three things 2.1.326 breaks

Update first — claude --version should report 2.1.326, and claude update gets you there. Then walk this checklist; on Windows PowerShell or Linux/WSL these three account for nearly all the friction.

1. Sandbox refuses to write a folder you need. Allowlist the exact path in user or managed settings. The release notes name the setting sandbox.filesystem.allowWrite:

{
  "sandbox": {
    "filesystem": {
      "allowWrite": ["/home/you/projects/scratch"]
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

Keep the list narrow — this setting exists because the default now protects home directories like ~/.ssh and dotfile folders, so widening it to $HOME recreates the old behavior. If every edit suddenly asks first, check whether your workspace contains a link to an unreadable or network path; Anthropic flags that as the trigger (release notes).

2. Wildcard rules stopped matching. Auto mode now ignores shell allow rules that name no program or begin with $HOME, and judges backslash-path rules on Windows, so a rule like a bare * falls back to the safety check. Replace one broad rule with exact rules for the commands you actually run — Bash(npm test*) keeps its allow, the catch-all does not. Anthropic notes rules starting with .\ on Windows may return in a future release.

3. A hook now fires its block for real. If you maintain a PreToolUse hook that always prints "decision": "block", sessions that ran before will start blocking calls it previously let through — the decision now holds in more cases. Fix the hook, don't disable it; the blocked-call list appears in /permissions.

CI note: unattended PowerShell runs may now refuse some commands outright. Give the runner an explicit allow rule, run it under auto mode, or use bypass-permissions mode where your threat model tolerates it.

The quiet win: /update-config context cost

The least visible change is the most useful day to day. /update-config in the terminal now uses about 13,000 tokens of context instead of 93,000 (release notes) — on a 200,000-token session that difference is the equivalent of keeping an entire extra working file in context on every settings edit. A rejected settings edit also now quotes only the changed settings, so retry loops stop re-reading the whole file.

One more pairing worth noting: 2.1.326 is the first version where Code Mode can run inside agent teams — team sessions with Code Mode already enabled now start in Code Mode. Anthropic's docs state agent teams plus Code Mode requires this version or later, so teams that hit "it can't be used together with agent teams yet" last week should update and retry.

FAQ

Q: What changed in Claude Code 2.1.326?
A: Released November 16, 2026 — sandboxed commands on macOS, Linux and WSL no longer write to some sensitive home folders by default, HIPAA-org and unset-mode sessions start in auto mode, broad wildcard allow rules are ignored, a hook's "decision": "block" holds in more cases, and /update-config context use fell from 93,000 to 13,000 tokens (GitHub release notes).

Q: How do I fix sandbox write refusals after updating?
A: Add the path to sandbox.filesystem.allowWrite in ~/.claude/settings.json (user) or managed settings, keep it to exact project folders, and re-run the command — a session-wide reset via /sandbox also clears a stuck state.

Q: Does Code Mode work with agent teams now?
A: Yes, from this release: 2.1.326 or later is required for Code Mode inside agent teams per Anthropic's Code Mode docs; sessions with teams and Code Mode enabled start in Code Mode.

Q: Why do my PowerShell commands ask for permission now?
A: 2.1.326 widened the PowerShell tool's ask-before list; unattended runs refuse the extra commands unless an allow rule, auto mode or bypass-permissions mode allows them (release notes).

Q: Should organizations disable auto mode after this release?
A: Not necessarily — HIPAA-configured orgs get a server-side classifier on direct Anthropic API connections like other organizations, so if auto mode is unacceptable for your workflow set disableAutoMode; otherwise the new defaults are the safer posture.


Last verified: November 17, 2026. Sources: Claude Code v2.1.326 release notes (GitHub), Anthropic Code Mode docs, Cursor security incident update, Codex CLI v0.169.0 changelog (GitHub), AI Tracker summary. Corrections log: none. This article was drafted with AI assistance and fact-checked by the editor — see how we work.

Top comments (0)