Skip to main content
Blue Moose logo Blue Moose Field notes
← All articles
claude code

Claude Code's Code Mode: fewer calls, new risks

Green code characters streaming down a dark screen

Until now, every Claude Code tool call has been a round trip: the model asks for a Read, waits for the result, asks for a Grep, waits again. Version 2.1.323, released on 12 November, adds an experimental alternative called Code Mode, and I think it deserves a careful read before anyone flips the switch on a real project.

What it actually does

According to the Code Mode documentation, Claude writes a piece of JavaScript that makes the tool calls, and Claude Code runs that code in your session. One script can run commands in parallel, feed one result into the next call, and return only the part of the output Claude needs to read. The docs' own example finds a file with rg, edits it, and runs the tests in one go.

In the conversation you still see the tool calls, such as the edit's diff, but not the code. Press Ctrl+O for the transcript viewer and expand a Code row to read it. The docs suggest it for changes that repeat across many files, searches whose results need filtering first, and independent commands that can run at once. Same job, fewer round trips, less noise in the context window.

How you turn it on (and off)

It is off by default and flagged as something that "may change or be removed in any release". You opt in by setting CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1, either in your shell or in your user ~/.claude/settings.json env block. Claude Code ignores the variable in a project's settings files, so a repository you clone can't enable it for you. Setting the value to 0 in managed settings blocks it for an organization, and you can't force it on from managed settings.

The limits that matter to me

The requirements list is long. It needs the native build, a Claude subscription or Console account, and an interactive terminal session. It does not work with -p, the Agent SDK, the VS Code panel, the Desktop app or cloud sessions, and not through a gateway, Bedrock, Foundry or Google Cloud. It also refuses to start with some settings on, including apiKeyHelper, agent teams, OpenTelemetry export and DISABLE_TELEMETRY. Sessions can only be resumed in the terminal with the variable still set to 1.

The part I care about most is permissions. Every tool call the code makes still goes through your deny and ask rules and your PreToolUse hooks. But in auto mode, the classifier reviews the code before it runs, not each tool call, and the docs say it doesn't see values computed at run time, such as a path taken from search output. Their advice is to keep rules or hooks for calls you must control. If you want to inspect the code itself, write a PreToolUse hook matching REPL and read tool_input.code. Foreground code also stops after ten minutes; background code can run up to two hours, but only if you started in auto or bypassPermissions mode.

Bash rules match command text, so Claude can run a denied command in a form the rule doesn't match, with or without Code Mode.

That warning is in the docs, and it's the honest summary: Code Mode doesn't create a new hole, but it shifts where review happens from per-call to per-script.

My take: try it on a throwaway checkout, for exactly the many-files-at-once chores it is meant for, and keep your guardrails in rules, hooks and the sandbox rather than in the classifier's judgement. Fewer round trips is nice. Knowing what ran is nicer.

BM
Blue Moose
The moose behind Blue Moose. Full-stack PHP developer — Drupal by day, Symfony by night, tests always.