You open Claude Code or Codex in the morning, do what feels like a normal amount of work, and by early afternoon you've hit your limit. The obvious fixes are a bigger plan or a different model. Before either, find out what actually used the allowance. Usually it isn't the prompts you typed.
In an earlier article I covered seven levers to cut a coding agent's token bill, mostly from the API side. This one is for subscription plans with usage windows: check what the tool already reports, look at the five usual burners, then set a simple model mix.
Claude Code details come from Anthropic's docs (costs, errors, status line, model configuration, subagents); Codex details from OpenAI's pricing FAQ, CLI commands and model selection pages.
Step 1: Find out which limit you hit
In Claude Code, the error message tells you which ceiling you hit, and they need different fixes:
-
You've hit your session limitorYou've hit your weekly limit. These windows are shared across all models, so switching with/modeldoesn't get you back in. You wait for the reset time in the message. -
You've hit your Opus limitorYou've hit your Sonnet limit. These apply to one model family. Switching to a model outside that family keeps you working, but each model has its own prompt cache, so the first request after the switch re-reads the whole conversation with no cache hits.
The errors page adds a detail worth knowing: usage counts against the session and weekly allowances at the same time, and one burst of heavy activity, such as a large workflow fanout, can use up the weekly allowance before the session window resets.
If you see a 429 instead, the docs suggest running /status: a stray ANTHROPIC_API_KEY in your environment can route requests through a low-tier API key instead of your subscription.
Step 2: Read the usage screens you already have
Claude Code. Run /usage. On a Pro, Max, Ultra, Team or Enterprise plan it shows a breakdown of what counts against your limits: usage attributed to skills, subagents, plugins and individual MCP servers, plus recommendations for anything behind 10% or more of recent usage. Three details matter when you read it:
- Press
dorwto switch between the last 24 hours and the last 7 days. - A row's percentage is how much of your usage it applies to, not how much the change saves, and rows can add up to more than 100%.
- The figures come from local session history on this machine. Usage from another laptop or from claude.ai isn't included.
On v2.1.305 or later, f applies the recommendations it can act on, showing you each change first.
Codex. In the CLI, /status shows the active model and token usage, and per the pricing FAQ your remaining limits during a session. /usage weekly (or daily, cumulative) opens your token activity, and the usage dashboard shows current limits and reset times.
To keep the numbers in view, Claude Code's status line receives JSON on stdin that includes rate_limits.five_hour and rate_limits.seven_day (subscribers only, after the first API response). A minimal script, saved as ~/.claude/statusline.py and set as the statusLine command in your settings:
#!/usr/bin/env python3 """Claude Code status line: model, effort, context, cache hits and plan limits.""" import json import sys data = json.load(sys.stdin) parts = [data["model"]["display_name"]] effort = (data.get("effort") or {}).get("level") if effort: parts[0] += f" ({effort})" ctx = (data.get("context_window") or {}).get("used_percentage") if ctx is not None: parts.append(f"ctx {ctx:.0f}%") hit = (data.get("prompt_cache") or {}).get("hit_ratio") if hit is not None: parts.append(f"cache {hit:.0%}") rate = data.get("rate_limits") or {} for key, label in (("five_hour", "5h"), ("seven_day", "7d")): used = (rate.get(key) or {}).get("used_percentage") if used is not None: parts.append(f"{label} {used:.0f}%") print(" | ".join(parts)) I ran it on the example input from the status line docs (the docs' sample values, not my usage), then on the same input without rate_limits and prompt_cache. Real output, Python 3.13.5:
$ python3 statusline.py < sample-input.json Opus (high) | ctx 8% | cache 91% | 5h 24% | 7d 41% $ python3 statusline.py < sample-input-api-user.json Opus (high) | ctx 8% Now you see the 5-hour number move while you work, not afterwards.
Step 3: Check the five usual burners
1. Model and speed choice. Anthropic's cost docs say Sonnet handles most coding tasks well and costs less than Opus, and that a switch to Opus also applies to subagents that inherit your session's model. On the Codex side, the pricing FAQ is explicit about speed: Fast mode uses included subscription usage at 2.5x the rate of Standard mode for the same model. If /fast is on out of habit, that's the first thing to check.
2. Always-loaded context. Instruction files and tool listings ride along with every request. OpenAI's tips for making Codex limits last longer include reducing the size of your AGENTS.md (by nesting files in the repo) and limiting MCP servers, because every MCP server adds context to your messages. I covered the trimming in Your Agent's Context Fills Up Before You Type.
3. MCP and tool output. Tool results are added to the conversation and re-sent with later requests. In Claude Code's /usage attribution, an MCP server's share counts only the requests that consumed one of its tool results, so a server with a high share is one whose output keeps landing in context. The docs' fixes: prefer CLI tools such as gh where they exist, and push verbose work such as test runs and log reading into a subagent or a hook that returns only the lines you need.
4. Parallel and background work. Every subagent, workflow agent and teammate sends its own requests, and all of it draws from the same windows. Some of it runs while you're not typing: a session-scoped scheduled task fires on its interval even when the session is idle, a message from another of your sessions arrives as a new turn, and goal check-ins start new turns while background work is pending. Each of these sends your full context. /usage has a Loops row for the heaviest scheduled tasks (v2.1.242+), and /tasks shows which model each subagent runs on.
5. Retries and rework. Claude Code already retries transient API failures by itself, up to 10 times with backoff. The retries that cost you are the ones you trigger: re-prompting the same failing approach, or letting the agent go a long way in the wrong direction before you notice. The docs' answers: plan mode before complex changes, Escape as soon as it drifts, /rewind to a checkpoint, and a verification target (a test, an expected output) so it checks its own work.
Step 4: A simple model-mix plan
Set defaults so the expensive model is a choice you make on purpose.
Claude Code:
- Default to Sonnet. Switch to Opus with
/modelfor architecture decisions or hard multi-step reasoning, then switch back. - Or use the
opusplanalias: Opus in plan mode, Sonnet for execution. - Put simple subagents on Haiku with
model: haikuin their definition. To force one model onto every subagent, teammate and workflow agent, setCLAUDE_CODE_SUBAGENT_MODELandCLAUDE_CODE_SUBAGENT_MODEL_FORCE=1(v2.1.257+). - Change models at task boundaries, ideally after
/clear, since a switch mid-conversation starts with a cold cache.
Codex:
- OpenAI's model selection guide calls Luna its most efficient model and Astra its most powerful, and says you can default to Astra if you don't need to think about usage or speed.
- To optimize usage it suggests Luna at low reasoning for fine-grained edits and well-scoped problems, and GPT-6.1 Sol at medium for complex technical work you expect to revise.
- Set both in one go with
/model [model] --reasoning=<level>, and confirm with/status. - Leave Fast mode for the moments when speed matters more than allowance.
Checklist
- Read the exact limit message: session/weekly (shared) or a single model family?
- Run
/status, then/usage(Claude Code) or/usage weeklyplus the dashboard (Codex), before changing anything. - Put the 5-hour and weekly percentages in your status line.
- Check the default model, effort level and whether Fast mode is on.
- Disable MCP servers you aren't using; keep instruction files short.
- Look for idle work: scheduled tasks, cross-session messages, goal check-ins.
- Count your parallel sessions and subagents, and check their models with
/tasks. - Stop drifting runs early and give every task a verification target.
- Switch models at task boundaries, not mid-conversation.
Where to go next
This covers the diagnosis for subscription limits. LLM Cost Control: The Builder's Guide to Cutting Your Token Bill is the full playbook for when you build on a metered LLM API: how token billing works, the seven cost levers in the order to apply them (measure, cache, scope, control output, route, batch, budgets), prompt caching done right, model routing, a worked end-to-end example, a 30-day plan, emergency cost triage and a pre-launch checklist.
This article was written with the assistance of AI and reviewed by the author. Claude Code behavior is described from Anthropic's official documentation (costs, errors, status line, model configuration and subagents pages), and Codex behavior from OpenAI's official pricing FAQ, CLI command reference and model selection pages, all fetched on 16 Nov 2026. The status line output is the script's real output on the sample input published in the status line docs, not on my own usage. PromptMaster guides are independent and not affiliated with or endorsed by Anthropic or OpenAI.

