How do you save tokens in Claude Code and Codex?
Three things use the most tokens: a session that has been open for hours, subagents, and the fixed content sent with every turn (CLAUDE.md or AGENTS.md, MCP servers, skill descriptions). Start with three steps: clear the chat when you switch tasks, keep reasoning effort at medium (the Codex default; /effort medium in Claude Code), and give simple subagents a smaller model. Tokens are what the 5-hour and weekly limits are measured in.
Codex
Start a new chat for each task, use medium reasoning day to day, give routine work to a smaller model, and turn off MCP servers you are not using.
Codex usage follows context size, model, reasoning effort and tool calls, so saving tokens means trimming each of the four. Use /new (or /clear) when you switch tasks and /compact when one task has grown long; /status shows token usage and how much context is left. Pick the model and reasoning effort in /model: medium for daily work, higher only for hard problems, and GPT-5.6 Terra or Luna for routine tasks, which OpenAI says can make your limits last longer. Fast mode uses the allowance faster, so turn it off with /fast when you are running low. Keep AGENTS.md short and disable unused MCP servers: both are sent with every message.
What the official docs say
Different models can use different amounts of your allowance for the same task. Larger inputs and outputs, higher reasoning settings, Fast mode and tasks with multiple steps can also increase usage.Higher effort can use more of your allowance and does not always produce a better result.Limit the number of MCP servers you use. Every MCP server adds more context to your messages and uses more of your limit. Disable MCP servers when you don't need them.Switch to a smaller model for routine tasks. Using GPT-5.6 Terra or GPT-5.6 Luna can extend your local-message usage limits, depending on the model you switch from.Reduce the size of your AGENTS.md. If you work on a larger project, you can control how much context you inject through AGENTS.md files by nesting them within your repository.Claude
Open /usage first and see what it names. Long session: /clear. Subagents: a smaller model. Fixed content: trim it.
On a subscription, /usage in Claude Code attributes recent usage to skills, subagents, plugins and individual MCP servers, and flags any behavior that accounts for 10% or more of it, each with a tip; press d or w to switch between 24 hours and 7 days. Two of its tips, quoted from the /usage panel: "Longer sessions are more expensive even when cached. /compact mid-task, /clear when switching to new tasks." and "Each subagent runs its own requests. Be deliberate about spawning them — and consider configuring a cheaper model for simpler subagents." So: /clear between tasks and /compact only mid-task; use Sonnet for daily work and /effort medium (the default is high), and move to a larger model or higher effort only for hard problems; write model: haiku in simple subagents; run /context to see what the fixed content takes, and keep CLAUDE.md under 200 lines. The panel estimates from session history on this machine, so other devices and claude.ai are not included.
What the official docs say
On a Pro, Max, Team, or Enterprise plan, /usage also shows a breakdown of what counts against your plan limits: Attribution: recent usage attributed to skills, subagents, plugins, and individual MCP servers, each shown as a percentage of the total.Use /clear to start fresh when switching to unrelated work. Stale context wastes tokens on every subsequent message.Sonnet handles most coding tasks well and costs less than Opus. Reserve Opus for complex architectural decisions or multi-step reasoning.Common misconceptions
- Install a token-saving skill or tool and usage drops by more than half
It does not. These tools advertise 60% to 90%. In paired tests by JetBrains, measured on the bill, rtk cost 7.6% more per task at low reasoning effort and made no difference at high effort, and caveman saved about 8.5% against an advertised 65%. Check /usage and /context to see where your tokens go before you install anything.
- If my tokens drain fast, I must be doing something wrong
Not always. Sometimes the platform is at fault, and nothing you change will help. In its 2026-04-23 postmortem, Anthropic traced reports of usage limits draining faster than expected to a caching bug in Claude Code, and reset usage limits for all subscribers. Check the reset log on this site for a recent announcement, then look at your own habits.
- Prompts in English use fewer tokens
No official source says so. Both vendors list context size, model, reasoning effort and tool calls as what drives usage; prompt language is not on either list. Long sessions and subagents are the large items, so cut those first.
Do these first
- Clear the chat when you switch tasks: /clear in Claude Code, /new in Codex. If the old conversation stays, every later message pays for it again.
- Keep reasoning effort at medium. It is the Codex default; Claude Code defaults to high, so type /effort medium. Raise it only for hard problems: a higher level is slower, uses more, and does not always give a better result.
- Give simple subagents a smaller model: model: haiku at the top of the subagent file in Claude Code, default_subagent_model under [agents] in the Codex config.toml.
- Use /compact only when one task is half done and the context has grown too large. It is a large request in itself, not routine cleanup.
- Run /context in Claude Code or /status in Codex to see what is filling the context.
- Keep CLAUDE.md under 200 lines and AGENTS.md just as short. Move task-specific procedures into skills, which load only when used.
- Disable MCP servers and uninstall plugins you do not use. They take up room on every turn.
- Write specific prompts that name the file and the function, such as "fix the login function in auth.ts". "Improve this code" makes the agent read widely.
- Still not enough? Check how long it is until your next reset before you decide whether to wait.