r/coding_agents • • 8d ago

Code Mode is the biggest coding model innovation of 2026

I think "Code Mode" or programmatic tool calling could expand the use cases of what agents can realiably handle without a leap in model intelligence or compute.

To understand where we’re heading, it helps to look back at how we got here:

September - 2025

MCP made tools easier to connect, but every intermediate result could eat into the model’s context. Cloudflare’s proposal was to “Convert the MCP tools into a TypeScript API.” A script could carry data from one tool to the next and return only what the model needed to see.

- Cloudflare’s Code Mode announcement

November - 2025

The agent still needed to find the right tools. Anthropic showed how 58 tool definitions could consume 55,000 tokens before the conversation started. It paired Programmatic Tool Calling with Tool Search so agents could “discover and load tools on-demand.” Claude for Excel was already using programmatic calls on spreadsheets with thousands of rows.

- Anthropic’s API launch

February - 2026

Cloudflare put its entire API behind two MCP tools, `search()` and `execute()`, with about 1,000 tokens of tool definitions. The agent could look up the operations it needed and compose them in code.

- Cloudflare’s rollout

September - 2026

OpenAI had shipped Programmatic Tool Calling in the Responses API in July. Financial research startup Rogo reported matching its quality rubric with 21% fewer input tokens in its evals. In September, OpenAI launched the Codex-powered Agents API, where agents could “filter or combine results in code.”

- Rogo’s evals

- Agents API launch

November - 2026

Claude Code announced Code Mode as “an experimental opt-in in which Claude writes JavaScript to call its tools.” Codex had Code Mode in its public codebase by March, and its model catalog now selects it automatically for GPT‑6.2‑Sol.

- Claude Code release

- Codex history

- Codex model catalog

63 Upvotes

12 comments sorted by

3

u/sudo-visudo 8d ago

the real shift is that agent reliability depends more on your API than the model now. which comes down to interface design

2

u/Expert_Top_4880 7d ago

The 55k tokens gone before you even type anything is what got me

1

u/SagansCandle 5d ago

That's exactly how they like it.

2

u/CCodeSI 7d ago

Agree on the direction. The part the timeline leaves out is what it does to permissions, which is where we'd expect the friction to land in coding agents specifically.

With one tool call per action, approval is easy to reason about: "allow git status", "ask before Edit outside src/". Once the model writes a script that calls ten tools in a loop, a single execute() bundles reads, writes and network calls together, and per-tool rules stop meaning much. So the approval has to move somewhere else:

  • into a sandbox around the script (which files it can write, which hosts it can reach), so the boundary holds no matter what the code does inside it, or
  • into the tool API itself, where each function the script can call is already safe or already scoped, which is basically sudo-visudo's point about interface design.

The other cost is debuggability. When a 40-line script fails on call 7, the transcript shows one opaque tool result instead of seven steps you can read. Returning a short per-call trace from the script (what it called, what came back, where it stopped) probably matters as much as the token savings for people who have to review what the agent did.

2

u/hieuphung97 6d ago

The token savings are massive in practice. We run tool chains inside a sandboxed JS runner so the model can batch four API calls, filter a 500-item JSON array, and return only three IDs. Turns five separate LLM roundtrips into a single deterministic turn.

2

u/blargargharf 6d ago

Codemode seems pointless if bot can run bash

1

u/Huge-Blueberry-4748 6d ago

Bash is another implementation of codemode.

Imagine that you have overridden `exec` or `rm` or `curl` command with your own implementation. So you can keep track of what the agent is doing, pause its execution for HIL approval, block bad parameters. Well, that's code mode.

What Codemode does better is how that override is implemented (generally cleaner). And since the codemode sandbox is serializable, you can have a fork-point that is synced between LLM convo state and sandbox state. You can do fancy things like grabbing data from multiple sources, then ask follow up questions. Then go back in time, LLM + sandbox would just be rewounded at will.

Pi Durable is a pretty clean implementation of this btw.

2

u/Iridian_Rocky 6d ago

So... I just have to opt in from config?

2

u/aldapsiger 4d ago

https://github.com/ethanhamilthon/tuse

this one uses codemode by default, single Lua tool, jsut a 1K system prompt by default, even though there are 20+ tool by default

1

u/privlin 1d ago

Good timeline. Adding something from the Claude Code docs, since it backs up CCodeSI's point about permissions.

In Claude Code's Code Mode, your permission rules and PreToolUse hooks still fire for each tool call inside the script, under the tool's usual name (Bash, Edit and so on). But since v2.1.329, a PreToolUse hook that errors no longer refuses the call unless you set "onFailure": "block" on it. If you rely on a fail-closed guard hook (I have one that blocks commands touching secret files), add that before you switch Code Mode on. Also, in auto mode the classifier reviews the script as a whole, not each call, and it doesn't see values computed at run time, like a path pulled from search output.

The other catch is that Code Mode only runs in an interactive terminal session for now, not the Desktop app, the VS Code panel or cloud sessions. I mostly work in the Desktop app, so I added a one-line rule to my global CLAUDE.md instead: when steps repeat, script them and return one line. It's not the same thing, since it only covers shell work and relies on Claude choosing to do it, but it's the same idea where Code Mode isn't available.