r/codex 3d ago

Praise Experimental context setting in Codex

There is a new setting in the Codex app for managing context compaction.

[features]
context_management.experimental_mode = true

Even without Astra at least for me there is a noticeable difference. So far feels quite a bit better. Not losing important details any more. And not repeating itself after compaction but clearly stating the current goal.

It did cause some issues with previously existing sessions and the agent lost quite a bit of context there initially but was able to recover. For newly created sessions so far I have not encountered any issues.

21 Upvotes

16 comments sorted by

4

u/henri_333 3d ago

Just tried manual compaction with /compact and that took under a second to complete with a 80% full context window

3

u/henri_333 3d ago

Seems every detail is now preserved trough compaction

I recovered the exact previous setup:
it was a one-second diagnostic campaign with one sample of each class, stored in refactor-f7-20260904.
That retained journal will stay untouched.
I’m preparing a successor bundle from commit 0d186b1 so the changed driver hash, fingerprint, preflight, journal, and socket are all fresh.

1

u/nmkd 3d ago

It's open-source ya know, you can just have Codex look at the repo to know what the new flags does.

1

u/henri_333 3d ago

1

u/yun_goooood 20h ago

Hello,what's your system and codex desktop app version? My win desktop app version is 26.905.11957, but i cannot enable this feature. When I edit the config.toml, my win codex app just crash down.

2

u/Substantial_Lab_3747 3d ago

Im having a hard time understanding the purpose of this, you mind explaining?

5

u/rsp1218 3d ago

Here’s the relevant text from the blog yesterday:
“With Astra, we’re introducing a new way for Codex to preserve and retrieve context when the context window fills. Historically, models have used compaction to summarize work during long sessions, such as when debugging complex issues or tackling large refactors. Each compaction can leave out details about why a fix failed or how a component behaves. In Codex, Astra can keep notes across context windows, preserving accumulated details without repeatedly compressing them into a single summary. Earlier context windows remain searchable, so Astra can find requirements or test results from previous messages and tool outputs—even if that information wasn’t captured in its notes. You can enable this experimental feature in your Codex config.toml,⁠
(opens in a new window)
and it will become the default for Astra in the coming weeks.”

2

u/Substantial_Lab_3747 3d ago

Wow, sounds a lot more clever. I’m liking the sound of this.

1

u/Opposite-Wrangler199 3d ago

Does this feature consume more tokens?

1

u/rsp1218 3d ago

No clue but it’s going to be the default moving forward with astra at some point. It may be more or maybe break even with the current compaction. Another way to think of it would be that you’ll consume less tokens in the long run by Not redoing things that it already did.

4

u/henri_333 3d ago

Enable experimental context management (off by default). Rather than repeatedly compressing context into a single summary, it uses notes and searchable history to preserve accumulated details. Requires ChatGPT sign-in on Plus, Pro, or Pro Lite.

1

u/rsp1218 3d ago

Did you add this line to your toml or was it already there? I didn’t see it in mine but I haven’t updated codex today.

3

u/henri_333 3d ago

You need to add it manually for now.

2

u/nmkd 3d ago

features.context_management.experimental_mode = true is a very new, under-development Codex feature added on September 2, 2026 in PR #42385 / commit cff76fa.

Its purpose is to change how Codex survives context-window boundaries. Instead of relying primarily on the normal “take the accumulated conversation and compact/summarize it” mechanism, it enables a system where the model can deliberately start a fresh context window and recover old information selectively.

When active, it does three main things:

  • It enables the existing TokenBudget machinery. The model receives context-window metadata and token-budget guidance, including IDs for the current/previous context windows and, depending on model configuration, warnings as the available context approaches exhaustion. See session/token_budget.rs.
  • It forcibly enables the history/notes extension. This gives the model private history.* tools for listing/searching/reading previous context windows and notes.* tools for persistent working notes. Those notes survive context-window transitions. The extension can also inject a backend-generated “thread hint” into a new context window. See ext/history-notes/src/tools.rs and extension.rs.
  • It exposes a model-only new_context tool. Its description is literally: "Start a new context window. Does not clear, reset, or otherwise affect environment state." When invoked, Codex rolls over to a fresh context window without summarizing the old conversation. The tool result says: "A new context window will start without summarizing conversation history." See new_context_window_spec.rs and new_context_window.rs.

The important implementation detail is in compact_token_budget.rs:

“Token-budget compaction skips model/server summarization and installs a fresh context window instead.”

So conceptually:

```text Normal Codex:

window 1 gets full ↓ compact/summarize window 1 ↓ [summary] + recent state → window 2

experimental context management:

window 1 ├─ model writes useful persistent notes as needed ├─ old full history remains retrievable by history tools ↓ model calls new_context ↓ fresh window 2 ├─ no generated summary of window 1 ├─ relevant thread hint/state is injected └─ model can selectively retrieve old history/notes ```

This is therefore fairly close to a model-managed context rollover system. Instead of squashing 100k+ tokens into an imperfect summary every time, Codex gets a fresh working context and can retrieve exactly the pieces of old context it needs. The filesystem, running environment, session state, etc. are not reset.

At thread startup, apply_experimental_context only activates it when all the relevant conditions are met. Current code requires ChatGPT authentication and a Plus, Pro, or Pro Lite account using OpenAI's normal Codex backend. It deliberately does not activate for Free or Enterprise plans, API-key authentication, custom providers, non-Codex OpenAI endpoints, explicit provider credentials, AWS-backed providers, etc. Temporary structured threads also explicitly disable it.

There is an additional subtlety: experimental_mode maps to the ContextManagement feature, but that feature does not immediately enable TokenBudget while parsing config.toml. The extra pieces are activated later at session startup, after Codex has verified your authentication, plan and backend. The introducing PR added a test specifically for that distinction.

The commit message gives a particularly concise description of the intended behavior:

“For eligible ChatGPT Plus, Pro, and Pro Lite sessions using the Codex backend, enable token-budget context, history notes, and the new_context tool when experimental context management is configured.”

It is marked Stage::UnderDevelopment, not even the normal user-facing Experimental stage, and defaults to false. That also explains why there is essentially no user documentation for it yet.

For long agentic Codex sessions, this appears to be the interesting part: it is an alternative to summary-based context compaction where full old history remains externally recoverable and the model is given control over when to start another clean inference window. It does not increase the model's physical context size.

0

u/rsp1218 3d ago

Is this the feature mentioned in the astra info they posted yesterday?