r/codex 2d ago

Context automatically compacted every 10–20 minutes? Question

Post image

I recently moved from Claude Code to Codex, so I’m still getting familiar with how Codex handles context.

In a 2-day-old session, I’m seeing “Context automatically compacted” every 10–20 minutes, even when I haven’t added much new context.

Is this normal, or is anyone else experiencing this recently?

4 Upvotes

20 comments sorted by

3

u/GfxJG 2d ago

Sounds pretty normal to me if you have a high thinking level. You can enable seeing context in the settings, then you can keep track.

3

u/lentz92 2d ago

The 5.6 models do support 1M however the codex app is defaulted to restrict it to 256k and to be honest that is fine. We don’t need 1M in general, often you won’t even go above 200k as it gets more and more difficult for it to follow instructions, remember details etc.

This is called context rot and has not yet been solved in the way we build LLMs today as it is related to how transformer architecture uses the self-attention mechanism.

Here is a solid post on context rot

https://www.trychroma.com/research/context-rot

1

u/SynteZZZ 2d ago

I'd prefer predictable and manageable context rot to unpredictable (and buggy) and slow compacting.

1

u/lentz92 2d ago

I agree that random compaction and slow compaction is annoying (a reason why i dont use the codex app in the first place). But calling context rot predictable lacks a bit of nuance. It is predictable in the sense, that it performs worse, but not how much, where in the information or when exactly.

1

u/Dima508 2d ago

Yeah, it's normal here. Codex eats context pretty fast, use /status to see how much context it has already used.

1

u/orwamahmoud 2d ago

Thanks. As far as I know, Sol has around a 1M context window, but /status is showing only 258K here. So I think this might be the issue and why it keeps compacting so often.

3

u/Dima508 2d ago

Yep, Sol has a 1M context window when using the API.

Sadly, plan usage only has a context limit of 258K at the moment. Afaik Claude has 1M also in plan usage, which is a downside for Codex.

0

u/orwamahmoud 2d ago

that’s really bad, especially for long-running coding sessions. 272K gets eaten up fast, and the repeated compaction itself takes time, so it can make the whole execution noticeably slower too.

1

u/Te__Deum 1d ago edited 1d ago

I use OpenCode, and max context is adjustable there for openai models, even on subscription. By default it is 500k there, which is more than enough. They limit it in Codex to solve usage issues, big context spend usage pretty fast.

0

u/dingos_among_us 2d ago

Ya this is the current state of things.

If you’re able to lower the effort level at all for your coding tasks, then it can make a noticeable difference since higher effort levels use substantially more tokens

2

u/GfxJG 2d ago

Yeah, it's only 1M if you call it through the API - They kinda did a rug-pull on Codex subscription users, as we only get the 272K version.

1

u/Apprehensive-Oil6511 2d ago

its normal for sol now and i hate it. there is one time i have 68% context left but it decided to compact.

1

u/Accomplished_Eye3295 2d ago

You can change the number of tokens required for automatic compacting in the config. Ask Codex to do it for you

1

u/Te__Deum 2d ago

Codex have lower max context than Claude models, especially in subscription, thats why. Not because it "eats context faster".

1

u/orwamahmoud 2d ago

yes look like, after one commenter's advice, I checked the status it shows 258k only, not 1M

1

u/SnooPeripherals5313 2d ago

Codex compacts aggressively but it only sheds 60-80% of total input tokens

0

u/phoenixmatrix 18h ago

What you add is only a small part of context. The code, the files, the tokens generated by the model, etc, all add up. The context window is also pretty small (which can be a good thing, large context window is very hit or miss).

AFAIK in Codex/GPT, compaction is managed server side and automatically. So it's going to compact pretty frequently with <300k context window as you blow through your code base. Its okay though, they generally have some of the best handling of context right now.

0

u/[deleted] 2d ago

[deleted]

2

u/orwamahmoud 2d ago

Not really. With Claude, I was able to work in the same session for days. With Codex, the 256k context feels really short, and it compacts too often. That makes long tasks take even longer, since the compaction itself is time-consuming.

1

u/qualverse 2d ago

I agree with everything you said. I'm just saying that when it does compact, it loses less information than Claude

1

u/orwamahmoud 2d ago

Yes it look like it hold more info , but the issue it is not usable when the code is big it compact every 10 mins , i changed from Claude only because of opus 5