Cut Claude Code costs. What we measured.
A 30-task skill-routing benchmark, its shared failure, and practical ways to reduce unnecessary context without guessing at savings.
The most useful cost question is how much it takes to finish a task correctly. A shorter conversation can still be expensive if it produces a patch you must redo. Start by measuring a small set of tasks you recognize, record their outcomes, and change one part of the workflow at a time. Our own skill-routing experiment is a useful example of both a saving and the limits of what a benchmark can tell you.
Official documentation checked October 15, 2026. Examples below are illustrative; inspect your installed CLI’s help and existing project settings before applying them.
What we measured across 30 tasks
On October 15, 2026, we compared stock Claude Code with Xval skill routing on 30 paired synthetic coding tasks. Both modes used Claude Code 2.1.300, the exact model claude-sonnet-5-5, medium effort, the same seven native tools and the same skill catalog. Tool routing was off and MCP configuration was empty. Fifteen tasks required fixture-specific skill conventions; fifteen supplied the functional contract in the prompt.
Total CLI list cost was $0.9605469 for stock and $0.5947126 with skill routing: 38.09% lower. Median input tokens, including cache reads and writes, fell from 34,079.5 to 25,622.5, a 24.82% reduction. Those are different measures: a token reduction is not automatically the same percentage cost reduction. The benchmark explanation, results JSON and technical report provide the underlying evidence.
The original automatic checks passed 30/30 in both modes. A later contract audit found the same Python deduplication bug in both outputs, so the conservative result is 29/30 in each mode. Equal observed scores do not establish equivalent quality. One routing mistake loaded an irrelevant skill and produced an unrequested README; that run used more input tokens and took longer even though its list cost was slightly lower.
What the result does not promise
This was one stochastic run per mode on each small, authored task, not a random sample of production repositories. Model, skill inventory, cache conditions and task design all matter. Mode order was balanced, but provider caches were not reset. An invalid shell fixture pair was excluded and replaced after correction; both excluded observations remain recorded. All 62 invocations cost $1.6291474 in CLI accounting, including that pair.
The dollar figures are list-price estimates reported by the CLI, not a subscription charge or an invoice. The experiment did not test Codex, installed-app behavior or large-repository reliability. Treat “about 38% lower” as a description of this trial. It is a reason to measure your own workload, not a forecast for your next bill.
Get a useful baseline before optimizing
Inside Claude Code, inspect usage and the current context:
/usage
/contextAnthropic’s cost guide distinguishes local session cost estimates from authoritative billing. Subscription users should inspect their plan usage as well. Record the authentication route, model, task, elapsed time, retries and final verification. Keep separate columns for input tokens, output tokens and cost so a cache effect cannot masquerade as less work.
Choose a representative bug fix, a routine edit and a task requiring investigation. Define success before running either variant. Preserve failures in the ledger, including work you abandoned. If one configuration produces a cheap first answer followed by three repair attempts, include the repair attempts. Your comparison should end at the same acceptance check for both configurations.
Trim standing instructions with a purpose
A useful CLAUDE.md tells an agent what it cannot safely infer: the relevant test command, unusual repository boundaries and decisions that must be preserved. Audit it for outdated setup steps, duplicate instructions and long examples unrelated to most tasks. Keep the constraints that prevent expensive mistakes. Saving a paragraph is a poor trade if it causes another full debugging cycle.
Anthropic documents how parent and nested instruction files load in its memory guide. Review the actual files your session encounters, including instructions above the project folder. A concise root file can point to a focused document for a rare migration. Put detailed service guidance near the code that needs it, and check that the agent still discovers it during a representative task.
Move occasional workflows into skills
Skills give a repeatable workflow a name and a loading boundary. Anthropic’s skills documentation describes SKILL.md files and direct invocation. A project skill might cover release-note preparation or a particular data export. Write a description that states when the workflow applies; vague descriptions make selection harder.
Start with one workflow that currently occupies a large block of standing instructions. Keep its mandatory constraints intact, then try one task that needs it and one that does not. Inspect whether the right skill was selected and whether the output met the same contract. Installing a large collection of skills is not itself a saving. Routing also has failure modes, as our unnecessary README demonstrated.
Compact at a real handoff point
Before compacting, save the current commit, unfinished files, exact checks and open question in a short local note. Then use the interactive command documented in Anthropic’s command reference:
/compact Preserve the goal, constraints, changed files, checks and next step.Read the summary before continuing. Ask whether another person could find the evidence from it. Compaction helps manage conversation size; it does not repair an inaccurate handoff or reset account limits. For an unrelated task, a fresh session with a focused brief is often easier to audit. Our context habits guide covers that routine.
Choose a model by the whole task
Use /model to inspect available choices; Anthropic’s model configuration guide explains aliases and controls. Evaluate a less expensive option on a bounded, familiar task before making it your default. Escalate when repeated attempts reveal a reasoning gap. An architecture decision and a mechanical documentation correction need not use the same setup.
Keep your comparison boring: same acceptance criteria, recorded model, visible failures. XAgents’ optional Xval Engine is relevant when skill selection is part of the overhead you want to test. The instruction, context and model habits above work in ordinary Claude Code too. See XAgents help for product setup, and verify the result before celebrating the saving.
Common questions
Will skill routing cut my Claude bill by 38%?
That is not established. The measured reduction was 38.09% in total CLI list cost across 30 synthetic task pairs with one model. It was not a subscription invoice or a production workload sample.
Does /compact reset my Claude usage allowance?
No. Compaction summarizes conversation context. It does not replenish your account allowance, and the summary should be checked against your saved task constraints.