Running tools together with code Claude writes
Anthropic on Nov. 17 (6:18 a.m. Nov. 18 Japan time) introduced "Code Mode," a new experimental feature of its programming tool "Claude Code," on @ClaudeDevs, its X account for developers. According to the post, Claude writes scripts that combine several tools and can respond to the user while long commands are running. Only users who set the environment variable CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1 can use it.
Check out Code Mode, a new, experimental way for Claude Code to work with tools. Claude writes scripts that chain your tools together in sophisticated ways, and it can answer you while long commands are still running. Opt in with CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1
According to the official documentation, Claude Code has had Claude call tools such as running commands (Bash) or reading and editing files (Read, Edit) one at a time, reading each result before deciding its next step. In Code Mode, Claude writes JavaScript code that calls the tools, and Claude Code runs that code inside the user's session. One piece of code can run several commands in parallel, use one result in the next call, and return only the part of the output that Claude needs to read.
The documentation lists tasks suited to the feature: the same change repeated across many files, searches whose results need filtering before Claude reads them, and several independent commands that can run at the same time. The conversation shows the tool calls, such as an edit's diff, and the code itself can be read by opening the transcript viewer.
Experimental and off by default
The documentation describes Code Mode as "experimental and off by default" and states that it may change or be removed in any release. In Claude Code's official changelog, it was added in version 2.1.323, dated Nov. 12, as an experimental opt-in (a method users turn on themselves) in which Claude writes JavaScript to call its tools. Fixes and changes related to Code Mode have followed in 2.1.325 dated Nov. 13, 2.1.326 dated Nov. 16 and 2.1.327 dated Nov. 17.
To turn it on, users start Claude Code with the environment variable set to 1 in their shell, or write the same variable in the env block of their user settings file ~/.claude/settings.json. The variable is ignored if written in a project's settings file. The documentation explains that a repository a user clones cannot turn on Code Mode on the user's behalf. A confirmation appears before the first use.
Anthropic has not disclosed when the feature will be formally offered or figures on its effect, such as how much faster work becomes with Code Mode. The documentation and the post also do not say whether it carries an additional charge.
Only in an interactive terminal
The documentation lists many requirements. It requires Claude Code v2.1.323 or later (on either of the two release channels) and a Claude subscription or Console account. It cannot be used through a gateway or through Amazon Bedrock, Claude Platform on AWS, Google Cloud's Agent Platform, Microsoft Foundry or Claude Models on Google Cloud (Anthropic managed). Organizations that use the HIPAA (the U.S. health information rules) configuration or zero data retention (an arrangement under which data is not stored) are also excluded.
Supported models are Claude Opus 5.5, Sonnet 5.5, Haiku 5.5 and Fable 5.2. It works only with Claude Code run interactively in a terminal, and cannot be used with the one-shot -p mode, the Agent SDK development kit, the VS Code panel, the desktop app or cloud sessions. It requires the native build of Claude Code, and on Windows "Git for Windows" must be installed. Using it with the "agent teams" feature turned on requires v2.1.326 or later.
Code Mode does not start if settings such as an API key helper, OpenTelemetry export of telemetry data or DISABLE_TELEMETRY are on. The documentation says that even on v2.1.323 or later, a message may say the feature is not yet open to the user's account, and advises trying again another day if the message remains after checking the network connection. Anthropic has not said whether it is opening the feature in stages.
Long tasks stop after 10 minutes, and some features are unavailable
The documentation also lists limits users should accept before turning it on. When Claude waits for code, it answers after the code finishes, and the code stops after 10 minutes. The 10 minutes include time the user spends answering permission prompts. If running code continues in the background, the user can keep talking to Claude, and the code can run for up to two hours. To run code in the background, the session must start in the "auto" (auto mode) or "bypassPermissions" permission mode.
In a Code Mode session, the "Remote Control," "Claude in Chrome" and "computer use" features cannot be used. The session also cannot be moved to the desktop app or turned into a background session.
Calls inside code still go through permission rules
Tool calls inside code Claude writes go through the user's deny and ask rules and "hooks" (automated steps users set up) that run before a tool is used, under the tool's usual name. In auto mode, the automated check reviews the whole piece of code before it runs. According to the documentation, that review does not see values decided at run time, such as a file path taken from search results. It therefore asks users to keep rules or hooks for calls they must control. In other permission modes, code starts without a review, and the user is prompted for each call that would prompt in that mode.
The documentation cautioned that Bash rules, which match command text, can let a denied command run in a form the rule does not match, with or without Code Mode. For limits that do not depend on command text, it points users to sandboxing (an isolated execution environment).
Code Mode must stay on to resume, and organizations can block it
To resume a session started in Code Mode with --continue or --resume, the environment variable must remain set to 1. With it off, Claude Code refuses to resume the session. Sessions started without Code Mode resume without it, even with the variable set.
To turn it off, users remove the variable from their shell and user settings file, or set its value to 0, and start a new session. A 0 in either place keeps it off even if 1 is written in the other. Administrators can prevent everyone in their organization from using Code Mode by setting the value to 0 in managed settings distributed across the organization. Users already in Code Mode stay in it until they exit or restart, after which they cannot resume their earlier Code Mode sessions. Managed settings cannot be used to turn Code Mode on for users.






