Claude Code adds experimental Code Mode: the model writes JavaScript to run its tools
Anthropic has added an experimental Code Mode to Claude Code in which the model writes JavaScript to drive Bash, Read, and Edit calls instead of requesting each one separately. It is off by default, requires v2.1.323 or later, and Anthropic warns it may change or be removed in any release. Anthropic has published no token or latency figures for it.
Anthropic has added Code Mode to Claude Code, an experimental feature in which the model writes JavaScript to drive its tools instead of requesting each Bash, Read, or Edit call separately, InfoQ reports. Code Mode is off by default, requires Claude Code v2.1.323 or later, and is enabled with the CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1 environment variable. Anthropic warns it may change or be removed in any release.
How it works
In a normal session, Claude asks for one tool call, reads the full result, and decides the next step. In Code Mode, one script can run commands in parallel, pass one result into the next call, and return only the output the model needs. The documentation's example finds a file with rg, raises a retry limit, runs the tests, and returns just the path and test output.
The conversation still shows each tool call and diff, while the generated code sits in the transcript viewer. Anthropic recommends Code Mode for edits repeated across many files, searches that need filtering, and independent commands.
Code that Claude waits on stops after ten minutes. Sessions started in auto or bypassPermissions mode can push it to the background for up to two hours while the conversation continues.
Permission model
Each call inside a script still goes through deny and ask rules and PreToolUse hooks. In auto mode, however, the classifier reviews the script before it runs, not each call, and cannot see values computed at run time.
A git push can now reach a hook as cd 'app' && git push, so hooks must check every part of a command. A hook matching the REPL tool can read the JavaScript from tool_input.code.
Project settings cannot enable Code Mode, so a cloned repository cannot switch it on. Administrators can block it through managed settings.
Availability limits
Code Mode runs only in interactive terminal sessions of the native build, on Opus 5.5, Sonnet 5.5, Haiku 5.5, or Fable 5.2, through a Claude subscription or Console account. It does not work with -p, the Agent SDK, the VS Code panel, the Desktop app, Amazon Bedrock, gateways, or zero-data-retention organizations. Agent teams need v2.1.326. Feedback goes through /feedback.
Early measurements
Anthropic has published no token or latency figures. User George (@bolyki) compared Code Mode with normal mode across eight interactive Sonnet 5.5 runs and posted: "Same results every time. Context 20-25% smaller. On the bigger task: 37% fewer tokens, 19% lower cost. But it is not faster, and on a tiny task it cost more."
Ravi Madabhushi, who builds agent auth infrastructure, pushed back on claims that the feature makes MCP obsolete. He said it "doesn't materially change anything wrt authentication, authorization and audit policy layers," and that the agent still makes the same MCP calls with the same auth tokens and context. What changes, in his words, is how much context gets into the model window and how much can be discarded.
Prior art
The idea and the name predate Anthropic's release. Cloudflare introduced Code Mode for MCP, which converts MCP tools into a TypeScript API that models code against inside sandboxed Workers, where bindings keep API keys away from generated code. Anthropic's own post on code execution with MCP described one workflow dropping from 150,000 to 2,000 tokens, and the Claude API offers programmatic tool calling in a remote code execution container. Claude Code's Code Mode instead runs the script in the developer's local session, against Claude Code's built-in tools and permission system.
What this means
The main change for teams is where review happens. Per-call permission rules and hooks still apply, but in auto mode the classifier sees the script rather than each call, and it cannot evaluate values computed at run time. Existing hooks that match on a plain command string may need to be rewritten to inspect compound commands or the REPL tool's code input.
The efficiency case rests on limited evidence. The only figures are one user's eight Sonnet 5.5 runs, which show smaller context and lower cost on a larger task, no speed gain, and higher cost on a tiny task. Madabhushi's point is that the gains concern context volume, not authentication or audit layers.
The controls (off by default, no enablement from project settings, an administrator block) and the long list of unsupported surfaces mark this as an opt-in feature for local interactive terminal use.
Related Articles
Perplexity launches Monitor API: scheduled web search that pushes changes to agents via webhook, $1 per 1,000 runs
Perplexity has launched the Monitor API, which searches the web on a schedule and sends only relevant changes to apps and agents via webhook. Web monitors cost $1 per 1,000 successful runs, and page monitors cost $1 per 1,000 fetched URLs. In an early internal test, Perplexity claims it delivered 63 fresh, relevant pages in eight hours against 20 for Firecrawl.
Anthropic mathematician claims Riemann Hypothesis proof with Claude; Lean community certifies it correct
Anthropic mathematician Levent Alpöge said on November 20 that he and Claude found a proof of the Riemann Hypothesis, published as a formal proof in Lean. On November 21, the Lean and Mathlib communities issued a joint statement certifying the proof as correct. No human-readable paper exists yet.
Cline v4.1.27 fixes reasoning-effort errors that caused GPT-6 and gpt-5.6 tool-call rejections
Cline v4.1.27 fixes several reasoning-effort bugs that caused GPT-6 and gpt-5.6 endpoints to reject tool calls. It also refreshes the model catalog with 94 new providers and changes default models for 67 others.
Anthropic mathematician Levent Alpöge claims Claude-assisted proof of the Riemann hypothesis, posts it in Lean
Levent Alpöge, a mathematician employed by Anthropic, says he has proven the Riemann hypothesis, first proposed in 1859, working with Claude. He posted the proof coded in Lean, and experts have yet to confirm that it is correct.
Comments
Loading...