How to cut Claude Code and Codex costs
AutoRouter10 min read
Claude Code and Codex costs come down to three things: the model that runs each turn, the size of the context each request carries, and how you pay for it. The model is the biggest lever. At list prices on October 22, 2026, Claude Haiku 5.5 costs a fortieth of Claude Opus 5.5 per uncached token on prompts up to 100,000 tokens, and GPT-6 Luna costs a hundredth of GPT-6 Astra. This guide covers each lever in both apps and links to the detailed guide for it. AutoRouter, the Mac app for Codex and Claude Code, makes the model choice on every turn and uses your ChatGPT and Claude plans first.
Which levers cut Claude Code and Codex costs the most?
The model each turn runs on matters most, then the context each request sends, then how you pay. The table lists the levers in that order, with a first step in each app and the guide that covers it in full.
| Lever | What it changes | First step | Detailed guide |
|---|---|---|---|
| Match the model to the turn | The price of every token | /model sonnet in Claude Code; codex exec -m gpt-6-luna for quick Codex jobs | How to send quick coding tasks to a cheaper model |
| Keep the context small | How many tokens each request re-sends | /clear between unrelated tasks | How Claude Code usage limits work |
| See where usage goes | Which sessions, subagents and servers use the plan | /usage in Claude Code; /status in Codex | How to check your Claude Code usage |
| Give agents smaller models | What subagents and teammates cost | model: haiku in a simple subagent's frontmatter | How to run multiple agents in Claude Code |
| Plan before building | Re-work after a wrong start | Shift+Tab into plan mode for complex tasks | How Claude Code plan mode works |
| Pay the cheaper way | Plan, credits or per-token rates | Price a month of your work at API list prices | Subscription or API: which is cheaper? |
What makes a Claude Code or Codex session expensive?
A session gets expensive when a large model handles every turn and each request carries a long conversation. As of October 2026, Claude Code's default model on Pro and Max is Opus 5.5, so unless you change it, renames and one-line fixes run on Opus too. Anthropic's cost guide says Claude Code sends the whole conversation with every request, that the first message after a break longer than the prompt-cache lifetime reprocesses the full context, and that subagents and agent teammates send requests of their own.
Codex works the same way on the model side. On OpenAI's own estimates, a ChatGPT Plus five-hour window holds 15 to 160 local messages on GPT-6.1 Sol and 350 to 3,000 on GPT-6 Luna, as of October 2026 (OpenAI). Codex usage limits explained lists the ranges for every plan, and How Claude Code usage limits work explains Claude's five-hour and weekly windows.
How do you see where your usage goes?
Type /usage in Claude Code, and check the usage dashboard or /status in Codex. In Claude Code, /usage shows plan usage bars on Pro, Max, Team and Enterprise and a breakdown of which skills, subagents, plugins and MCP servers used your plan, with suggestions for using less (Anthropic). Its dollar figure is an estimate at list price, which matters only when you pay per token. In Codex, your reset times are in the usage dashboard or /status in an active CLI session (OpenAI). How to check your Claude Code usage adds the status line that keeps usage on screen while you work.
Which turns can run on a cheaper model?
Turns whose right result is clear before the model starts can run on a small model: commit messages, renames, one-line shell commands, lint fixes and log summaries. A quick turn that sends 30,000 input tokens and gets 1,000 output tokens back costs about 14 cents on Claude Opus 5.5 and about a third of a cent on Claude Haiku 5.5 at list prices on October 22, 2026, assuming no cache hits. Keep multi-file refactors, hard bugs and UI built from a design on a frontier model; Which model to use for which coding task maps each kind of work to a tier.
Run quick jobs as a separate command so the main session keeps its model and its cache:
# Claude Code: one quick job on Haiku
git diff --staged | claude -p --model haiku "Write a one-line commit message for this diff"
# Codex: the same job on GPT-6 Luna
codex exec -m gpt-6-luna "Write a one-line commit message for the staged changes"
Cheaper models do fall short on long, multi-step work. In its October 7, 2026 launch post, Anthropic reported 39.2% for Claude Haiku 5.5 on Terminal-Bench 4.0 against 70.6% for Claude Sonnet 5.5 (Anthropic). That gap is why Does model routing make your results worse? argues that a model should clear a quality bar for the task before its price counts.
How do you keep the context small?
Clear the conversation between unrelated tasks and keep what loads into every session short. Anthropic's cost guide lists these habits for Claude Code:
- Run
/clearbetween unrelated tasks, and/compactwith instructions about what to keep when you need to carry on. - Run
/contextto see what fills the window, and/mcpto turn off servers you aren't using. - Keep CLAUDE.md under 200 lines and move workflow instructions into skills, which load only when used.
- Lower
/effortfor simple tasks, because thinking tokens bill as output tokens.
Switching models partway through a long session has a cost of its own. Each model keeps its own prompt cache, so after a /model switch the next request re-reads the whole conversation with no cache hits. A subagent starts its own conversation and leaves the main session's cache alone.
Do plan mode and multiple agents save usage or spend it?
Plan mode can save usage, and multiple agents spend more of it. Anthropic's cost guide recommends plan mode for complex tasks to prevent expensive re-work when the first direction is wrong, though planning still reads files and counts toward your limits, as How Claude Code plan mode works explains. The same guide puts agent teams at about seven times the tokens of a standard session when teammates run in plan mode, and subagent requests count toward the same limits as the main conversation. How to run multiple agents in Claude Code shows how to give each agent a model that fits its job.
Should you pay with a plan, credits or an API key?
Pay with a plan when a month of your coding at API list prices would cost more than the plan, and with an API key when it would cost less. As of October 22, 2026, Claude Pro and ChatGPT Plus each cost $20 a month, Claude Max costs $100 or $200, and ChatGPT Pro costs $100, $200 or $500. Anthropic reports Claude Code averaging about $13 per developer per active day at API prices across enterprise deployments (Anthropic), so at that average Claude Pro's $20 matches about 1.5 active days and Max 20x's $200 about 15.4 days.
Past a plan's limits, both providers bill extra work per use: Claude usage credits at standard API rates, and ChatGPT credits at prices OpenAI sets by account, region and plan. Subscription or API: which is cheaper for coding agents? works through the break-even, and How to use Claude Code and Codex without a subscription covers API-key setup in both apps.
What can you do when you hit a limit?
Waiting costs nothing, and every other option trades money or setup for time. The options as of October 2026:
| Option | Claude Code | Codex |
|---|---|---|
| Wait for the reset | Continues the task after the reset in interactive sessions (v2.1.234 or later) | Shows the reset time in the usage dashboard and /status |
| Buy more usage | Usage credits at standard API rates, up to a monthly spend limit you set | ChatGPT credits, priced by plan or agreement (OpenAI) |
| Upgrade | Max 5x or Max 20x, $100 or $200 a month | ChatGPT Pro from $100 a month, with no five-hour limit |
| Use an API key | A Claude Console account, billed per token | codex login --with-api-key, at API rates, local sessions only |
| AutoRouter Pro | Keeps turns going from its monthly included usage until your plan resets | The same, for your ChatGPT plan |
How Claude Code usage limits work and Codex usage limits explained cover each option in detail.
How do you control costs across a team?
Start from a pilot group's real usage, then set budgets wherever each vendor allows them. Claude Team offers usage-credit spend limits at the organization, group or member level, and ChatGPT Business, Edu and Enterprise admins govern credit-funded Codex use with usage limits and spend controls. How to roll out AI coding tools to an engineering team covers budgets alongside sign-in, deployment and data retention. AutoRouter's Enterprise plan puts allowed models and team budgets in one place and reports spend by team, project or ticket.
How does AutoRouter cut costs on every turn?
AutoRouter, the Mac app for Codex and Claude Code, picks the model for each turn so you don't sort tasks by hand. Your own rules decide a turn first. Otherwise AutoRouter works out how hard the turn is, only considers models that clear the quality bar for it, sends hard work to the most capable model your ChatGPT or Claude plans cover, and sends everything else to the model that costs you least, which is often your plan or a low-cost open model. Unclear work is never treated as a quick task, and every turn shows its model, what it cost and why. How AutoRouter picks a model for each turn walks through the order, and How to write model routing rules in plain English shows how to steer it.
In the example week on AutoRouter's landing page, as of October 22, 2026, the Free plan does 1.9× the work of using a frontier model for everything, and AutoRouter Pro does 2.9×. That week is an illustration; your own mix of hard, medium and quick turns will differ.
Routing across your ChatGPT and Claude plans is free on AutoRouter's Free plan, at $0 a month. Pro costs $20 a month with $20 of included usage each month and adds every other model, billed at the provider's price plus 10%. New accounts get Pro free for their first month, or until $20 of usage is spent, whichever comes first. AutoRouter works with Codex (the app and the CLI) and the Claude Code CLI on macOS 14 or later, and it is in beta. AutoRouter wrote this guide; it earns the 10% on paid models and nothing on your plans.
Questions
What is the cheapest way to use Claude Code?
For occasional use, an API key on a Claude Console account usually costs least, because you pay only for the tokens you use. For daily use, a plan usually costs less: at Anthropic's enterprise average of about $13 per active day, Claude Pro's $20 matches about 1.5 active days at API prices. Either way, running routine turns on Sonnet 5.5 or Haiku 5.5 instead of Opus 5.5 makes the money go further.
Does switching models mid-session cost more?
It can in Claude Code, because each model keeps its own prompt cache and the first request after a /model switch re-reads the whole conversation with no cache hits. Run quick jobs in a subagent or a separate claude -p command, which leave the main session's cache alone.
Does lowering effort save as much as changing the model?
Usually not. Lowering effort cuts thinking tokens, but every token still bills at the same model's price: $4 per million input and $20 per million output tokens on Opus 5.5 as of October 22, 2026, against $0.10 and $0.50 on Haiku 5.5 for prompts up to 100,000 tokens (Anthropic). Lower /effort for simple tasks on the model you need, and pick a smaller model when the task doesn't need the large one.
Does AutoRouter cost anything on the plans I already have?
No. Routing across your ChatGPT and Claude plans is free on AutoRouter's Free plan, at $0 a month. You pay only for other models on Pro, at the provider's price plus 10%, from Pro's $20 of monthly included usage and then from credits you top up.
Sources
- Pricing, Claude Platform docs, Anthropic
- Plans and pricing, Anthropic
- Manage costs effectively, Claude Code docs, Anthropic
- Model configuration, Claude Code docs, Anthropic
- How Claude Code uses prompt caching, Claude Code docs, Anthropic
- Interactive mode, Claude Code docs, Anthropic
- Manage usage credits for paid Claude plans, Claude Help Center, Anthropic
- Introducing Claude Haiku 5.5, Anthropic, October 7, 2026
- API pricing, OpenAI
- Codex pricing and usage limits, OpenAI
- Codex usage dashboard, OpenAI
- Admin setup, Codex docs, OpenAI