Claude Code 2.1.323: Code Mode lands, sandbox tightens across the board
2.1.323 adds Code Mode, where Claude writes JavaScript to call its own tools, tightens the sandbox and permissions on a dozen fronts, and changes the default context window for unrecognized models.
Claude Code 2.1.323, released on November 12, 2026, piles on roughly twenty additions, around fifty changes, twenty-one improvements, and a hundred ninety-five bug fixes. One thread runs through much of the list: the sandbox and permissions tighten on more than a dozen distinct fronts, alongside two more visible decisions that change an actual reflex. Claude can now write JavaScript to call its own tools instead of chaining them one at a time, under the name Code Mode. And the context window Claude Code assumes for a model it doesn't recognize jumps from 200,000 to 1 million tokens, which changes how a third-party session behaves before you notice anything.
Code Mode: Claude writes JavaScript to call its own tools
2.1.323 adds Code Mode, an experimental, off-by-default option where Claude writes JavaScript to call its own tools instead of chaining them one at a time. In principle, a script that orchestrates several calls at once can skip the back-and-forth each individual tool call usually triggers, but the changelog doesn't quantify any gain. The changelog points to a dedicated doc page for turning it on or off at the organization level, but that page wasn't reachable at the time of writing: neither the limits, nor the list of compatible tools, nor how permissions apply to the script itself were verifiable anywhere beyond that one changelog line. Try it on a project you can afford to break before treating it as a real substitute for ordinary tool calling.
Sandbox and permissions tighten on a dozen fronts
The "changed" column of this release is dominated by one move: closing blind spots in the sandbox and permission system, across more than a dozen distinct points. The Bash sandbox enforces its write boundaries on the filesystem, and the docs note that the OS, not the model, holds that line on the running process. On macOS, Linux, and WSL, 2.1.323 now ignores write access granted through a symlink in a writable folder when that symlink leads elsewhere or to a missing path: grant the real path instead. Still on the sandbox side, on macOS and Linux, git worktree add, move, and remove now fail as read-only, as do commits in a worktree the session wasn't started in or given, even one inside the project: if your workflow creates or commits in worktrees from a sandboxed command, expect a failure where it used to go through.
Three narrower changes close finer gaps. A "don't ask again" rule that looks like it holds a secret, or that would be saved to a git-tracked settings.local.json, now only holds for the session and isn't saved at all. The tool Claude uses to finish signing in to an MCP server now asks for confirmation even in auto mode and bypass mode; in dontAsk mode, nobody can answer on its behalf, so run /mcp by hand instead. And for self-hosted runners started with --trust-workspace false, as well as VS Code sessions opened in an untrusted folder, a repository's own settings can no longer turn off your hooks or flip plugins on or off: a repo cloned from an unknown source can no longer strip your own guardrails. Apart from granting the real path instead of a symlink and running /mcp in dontAsk mode, none of this needs any action beyond updating, but it's worth knowing these doors are closing before you hit a refusal mid-session.
The default context window jumps to 1M for unrecognized models
The change most likely to catch you off guard touches models Claude Code doesn't recognize, say, behind a gateway that returns a custom model ID. Until now, such a model was treated as having a 200,000-token window. 2.1.323 bumps that default assumption to 1 million tokens. The model configuration docs explain that some models, the Fable models, Sonnet 5 and later, Haiku 5.5, and Opus 4.7 and later, already run at 1M natively with nothing to turn on, and that CLAUDE_CODE_DISABLE_1M_CONTEXT=1 brings a session back to 200K by removing the [1m] model variants from the model picker. The real risk: if you're running a third-party model whose actual window is smaller than 1M, Claude Code now waits longer before compacting, and once the window genuinely fills up, the session can fail on every turn until you run /clear, instead of compacting in time. If that's your setup, set CLAUDE_CODE_DISABLE_1M_CONTEXT=1 before the window fills, not after. Otherwise, /autocompact lets you set a smaller window so compaction kicks in earlier.
/logout finally does something, and the v1 MCP client is gone
Two narrower changes deserve a separate mention. /logout run in a background session used to do nothing useful; 2.1.323 makes it sign out every one of your sessions on the machine, delete stored MCP logins and plugin secrets, and end the session, exactly as it would in a terminal. If you'd gotten used to /logout having no visible effect in a script or a hook, that's no longer true as of this version. And the v1 MCP client is gone: the MCP docs describe two generations, v1 built on MCP TypeScript SDK 1.x and v2 on SDK 2.0, and Claude Code has already been defaulting to v2 since 2.1.232 in sessions that fetch feature flags, and since 2.1.274 in the others. With the v1 client removed, setting MCP_SDK_GENERATION=v1 now runs the v2 client in a compatibility mode, with a handful of relaxed OAuth checks, rather than falling back to the old code: if an MCP server you rely on needed that setting to work, check it still holds up on 2.1.323.
The rest fits in a few lines. Other additions include an engines["claude-code"] field in plugin.json, which keeps a plugin from being installed, updated, or loaded outside the Claude Code version range it declares, an options menu when a model needs usage credits that are off or used up, a progress heartbeat every 30 seconds while a hook runs long in -p or an SDK session so a host like Claude Desktop doesn't end the turn as hung, .docx support for Artifact tool uploads, and on the VS Code side a trust prompt before the first session in a folder you haven't approved yet. Among the hundred ninety-five bug fixes, about twenty close gaps in Bash permission checks and the sandbox, two of them worth singling out: --permission-mode auto or a defaultMode: auto setting used to sometimes start in a more permissive mode than intended when auto mode wasn't available, it now starts in Manual mode, which asks first; and the Bash sandbox now fully protects Claude Code's own configuration on installs still using the legacy config file. The rest, Claude Tag, Code Review, Remote Control, is mostly administration or narrower edge cases.