SDSignal Desk

Claude Code’s Code Mode trades round-trips for a coarser safety check

· Updated · Signal Desk newsroom

Analysis of reporting by MarkTechPost. How we work

Image: MarkTechPost

The experimental feature lets Claude write JavaScript that chains Bash, Read and Edit calls in one step. It should speed up multi-file work, but Anthropic publishes no savings figure and auto-mode review gets less precise.

Key takeaways

  • Code Mode shipped in Claude Code v2.1.323 as an opt-in, experimental feature enabled with an environment variable.
  • It works with Opus 5.5, Sonnet 5.5, Haiku 5.5 and Fable 5.2, in the interactive terminal only, via Anthropic’s API or a Claude subscription.
  • Code Claude waits on stops after 10 minutes; background code can run up to 2 hours.
  • In auto mode, a classifier reviews the whole program rather than each tool call and cannot see values computed at run time.
  • Anthropic gives no token-saving number; one third-party test measured 11.1k versus 24.6k tokens of system-tool context.

What changes in the loop

Normally Claude Code asks for each Bash, Read or Edit call one at a time and reads every result before choosing the next step. With Code Mode on, Claude writes a short JavaScript program and Claude Code runs it in the session. That program can run commands in parallel, feed one result into the next call, and return only the output Claude needs. Anthropic’s example finds a file, edits a retry limit and runs the tests in one step. The user still sees the individual tool calls, such as diffs; the code itself is hidden unless they open the transcript viewer.

This is a pattern, not an invention. MarkTechPost notes Cloudflare coined “Code Mode” for its Agents SDK, Anthropic later published code execution with MCP, and its API’s Programmatic Tool Calling cut average usage from 43,588 to 27,297 tokens on complex research tasks. Factory made a similar bet with its script-mode Droid harness. What is new is applying it to the CLI’s own built-in tools.

Narrow by design

The availability list is long on exclusions. Code Mode needs the native build on v2.1.323 or later, an interactive terminal, and direct Anthropic access. It is unavailable through Bedrock, Google Cloud, Microsoft Foundry or gateways, in the -p headless mode, the Agent SDK, VS Code, the desktop app or cloud sessions, and for organizations with HIPAA or zero-data-retention configurations. Turning off telemetry blocks it. Admins can disable it org-wide but cannot force it on.

That reads like a feature Anthropic wants to watch closely before scaling. Fair enough for an experiment, but it means the developers most likely to benefit, teams running agents in CI or through cloud providers, cannot use it yet. It also means there is no published evidence on how much it helps. Anthropic offers no benchmark; the single independent measurement of 11.1k versus 24.6k tokens of tool context is a hint, not proof.

The permission question

The security trade-off deserves more attention than the speed claim. Each tool call inside the program still passes deny and ask rules and PreToolUse hooks. But in auto mode, the classifier reviews each program as a whole, not each call, and it cannot see values computed at run time, such as a path pulled from search output. In other modes, code starts without review and the user is prompted per call as usual. Hook authors are warned that a git push can arrive wrapped in a compound command.

That is a meaningful loss of granularity in exactly the mode where people hand over the most control. Batching tool calls is efficient, and for repetitive multi-file edits we expect it to feel noticeably faster. But reviewers are now judging a program’s intent rather than its concrete actions. Teams that rely on auto mode should tighten deny rules and hooks before turning this on, especially after incidents like the Claude-assisted intrusion researchers documented.

Who it affects

Terminal-first developers
Fewer round-trips for repeated edits, filtered searches and parallel commands.
Platform and security admins
Coarser auto-mode review means deny rules and hooks carry more weight; the org-wide off switch matters.
Cloud-provider customers
Bedrock, Google Cloud and Foundry users are excluded for now.

What to watch

  1. Whether Anthropic publishes token or latency savings for Code Mode.
  2. Expansion to the Agent SDK, headless mode and cloud providers.
  3. Changes to how auto mode reviews code that computes paths or commands at run time.

FAQ

How do I enable Code Mode?

Set CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1 in the shell or in the env block of ~/.claude/settings.json, on v2.1.323 or later, then confirm the prompt.

Which models support it?

Claude Opus 5.5, Sonnet 5.5, Haiku 5.5 and Fable 5.2.

Does it save tokens?

Anthropic has not published a figure. One third-party test reported 11.1k tokens of tool context with Code Mode versus 24.6k without.

Is it less safe?

Tool calls still pass deny and ask rules and hooks, but in auto mode the classifier reviews whole programs and cannot see run-time values.

Read the original

Continue at the source.

MarkTechPost

Companies: Anthropic

More on Anthropic

All Anthropic coverage →