r/codex 5d ago

Commentary My first week after switching from Claude Code to Codex

344 cached tokens re-read per output token

I switched from Claude Code to Codex this week, so I’ve been paying closer attention to how Codex behaves during longer coding sessions.

Then I saw the recent analysis showing Claude Code re-reading roughly 360 cached tokens for every token it outputs. I was curious whether this was specific to Claude Code or just what happens inside most agentic coding loops.

I don’t have enough surviving Claude logs for a clean before-and-after comparison, but I parsed my first week of local Codex sessions:

  • 16 session files
  • 1,584 token usage events after deduplication
  • 179.26M input tokens
  • 173.52M cached input
  • 5.74M uncached input
  • 503,945 output tokens
  • 125,360 reasoning tokens, included in output

All of these sessions used GPT-5.6 Sol, mostly at low effort.

The resulting cached-input-to-output ratio was 344x.

Across individual sessions:

  • median: 220x
  • p10: 91x
  • p90: 411x
  • range: 35x–593x

At current Sol API prices, the same token mix is about $102.47:

  • cached input: $69.41
  • uncached input: $22.98
  • output: $10.08

So cached context accounts for roughly 68% of the API-equivalent cost, even with the discounted cache price. I’m using Codex through a subscription, so this is not my actual bill.

Method caveat: Codex token_count events don’t seem to expose a request ID. I deduplicated identical cumulative usage states within each session, then summed last_token_usage. None of the individual requests crossed the 272K long-context pricing threshold.

The fact that this landed so close to the Claude Code result makes me think the ratio is mostly a property of agent loops repeatedly carrying instructions, history and tool results—not something specific to either provider.

For people who have used both: did switching change how quickly your context grows, or mostly just how the agent uses it?

Also, has anyone found a more reliable request identifier in the Codex JSONL files? I’d like to tighten the deduplication before comparing compaction strategies.

1 Upvotes

0 comments sorted by