How Claude Code bundles tool calls into one script
Anthropic added experimental Code Mode in Claude Code 2.1.323 on November 12. In a Code Mode session, Claude can write JavaScript that calls tools, passes one result into the next call, and returns the part of the output the model needs. The feature is off by default. Claude Code changelog.
One task, several commands
Suppose you ask Claude to find repeated timeout settings and group them by module. A script can run the search, parse the matches, and return a compact table of paths, line numbers, and values. The model can use that table to explain discrepancies. The benefit depends on how much intermediate output the script can filter and how many follow-up actions it can determine from the search results. A single short request is unlikely to benefit much. How Code Mode calls tools.
How to try it in the terminal
Check your client version and start a separate interactive session in your repository. Anthropic lists 2.1.323 as the minimum for the basic setup. Some providers and settings need a newer release. Use the following commands on Linux, macOS, or WSL.
claude --version
CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1 claude
Start with a simple prompt. “Find every use of setTimeout in the source files, group the results by folder, and leave the files unchanged.” To see the generated script, press Ctrl+O and expand the Code row. Repeat the task in a regular session and compare how complete the lists are and how many intermediate steps each run used. Anthropic's setup instructions and requirements.
Permissions inside a script
Tool permissions and PreToolUse hooks apply to calls from Code Mode. In modes that ask for approval, Claude Code prompts when those rules require it. In Auto mode, a classifier reviews the script before it runs. If an action needs to be checked using its actual argument, add a rule or hook for the specific tool. Code Mode permissions.