Claude Code + Codex token juggling: two CLIs, one plan-shape, two clocks.
Both agents now wear the same plan caps: a rolling 5-hour bucket and a weekly bucket. The reset clocks are independent. That is the entire mechanic the juggle exploits. The only thing in the way is that each vendor only shows you its own gauge.
Direct answer (verified 2026-05-10)
Run both Claude Code and Codex. Watch each CLI’s plan gauge: Codex prints its 5-hour and weekly bars inside /status (pricing page); Claude exposes the same fractions on claude.ai/settings/usage, and ClaudeMeter puts those same fractions in your macOS menu bar. The juggle rule is one line: when the current agent’s 5-hour bucket crosses 0.95, finish the in-flight turn, paste the same prompt into the other agent, and keep going. The two reset clocks are independent, so the standby agent almost always has bucket headroom.
Why people search for “token juggling”
The classic version of this complaint shows up on X every Sunday evening: someone is mid-refactor on Claude Code Opus, the agent touched twelve files, and a 429 fires with a generic rate_limit_error: limit reached on this plan string. The CLI does not name the bucket. The settings page in the other tab says the rolling 5-hour window resets in three hours. Three hours is too long. So you open Codex in another terminal, paste in the same prompt, and keep going. That is the juggle.
What is new in 2026 is that both vendors now run the same plan architecture. Anthropic Pro/Max has been on rolling 5-hour + weekly buckets for most of the year. OpenAI’s April 2 pricing update moved Codex onto the same 5-hour-shared-between-local-and-cloud-tasks model with weekly limits on top. Two coding agents, same plan-shape, two independent reset schedules. The juggle is the obvious workflow consequence of that.
The two plan-shapes, side by side
Isomorphic. The only meaningful difference is where you read the gauge.
| Feature | Codex CLI (ChatGPT Plus/Pro) | Claude Code (Anthropic Pro/Max) |
|---|---|---|
| 5-hour rolling bucket | Codex CLI: 5h limit, shared between local messages and cloud tasks | Claude Code: five_hour bucket on /api/oauth/usage, same shape |
| Weekly bucket | Codex CLI: Weekly limit, separate from 5h | Claude Code: seven_day (plus per-model splits like seven_day_opus, seven_day_oauth_apps) |
| Gauge inside the active CLI | Codex: /status prints percent left and resets_at | Claude Code: /usage prints a one-shot snapshot; not surfaced during an active loop |
| Gauge outside the CLI | Codex: usage dashboard at chatgpt.com/codex/pricing | Claude: claude.ai/settings/usage (web page, manual refresh) |
| Glanceable signal for the juggle decision | Codex: nothing menu-bar; you alt-tab to chat or run /status mid-session | Claude: ClaudeMeter puts five_hour and seven_day in the menu bar, polled every 60s |
| What 'walled' looks like | Codex: usage limit reached message, exact bucket named | Claude Code: 429 rate_limit_error with a generic 'limit reached' string, bucket NOT named |
What the two gauges actually look like
Here is the standby agent (Codex) with a fresh-ish bucket. Run /status inside the active session per the openai/codex repo’s issue #19555 conventions:
And here is the active agent (Claude Code), printed by claude-meter straight from /api/oauth/usage. Note that five_hour is at 94% and the Codex side is at 67% remaining. That is the moment to juggle.
The fields are stable. The Rust schema in claude-meter/src/models.rs lines 18-28 declares five_hour, seven_day, seven_day_opus, seven_day_oauth_apps as the public contract, so anything you build on top of claude-meter --json will not silently move.
Reactive juggle vs proactive juggle
Most people start with the reactive version because it is what naturally happens the first time. The proactive version takes one piece of plumbing and a habit. The cost difference between the two is the difference between “most of an afternoon” and “all of an afternoon”.
You are deep in a Claude Code refactor. The 429 fires. Mid-tool-call. Partial diff applied, half a migration written, Claude was about to run cargo check. You see 'limit reached', stop, copy the last few user prompts into a note, open a new terminal, start codex, paste them back, ask Codex to also catch up on what was happening. Five to ten minutes lost every cycle. Repeat three times a day and you have lost half an hour to handoff overhead alone.
- Mid-tool-call 429 leaves Claude Code holding partial state
- You only learn what bucket fired by alt-tabbing to claude.ai/settings/usage
- Context handoff to Codex is manual and lossy
- Both sides are unaware of each other, so you re-explain what you were doing
The handoff itself, two aliases and one optional helper
The juggle does not need a clever script. It needs two short aliases so the switch is a single keystroke difference, and an optional one-liner that reads claude-meter --json if you want a shell hint without looking at the menu bar.
The Codex half is unchanged from default: you run codex and ask /status inside the session to read its gauge. (Issue #18742 notes a known quirk where the first /status after launch can show stale numbers; run it twice to get a current read.) The Claude half is where the plumbing matters: without ClaudeMeter you have no live signal, so your 95% trigger turns into “check claude.ai in the other tab every few minutes”, which nobody actually does and that is why the wall hits in the first place.
What this is not
It is not a unified dashboard. ClaudeMeter reads the Anthropic side only; it does not touch your OpenAI account, does not poll Codex, does not even know Codex exists. The Codex gauge stays inside the Codex CLI where /status puts it. You are still the orchestrator. The thing the menu bar adds is the one piece of state that was previously only on a web page, so the handoff decision becomes a glance instead of a context switch.
It is also not a way to dodge weekly walls indefinitely. If both your weekly buckets are spent, you are out for the rest of the cycle on both vendors, and the only fixes are (a) Anthropic’s metered extra-usage (visible as extra_usage on the same JSON; ClaudeMeter renders it as a third row when it is enabled), (b) the OpenAI API at metered token rates, or (c) actually waiting for the rolling weekly window to roll. The juggle handles 5-hour walls and most weekly walls if you only hit one vendor’s weekly cap before the other.
And it is not, finally, a token counter. If you want to know how many input/output tokens Claude Code sent today, ccusage reads ~/.claude/projects/<project>/<session>.jsonl and prices it for you. That is local-truth, dollars and tokens. ClaudeMeter is plan-truth: the utilization fraction Anthropic actually enforces. They are different numbers, both useful, neither replaces the other.
Want help wiring this into your daily flow?
Book 20 minutes and we will set up ClaudeMeter against your real claude.ai session, walk through the 95% rule on your machine, and confirm the Codex handoff works on your shell.
Frequently asked
Frequently asked questions
What does 'token juggling' between Claude Code and Codex actually mean?
It is the workflow where you run both CLIs on the same machine, default to one, and switch the active session to the other the moment the first agent's plan bucket is about to wall. The 'tokens' you are juggling are not raw model tokens, they are plan-quota utilization fractions: how much of your 5-hour bucket on each side is spent. The point is to keep one continuous flow of work moving without paying metered API rates and without waiting hours for a single vendor's window to roll.
Why does the juggle work? Are these not the same model anyway?
The juggle works because both vendors ship the same plan shape: a rolling 5-hour bucket plus a weekly bucket, gated server-side, charged against your subscription. Anthropic Pro/Max enforces this through /api/oauth/usage and /api/organizations/{uuid}/usage. OpenAI Codex enforces it through its own usage dashboard and surfaces it inside the CLI as /status. The two clocks are independent. Your Claude five_hour window resets on Anthropic's schedule, your Codex 5h limit resets on OpenAI's schedule, and the two virtually never coincide. While one is at 98% the other is almost always at 30% or less.
What does Codex's /status output look like, and what does claude-meter show?
Per openai/codex issue 18742, Codex /status prints something like '5h limit: [████████████████░░] 82% left (resets 15:18)' and 'Weekly limit: [████████░░░░░░░░░░░░░░] 36% left (resets 03:08)'. ClaudeMeter prints the Anthropic-side equivalent in your macOS menu bar: a 5-hour row and a weekly row with utilization percent and resets_at timestamp for each. Same gauge, same units, different vendor. Both are 'percent of bucket spent, time until reset'.
Why not just run both agents at once and let them race?
Because in practice each agent edits the same files in the same repo, so two parallel sessions trample each other's diffs and you spend more time merging than coding. The juggle is sequential, not parallel. One agent is the active driver, the other is on standby with a fresh 5-hour bucket. The switch is a context handoff, not a fork. The interesting question is when to do the handoff, and the answer is 'before the wall, not after'.
What is the 95% rule and why that number?
Flip to the other agent when the current one's five_hour bucket crosses 0.95 utilization. The reason it is 95 and not 100: a 429 mid-tool-call usually leaves the active CLI holding partial output and a pending edit, which costs you a few minutes of context rebuild every time you re-enter the session. Flipping at 95% gives you 5% of headroom to finish the current turn cleanly, save state, and hand off without losing context. The 5% number is rough; if your turns are huge (large refactors), drop to 85%. If your turns are small (Q&A, single-file edits), 97% is fine.
Why can ccusage not drive this?
ccusage reads ~/.claude/projects/<project>/<session>.jsonl and prices the tokens against a model card. That is local-truth: tokens that left your machine, dollars per million. The plan caps you actually care about for juggling live on Anthropic's servers as utilization fractions on /api/oauth/usage, and on OpenAI's servers as the percentages Codex /status pulls down. ccusage cannot see either of those numbers. ClaudeMeter reads the Anthropic one. Codex /status reads the OpenAI one. The two complement each other; ccusage is a third lens (tokens) that does not help with the juggle decision.
What about the weekly bucket? Does the juggle save me if I hit it?
The 5-hour juggle, yes. The weekly juggle, partially. If your Claude seven_day_oauth_apps fires on a Wednesday, the rolling weekly window will not save you for days. But if your Codex weekly is still at 30%, you have most of a week of headroom on the other side. The juggle becomes 'switch fully to Codex for the rest of this Anthropic week, then back when it rolls'. ClaudeMeter shows seven_day, seven_day_sonnet, seven_day_opus, seven_day_oauth_apps individually (see src/models.rs lines 18-28 of the open-source repo) so you can see exactly which weekly bucket fired before you commit to a full-week switch.
Does the juggle change how Anthropic or OpenAI bills me?
No. Each session bills against the plan whose CLI you are running. Time spent in Claude Code charges against your Anthropic plan; time in Codex charges against your ChatGPT plan. You are not paying API rates anywhere as long as you stay inside the two plan envelopes. The juggle is two subscription plans cooperating, not metered billing kicking in. The economics work because $20 ChatGPT Plus + $20 Claude Pro = $40 covers more agentic-loop time than $200 spent on one vendor's top tier once you hit weekly caps, for many workloads.
What is the one piece of plumbing I actually need to make this work?
Visibility on the Anthropic side, outside of claude.ai. Codex already prints its gauge in /status inside the CLI session. Claude does not have an equivalent during an active agent loop; the only place to see your real utilization is claude.ai/settings/usage in a browser tab, which you have to remember to refresh. ClaudeMeter pulls the same JSON that page renders and puts it in your menu bar so the gauge is always glanceable. Without it, the juggle is reactive (you wait for the 429, lose the in-flight turn, then switch). With it, the juggle is proactive (you see 94% on the bar, finish your current message, type the same prompt into the other CLI).
Is ClaudeMeter free, and what does it touch on my machine?
Free, MIT licensed, source at github.com/m13v/claude-meter. The browser extension makes one HTTPS request per minute to claude.ai using the cookies your browser already holds, then POSTs the JSON snapshot to a localhost bridge at 127.0.0.1:63762 that the menu bar app listens on. No telemetry, no cloud account, no analytics. It does not touch Codex or your OpenAI account at all; Codex's gauge stays inside its own CLI. The juggle is a workflow, not a unified dashboard.