How to reduce Claude Code costs

To cut Claude Code costs, send less tool output, fewer tool schemas and fewer cache rewrites on each call, because Claude Code sends the whole conversation again on every call. Do the free steps first, then route Claude Code through Context Mode: a long Claude Code session on Claude Opus 5.5 cost 65.5% less, $7.20 down to $2.49.

What to do:

  1. Do the free steps from Anthropic's cost guide: see what you can change yourself.
  2. Connect Claude Code or Codex to Context Mode with one command: npx @context-mode/cli. See the quick start.
  3. Watch your own tokens, cost and saving per request in the console.

Key facts

What it is
A guide to where Claude Code spends tokens, what you can change yourself, and what Context Mode changes on the request path.
Who it is for
Developers and CTOs who find Claude Code too expensive, on API billing or on a Claude plan.
Clients
Claude Code. Context Mode also works with Codex. Codex cost is measured per request, but no Codex A/B has been run yet.
Measured result
Claude Code on Claude Opus 5.5 cost 65.5% less on a long agentic coding session, which went from $7.20 to $2.49, 4 of 4 pairs cheaper, run on 2026-10-03. Over 168 shorter paired runs on 2026-09-29, 155 cost less and 168 of 168 tasks passed in both arms. Method and evidence.
Limits
We measured cost at list price, not plan usage limits. A short question with few tool calls leaves little to save.

Where Claude Code spends tokens

A coding agent sends the whole conversation to the model on every call. Four things decide the cost:

Anthropic's own cost page puts the average at about $13 per developer per active day and $150 to $250 per developer per month across enterprise deployments (Manage costs effectively, read 2026-10-01).

What you can change yourself

Anthropic's cost page lists steps that need no extra tool. Among them: manage context early, choose the right model, cut MCP server overhead, move instructions from CLAUDE.md into skills, adjust extended thinking, send verbose work to subagents, and write specific prompts (Manage costs effectively, read 2026-10-01). Do these first. They cost nothing.

What Context Mode changes

The gateway sits between Claude Code and the model API. It changes what each request carries, and does not change your files or your agent's settings.

Context SavingTest, build, install and log output folded the first time the model sees it. The failing test stays; passing tests become one line. The full output is archived.
Thinking in CodeThe agent writes a short script, the gateway runs it, and only what it prints reaches the model.
Tool schemasLong tool descriptions are trimmed, and the model can ask for the full definition when it needs it.
Cache marksThe fixed part of the prompt start gets its own cache mark, and fetched pages are marked for a 5-minute cache. See Prompt caching.
Active ContextHow much history a thread keeps: 200K, 500K or 1M. Older parts move to an archive the agent can read back.

The gateway adds its own tools, memory and skills, and those cost tokens. The results below count both sides. Every change is listed in Context Saving.

What it saved

Paired runs against Claude Code going direct, on Claude Opus 5.5, 2026-09-29. Ranges are 95% intervals. Task success was equal in both arms on every row.

CategoryTaskPairsGateway vs direct
Agentic CodingCode search (grep over 150 files)16Opus 5.5: 29% lower cost (23 to 34%)
Agentic CodingOne-line edit12Opus 5.5: 28% lower cost (14 to 42%)
Agentic CodingRepo history question (git log, 320 commits)16Opus 5.5: 25% lower cost (16 to 34%)
Large Tool-Output HandlingOne large log16Opus 5.5: 22% lower cost (15 to 30%)
Test-Driven Debuggingnpm test fix loop, short16Opus 5.5: 22% lower cost (16 to 28%)
Multi-Agent OrchestrationThree parallel subagents, then one more20Opus 5.5: 15% lower cost (12 to 19%)

An instructions block asking for short answers was on in every Context Mode run. Cost is list price applied to the token counts Anthropic returned. Every result for both models, with its method and evidence.

On a Claude plan

We measured cost at list price, not plan usage limits. On API billing the saving is cash. On a Claude plan it is list-price value, not cash, and we make no claim about how long your plan's limits last.