@readmodelmag
MODEL

Tools

Claude Code's new Code Mode: check your permission setup first

SummaryCode Mode has Claude write JavaScript that makes several tool calls in one step. Per Anthropic's docs, auto mode's classifier then reviews the script, not each call. Here is what to keep in rules and hooks.

· MODEL Editors · 3 min read

Some links may be affiliate links. Disclosure

MODEL card on a cream background. Small red kicker: BUILDER TIP / CLAUDE CODE. Black headline: Auto mode reviews the script, not each call. Bottom left: MODEL. Bottom right: Sources: Anthropic Claude Code docs, changelog.
MODEL card for this story. Illustration by MODEL. Original. Image source.

Batching tool calls is fine. Just know what your safety check is actually reading.

Claude Code v2.1.323, released Nov. 12, 2026, added Code Mode, an experimental, opt-in feature (changelog (opens in a new tab)). Without it, Claude asks for tool calls such as Bash, Read or Edit one at a time and reads each result before deciding what to do next. With it, 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 output Claude needs (Anthropic docs (opens in a new tab)). It has been a busy topic among developers on X this weekend.

What changes for permissions. Per Anthropic's Code Mode page:

  • In auto mode, the classifier reviews each piece of code before it runs, not each tool call. The docs say it "doesn't see values computed at run time, such as a path taken from search output, so keep rules or hooks for calls you must control."
  • Every tool call the code makes still goes through your deny and ask permission rules and your PreToolUse hooks. You don't need to change a rule or matcher for a tool such as Bash.
  • In the other permission modes, the code starts without a review and you're prompted for each tool call that would prompt you in that mode.
  • To check the script itself, write a PreToolUse hook that matches REPL, the tool that runs Claude's code, and read the JavaScript from tool_input.code.
  • The docs also warn that Bash rules match command text, so a denied command can run in a form the rule doesn't match, with or without Code Mode. For limits that don't depend on command text, they point to sandboxing.

Limits to know before you turn it on.

  • Unless code can run in the background, you wait for it, and it stops after ten minutes, including time you spend at permission prompts. Background code (started in auto or bypassPermissions mode) can run for up to two hours.
  • Interactive terminal sessions only: no -p, Agent SDK, VS Code panel, Desktop app or cloud sessions. No Remote Control, Claude in Chrome or computer use.
  • You need a Claude subscription or Console account on the Anthropic API (not a gateway, Bedrock, Google Cloud or Foundry), the native build, and Opus 5.5, Sonnet 5.5, Haiku 5.5 or Fable 5.2.
  • A Code Mode session can be resumed only in the terminal with Code Mode still on.
  • It is experimental, off by default, and "may change or be removed in any release."

How to try it. Update to v2.1.323 or later, then start a session with:

CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1 claude

Confirm the prompt, then press Ctrl+O to open the transcript viewer and expand a Code row to read what Claude wrote. Claude Code ignores this variable in a project's settings files, so a repository you clone can't switch Code Mode on for you. Admins can block it by setting the variable to 0 in managed settings.

One version note: as of 11:30 a.m. PT on Nov. 15, npm's stable tag for @anthropic-ai/claude-code was still 2.1.311 and latest was 2.1.325. The docs say stable-channel users who can't reach v2.1.323 should wait for stable to catch up or switch to latest.

Our take. Keep anything you must control in deny rules, PreToolUse hooks or a sandbox, where every call gets checked. Don't rely on a classifier's read of a script to catch a path it can't see until run time.

From Anthropic's documentation. MODEL has not run Code Mode for this story. Not sponsored. -- MODEL Editors

Get three tested tools every Friday

Free, weekly. Unsubscribe anytime.

Sources

  1. Run tool calls from code with Code Mode

    Anthropic (Claude Code docs)

  2. Claude Code changelog (2.1.323)

    Anthropic

  3. @anthropic-ai/claude-code on npm

    npm

FREE · EVERY WEEK

The top AI tools this week, tested.

Every week MODEL's editors pick the AI tools worth your time, try them hands-on, and tell you what's good, what's not, and who it's for. Free, in your inbox.

Free. Unsubscribe anytime. Our picks are editorial and can't be bought.