# How to cut Claude Code and Codex costs

Authors: AutoRouter
Published: 2026-10-28T13:20:00.000Z
Reading time: 10 min
Canonical: https://autorouter.com/blog/cut-claude-code-and-codex-costs
Publisher: AutoRouter, the Mac app for Codex and Claude Code (https://autorouter.com)

> Claude Code and Codex costs come down to three things: which model runs each turn, how much context each request carries, and whether you pay through a plan, credits or an API key. Run routine turns on a smaller model, keep sessions short, and spend the plan you already pay for before paying per token. AutoRouter, the Mac app for Codex and Claude Code, makes the model choice on every turn and shows each turn's model, cost and reason.

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](https://platform.claude.com/docs/en/about-claude/pricing) per uncached token on prompts up to 100,000 tokens, and [GPT-6 Luna costs a hundredth of GPT-6 Astra](https://developers.openai.com/api/docs/pricing). 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](https://autorouter.com), 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](/blog/quick-tasks-on-cheaper-models) |
| Keep the context small      | How many tokens each request re-sends              | `/clear` between unrelated tasks                                                | [How Claude Code usage limits work](/blog/claude-code-usage-limits)                      |
| 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](/blog/claude-code-multi-agent)               |
| Plan before building        | Re-work after a wrong start                        | `Shift+Tab` into plan mode for complex tasks                                    | [How Claude Code plan mode works](/blog/claude-code-plan-mode)                           |
| 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?](/blog/subscription-vs-api-pricing)              |

## 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](https://code.claude.com/docs/en/model-config), so unless you change it, renames and one-line fixes run on Opus too. Anthropic's [cost guide](https://code.claude.com/docs/en/costs) 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](https://learn.chatgpt.com/docs/pricing)). [Codex usage limits explained](/blog/codex-usage-limits) lists the ranges for every plan, and [How Claude Code usage limits work](/blog/claude-code-usage-limits) 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](https://code.claude.com/docs/en/costs)). 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](https://chatgpt.com/codex/settings/usage) or `/status` in an active CLI session ([OpenAI](https://learn.chatgpt.com/docs/pricing#where-can-i-see-my-current-usage-limits)). 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](https://platform.claude.com/docs/en/about-claude/pricing) 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](/blog/which-model-for-which-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:

```bash
# 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](https://www.anthropic.com/news/claude-haiku-5-5)). That gap is why [Does model routing make your results worse?](/blog/does-model-routing-hurt-quality) 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](https://code.claude.com/docs/en/costs) lists these habits for Claude Code:

- Run `/clear` between unrelated tasks, and `/compact` with instructions about what to keep when you need to carry on.
- Run `/context` to see what fills the window, and `/mcp` to 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 `/effort` for 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](https://code.claude.com/docs/en/prompt-caching#switching-models), so after a `/model` switch the next request re-reads the whole conversation with no cache hits. A [subagent starts its own conversation](https://code.claude.com/docs/en/prompt-caching#subagents-and-the-cache) 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](https://code.claude.com/docs/en/costs) 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](/blog/claude-code-plan-mode) 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](/blog/claude-code-multi-agent) 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](https://claude.com/pricing) and [ChatGPT Plus](https://learn.chatgpt.com/docs/pricing) 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](https://code.claude.com/docs/en/costs)), 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?](/blog/subscription-vs-api-pricing) works through the break-even, and [How to use Claude Code and Codex without a subscription](/blog/no-subscription-coding-agents) 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](https://code.claude.com/docs/en/interactive-mode#wait-for-a-usage-limit-to-reset) in interactive sessions (v2.1.234 or later)     | Shows the reset time in the usage dashboard and `/status`                                                   |
| Buy more usage     | [Usage credits](https://support.claude.com/en/articles/12429409-manage-usage-credits-for-paid-claude-plans) at standard API rates, up to a monthly spend limit you set | ChatGPT credits, priced by plan or agreement ([OpenAI](https://learn.chatgpt.com/docs/pricing#token-rates)) |
| 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](/blog/claude-code-usage-limits) and [Codex usage limits explained](/blog/codex-usage-limits) 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](https://code.claude.com/docs/en/costs), and ChatGPT Business, Edu and Enterprise admins govern credit-funded Codex use with [usage limits and spend controls](https://learn.chatgpt.com/docs/enterprise/admin-setup). [How to roll out AI coding tools to an engineering team](/blog/ai-coding-tools-for-teams) 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](/blog/how-autorouter-picks-a-model) walks through the order, and [How to write model routing rules in plain English](/blog/plain-english-routing-rules) shows how to steer it.

In the [example week on AutoRouter's landing page](https://autorouter.com/#plans), 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](https://autorouter.com/#pricing) 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](https://platform.claude.com/docs/en/about-claude/pricing)). 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](https://platform.claude.com/docs/en/about-claude/pricing), Claude Platform docs, Anthropic
- [Plans and pricing](https://claude.com/pricing), Anthropic
- [Manage costs effectively](https://code.claude.com/docs/en/costs), Claude Code docs, Anthropic
- [Model configuration](https://code.claude.com/docs/en/model-config), Claude Code docs, Anthropic
- [How Claude Code uses prompt caching](https://code.claude.com/docs/en/prompt-caching), Claude Code docs, Anthropic
- [Interactive mode](https://code.claude.com/docs/en/interactive-mode#wait-for-a-usage-limit-to-reset), Claude Code docs, Anthropic
- [Manage usage credits for paid Claude plans](https://support.claude.com/en/articles/12429409-manage-usage-credits-for-paid-claude-plans), Claude Help Center, Anthropic
- [Introducing Claude Haiku 5.5](https://www.anthropic.com/news/claude-haiku-5-5), Anthropic, October 7, 2026
- [API pricing](https://developers.openai.com/api/docs/pricing), OpenAI
- [Codex pricing and usage limits](https://learn.chatgpt.com/docs/pricing), OpenAI
- [Codex usage dashboard](https://chatgpt.com/codex/settings/usage), OpenAI
- [Admin setup](https://learn.chatgpt.com/docs/enterprise/admin-setup), Codex docs, OpenAI

## Read next

- [How to use Claude Code and Codex without a subscription](https://autorouter.com/blog/no-subscription-coding-agents.md): Claude Code runs on a Claude Console account and Codex runs on an OpenAI API key, and both bill per token with no ChatGPT or Claude plan. AutoRouter, the Mac app for Codex and Claude Code, is a third option: AutoRouter Pro costs $20 a month with $20 of included usage and bills paid models at the provider's price plus 10%. On the same models, a direct API key costs less, so Pro comes out ahead only when cheaper models take enough of your turns.
- [Subscription or API: which is cheaper for coding agents?](https://autorouter.com/blog/subscription-vs-api-pricing.md): A Claude or ChatGPT plan costs less than paying per token once a month of your coding would cost more than the plan at API list prices, and the plan's limits still hold that work. As of October 22, 2026, Anthropic reports Claude Code averaging $150 to $250 per developer per month at API prices across enterprise deployments, against $20 for Claude Pro and $100 or $200 for Max. AutoRouter, the Mac app for Codex and Claude Code, uses the ChatGPT and Claude plans you already pay for first and bills other models at the provider's price plus 10%.
- [How to roll out AI coding tools to an engineering team](https://autorouter.com/blog/ai-coding-tools-for-teams.md): Rolling out Claude Code, Codex or GitHub Copilot to an engineering team comes down to six decisions: sign-in, deployment, model access, budgets, reporting and data retention. Each vendor's admin controls cover only its own tool, and Claude Code and Codex both read policy from a macOS MDM profile. For teams on Codex and Claude Code, AutoRouter, the Mac app for Codex and Claude Code, has an Enterprise plan that puts allowed models, team budgets and zero data retention in one place, reports spend by team, project or ticket, and rolls out through Jamf or another MDM.

Tags: [Costs](https://autorouter.com/blog/tags/costs.md), [Claude Code](https://autorouter.com/blog/tags/claude-code.md), [Codex](https://autorouter.com/blog/tags/codex.md)

Drafted with AI from the sources linked above, then checked and edited by the AutoRouter team.
