# How to cut Claude Code and Codex costs

> Use Auto, the Mac app for all your coding agents: it makes the model choice on every turn, uses the AI subscriptions you already pay for first, and shows each turn's model, cost and reason. 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. By hand, run routine turns on a smaller model, keep sessions short, and spend the plan you already pay for before paying per token.

Author: Tyler J. Cagle (https://x.com/tjcages)
Published: 2026-10-28T13:20:00.000Z
Updated: 2026-11-16T22:10:00.000Z
Reading time: 12 min
Canonical: https://auto.sh/blog/cut-claude-code-and-codex-costs
Publisher: Auto (https://auto.sh)

## Key facts

- Claude Code and Codex costs come down to three levers: the model that runs each turn, the context each request carries, and whether you pay through a plan, credits or an API key.
- 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.
- Claude Code's `default` model on Pro and Max is Opus 5.5, so renames and one-line fixes run on Opus unless you change it ([Anthropic](https://code.claude.com/docs/en/model-config)).
- In Auto's measured Claude Code runs on October 28, 2026, writing the prompt cache was 63% of the cost on Opus 5.5, so a fresh Opus session for every small job pays that setup each time ([data](/blog/claude-code-task-costs-measured)).

![The model each request runs on matters most. Lever, biggest first: 1. Match the model to the task, /model sonnet, The price of every token; 2. Keep the context small, /clear, Tokens each request re-sends; 3. See where usage goes, /usage, What uses the plan; 4. Give agents smaller models, model: haiku, What subagents cost; 5. Plan before building, Shift+Tab, Re-work after a wrong start; 6. Pay the cheaper way, Plan, credits or per token. Source: Anthropic and OpenAI docs, as of October 2026.](https://auto.sh/blog/images/cut-claude-code-and-codex-costs/1-levers.png)

To cut Claude Code and Codex costs, use [Auto](https://autorouter.com/), the Mac app for all your coding agents: it [makes the model choice on every turn](https://autorouter.com/individuals#product) and uses the AI subscriptions you already pay for first. 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.

## 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](/blog/check-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, which [Claude 5-hour limit vs weekly limit](/blog/claude-5-hour-limit-vs-weekly-limit) compares side by side. [When do Claude Code, Codex and Cursor usage limits reset?](/blog/ai-coding-usage-limits) lists every coding agent's limits and reset times in one place.

## 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](/blog/check-claude-code-usage) adds the status line that keeps usage on screen while you work, and [how to see which model handled each turn, and what it cost](/blog/see-what-each-turn-costs) breaks a session down turn by turn. To keep every limit in your menu bar, [CodexBar alternatives](/blog/codexbar-alternatives) compares the trackers.

## 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. Measured in fresh Claude Code sessions on October 28, 2026, a commit message came to $0.082 at list prices on Opus 5.5 and $0.0024 on Haiku 5.5; [What common Claude Code tasks cost, measured on each model](/blog/claude-code-task-costs-measured) has five everyday tasks on three models.

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, and ChatGPT Pro costs $100, $200 or $500. Claude Max costs $100 a month, and [Claude Ultra](https://support.claude.com/en/articles/17728952), which replaced Max 20x at the end of October, costs $200. To choose between Claude's own plans, see [Claude Pro vs Max: which plan to pick for Claude Code](/blog/claude-pro-vs-max) and [What the Claude Max plan includes, and who it's for](/blog/claude-max-plan). 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 Claude Ultra's $200 about 15.4 days.

![At $13 a day, Pro covers 1.5 days. Claude Pro, $20, 1.5 days; Claude Ultra, $200, 15.4 days. Source: Anthropic's enterprise average of about $13 per developer per active day at API prices, October 22, 2026.](https://auto.sh/blog/images/cut-claude-code-and-codex-costs/2-plan-days.png)

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. For what each agent costs on its own plans and per task, see [Claude Code pricing: every subscription, its cost and limits](/blog/claude-code-pricing) and [Codex pricing: all Codex plans, prices and usage limits](/blog/codex-pricing). For what a plan holds on each model, from Claude Opus 5.5 to GPT-6 Sol, see [How much is a Claude or ChatGPT plan worth per model?](/blog/claude-max-tokens-per-model).

## 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 or Ultra, $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                                             |
| Auto 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, and [Cursor usage limits by plan](/blog/cursor-usage-limits) does the same for Cursor. [What is the Claude session limit?](/blog/claude-session-limit) covers what happens when the five-hour window runs out. An `API Error: Repeated 529 Overloaded errors` message isn't a limit at all: [Claude 529 overloaded error: what it means and what to do](/blog/claude-529-overloaded-error) covers what it means and how to keep working. With more than one Claude account, [How to use multiple Claude accounts in Claude Code](/blog/claude-code-multiple-accounts) covers switching between them or pooling them.

## 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. Auto's [Enterprise plan](/enterprise) puts allowed models and team budgets in one place and reports spend by team, project or ticket.

## How does Auto cut costs on every turn?

AutoRouter 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 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 Auto's landing page](https://autorouter.com/individuals#plans), as of November 6, 2026, the Free plan does 1.8× the work of using a frontier model for everything, and Auto Pro does 2.6×. That week is an illustration; your own mix of hard, medium and quick turns will differ, and the [savings calculator](/calculator) prices a month of it at API list prices, on one frontier model and with Auto.

Routing across the AI subscriptions you already pay for is free on Auto's Free plan, at $0 a month. [Pro](https://autorouter.com/pricing) includes usage each month and adds every other model, billed at the provider's price plus 10%. New accounts get a week of Pro, or until its included usage is spent, whichever comes first. Auto works with all your coding agents (Claude Code, Codex, Cursor, etc.) on macOS 14 or later, and it is in beta. Auto 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. [Is Claude Code free?](/blog/is-claude-code-free) covers every route in, from a plan you already pay for to API credits.

### 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. Effort also changes how savings figures read: [Which effort level is a fair baseline for router savings?](/blog/router-savings-effort-baseline) shows how a max-effort baseline inflates them.

### Does Auto cost anything on the plans I already have?

No. Routing across the plans you already have is free on [Auto's Free plan](/pricing), 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 much is a Claude or ChatGPT plan worth per model?](https://auto.sh/blog/claude-max-tokens-per-model.md): Auto, the Mac app for all your coding agents, publishes what a Claude or ChatGPT plan is worth on each model as free, open data: a Claude plan holds about 57 times its fee in Claude Opus 5.5 at API prices, 59 times in Sonnet 5.5 and 11 times in Fable 5.2, while a ChatGPT plan holds about 13 times its fee in GPT-6 Sol. That puts Claude Max ($100 a month) at about $5,700 of Opus 5.5, roughly 12 billion tokens at a typical coding-agent mix. Auto connects your plans to all your coding agents, so your Claude plan runs inside Codex and your ChatGPT plan inside Claude Code.
- [How to use Claude Code and Codex without a subscription](https://auto.sh/blog/no-subscription-coding-agents.md): Use Auto Pro: Auto, the Mac app for all your coding agents, gives you every model with no AI subscription, with usage included each month, and bills paid models at the provider's price plus 10%. Natively, Claude Code runs on a Claude Console account and Codex on an OpenAI API key, both billed per token. On the same models, a direct API key costs less, so Pro comes out ahead only when cheaper models take enough of your turns.
- [Claude API vs subscription: which is cheaper for coding?](https://auto.sh/blog/subscription-vs-api-pricing.md): A Claude subscription is cheaper than the Claude API once a month of your Claude Code work would cost more than the plan at API list prices. As of November 16, 2026, Pro costs $20 a month, Max $100 and Ultra $200, against Anthropic's reported Claude Code average of about $13 per developer per active day at API prices. The API bills each successful request against prepaid credits you buy in the Claude Console, within the rate limits and monthly spend cap of your usage tier.

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

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

Auto is a Mac app for AI model routing in Codex, Claude Code, Cursor and other supported coding agents. It uses eligible connected subscriptions first. See [setup](https://auto.sh/setup.md) and [pricing](https://auto.sh/pricing).
