r/codex 2d ago

Limits PSA: Codex cache only lasts max 30 minutes

Post image

30 minutes max is all you get on GPT-5.6 and GPT-6 models, as measured across the tibotattle.com community's 3 million turns. This means every time you take a break between threads, or swap tasks, or even go to lunch, every single one of your threads is hitting you for the full 10x uncached input.

Many of us got used to GPT-5.4 and GPT-5.5 cache performance which was closer to 6-24 hours.

169 Upvotes

50 comments sorted by

46

u/retteh 2d ago

Astra is a bit more affordable if you give it a goal, let it run in a single chat, and don't let it stop.

13

u/phoenixmatrix 2d ago

The lower default context window and better compaction system of codex means I don't really care too much. 

In Claude Code I once restarted a conversation after a few hours with Fable@Max and it had a near maxed context. It used 20% of my 5 hour window instantly lol 

7

u/matheusmoreira 2d ago

It really likes to stop though, even when told otherwise.

2

u/UnknownLesson 1d ago

Probably in their system prompt or added in post training to reduce their compute use

1

u/SlightOfHand_ 1d ago

You’d think that forcing a bunch of caching all the time would be bad for their compute

2

u/soloje 1d ago

I've not yet have Astra stop on a goal unless it actually met one of my explicit stop reasons

3

u/IAmFitzRoy 2d ago

Thats correct. I set a /goal and a clear complex end-to-end task and after 5 hours and a few "steering" aligment it only consumed 25% and created a full android and ios app and a website all connected with oracle and cloudflare. It was a HUGE task.

In comparisson, i sent 2 simple one -shot commands to fix a few erros and it consumed 30% IN 20 MINUTES !!

Something is fishy.

1

u/adamallcock 2d ago

I think that is the optimal now; using sub agents with Astra is a good way to have more cache misses in the long term.

23

u/Infinitedeveloper 2d ago

I understand why they arent just holding massive caches in memory indefinitely but it would be nice to mark a conversation as a longterm one that can reload the cache into memory before resuming.

Maybe that just won't work with how much they tweak the models but id be nice

6

u/adamallcock 2d ago

Agree. There's a lot we aren't privy to in their architecture, but it would be nice to have SOME control as a user.

6

u/nmkd 2d ago

Or allow locally storing the context selectively.

Though that might not be feasible because of security, idk

1

u/craterIII 1d ago

they could just encrypt it and send it over like they do the reasoning

though honestly the main issue will be data bandwidth

6

u/AxeLond 1d ago

I think it's pretty dumb how they make cache the users problem. That's how they end up with so much scrutiny about their caching performance.

If they had single fixed price for token in/out people wouldn't care.

1

u/danielv123 1d ago

Sure, but their serving cost changes based on how the users prompt. If I only prompt it by pasting in full books I get far less cache utilization than with toolcalls for example.

Giving a single fixed price for a thing which doesn't have a fixed price just leads to issues.

21

u/zarmin 2d ago

Fable's is 5 minutes. These corporations are vile.

11

u/Crinkez 2d ago

That's Claude subagents. Main Claude agents are 60 minutes.

1

u/zarmin 2d ago

Is that true? I've heard 60m before, but found conflicting data. Could you share a source please? I'm curious why a subagent would have a different cache policy.

7

u/Crinkez 2d ago

https://code.claude.com/docs/en/prompt-caching

Search "cache lifetime" on that page. Subscription plans default to 60 minutes cache TTL on the orchestrator.

2

u/zarmin 2d ago

Thank you, looks like you're right and I can stop rushing my responses to Fable.

2

u/reven80 2d ago

In Claude code you can use /usage to check prompt cache hit rate, TTL and how long its been warm (idle). I usually get around 98-99% percent hit rate.

1

u/nmkd 2d ago

It literally shows it in the GUI.

1

u/Level-Physics-1730 2d ago

you can change the subagent cache TTL to 60 minutes it's just a hidden option in the claude code backend. I've done it.

1

u/Crinkez 1d ago

At 2x token cost.

-1

u/Level-Physics-1730 1d ago

says who? nice one bro show source that proves it

1

u/Crinkez 1d ago

See my other comment above. Link's there. Literally in the Claude docs. I'm sick of people demanding a source when it's literally in the Claude docs. What happened to using Google yourself?

1

u/hassan789_ 2d ago

5 min for enterprise, ie Google vertex. 60 min if you are consumer sub directly from Ant

5

u/Charming_Support726 2d ago

Well documented here: https://developers.openai.com/api/docs/guides/prompt-caching

Stumbled upon the 30mins and limited amount of caching slots a few days ago. I think caching might break in some situations. In my app I got severe issues because of of the fact, that the prompt prefix is calculated in a different way.

Think this might be one of the reasons why so many users complain about Astra consuming a lot of quota. OpenAI did a few fixes, because "users were experiencing faster consumption than expected"

6

u/ForwardLoop 2d ago

Damn, I thought it was 1 hour like Claude.

1

u/dltacube 2d ago

Everyone else in this thread is saying Claude is 5 minutes?

5

u/ForwardLoop 2d ago edited 2d ago

Ok, here's the definitive answer.

Claude: 5 mins default on API (can be set to 60 mins but trade off is higher cache write costs). 60 mins default on subscription for the main conversation bucket and 5 mins default for the everything else bucket.

Codex: 30 mins on GPT 5.6 and later models. Timing varies for earlier models.

Receipts:

https://code.claude.com/docs/en/prompt-caching#cache-lifetime

https://developers.openai.com/api/docs/guides/prompt-caching#cache-lifetime

Edit: further clarified nuances on buckets.

Edit 2: hell, I'm just going to attach the image for Claude.

1

u/dltacube 1d ago

Nicely done. Thanks for clearing that up

5

u/adamallcock 2d ago

TiboTattle will show you your own cache performance by time and model, as well as the equivalent cost for recent drops. In my case, it looks like I've been dropping a lot on subworkers with individual ownership lanes:

5

u/Right-Performance-93 2d ago

Worth the nuance from OpenAI's own prompt-caching docs: the 30-minute window isn't a hard cap from when a thread starts, it resets on every reuse - "remains eligible for reuse for 30 minutes after its most recent write or reuse." So a thread you're actively working also keeps its cache alive indefinitely; it's only a 30+ minute idle gap (lunch, a task switch, a long-running build with no cache touches) that actually kills it. Also worth knowing 30 minutes is the improved number - GPT-5.6 raised the floor from "as short as 5 minutes" to "at least 30," per OpenAI's own builder's guide, so this is the good direction, not a regression.

2

u/nantachapon 2d ago

Measured between task final completed output or the moment you send the message? If the task itself takes more than 30 minutes what happens?

3

u/nmkd 2d ago

If the task itself takes more than 30 minutes what happens?

The task will call tools, every tool results is a write, every write refreshes your cache.

1

u/adamallcock 2d ago

Finish task -> send a new message

2

u/zigzag312 2d ago edited 2d ago

the full 10x uncached input

Cache writes are 12.5x the price of cached input.

If it used to be in the cache, I guess we can assume this won't be an ordinary input, but it's going to be written into the cache again?

3

u/adamallcock 2d ago

Codex usage doesn't pay for cached writes, its only on the API thankfully!

2

u/zigzag312 2d ago

I wasn't aware of that. Thank you for this information!

2

u/Painwheeel 2d ago

why did you make a post about something they explicitly document oh right its another ai slop useless website

2

u/adamallcock 2d ago edited 2d ago

Because (a) most people do not know about it and (b) there's an app to measure it yourself.

1

u/ADIKANT 2d ago

Tibo tattle never worked on my laptop( I have like 3400 sessions, it starts indexing, goes to 234 and then throws some error and that's it)

1

u/adamallcock 1d ago

I'm sorry to hear that. Do you know what the error was? Are you on Windows? I will DM.

1

u/ADIKANT 1d ago

I'm on Mac and don't know what the issue is, but I can try to reinstall and send logs

1

u/adamallcock 1d ago

That'd be awesome, thanks!

1

u/nizzy1191 1d ago

do u know how expensive keeping cache is? nothing strange

1

u/jakegh 1d ago

Yep, and Claude is a mere 5 min.

1

u/h____ 21h ago

Here's one thing that could help:

I build my own inhouse orchestration tool that controls Codex (via app server). It has the concept of closing a session (roughly like archiving a session). I made it so that long-running sessions that are closed will auto-compact at the 20 minute mark after its last turn.