Add a 'Compact context and implement plan' option to Plan Mode

Open 💬 10 comments Opened Apr 18, 2026 by guidedways
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What variant of Codex are you using?

CLI

What feature would you like to see?

I really like the new Yes, clear context and implement plan option in Plan Mode but honestly, a better option would be Yes, _compact context_ and implement plan because I'd like it to retain memory of whatever we were doing earlier, but compacted.

Additional information

_No response_

View original on GitHub ↗

10 Comments

github-actions[bot] contributor · 3 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #18489

Powered by Codex Action

guidedways contributor · 3 months ago

For context, I use plan mode in a single 'session' where I've manually decomposed a much larger problem into smaller, easier to do work. I then use plan mode to go through each one by one - plan mode in xhigh comes up with excellent suggestions I'd probably otherwise have to think of myself. For this reason, I rely on auto compaction but given the above new feature, I just realized it would be superb to have it compact before implementing the plan (instead of clearing the context and _re learning everything_ as the code we're working on is millions of lines, spread out far and wide between thousands of files.

etraut-openai contributor · 3 months ago

It is our goal to make compaction completely transparent to users. It's not something that users should need to think about. Historically, the harnesses and models have not been good enough with compaction, so we've imposed the added mental burden on users to actively monitor and manage their context windows. With the latest models and auto-compaction techniques, we're getting much closer to the ideal situation where users no longer need to think about it.

For that reason, I think it's unlikely that we'd sprinkle in more manual compaction options in the existing UI. That would take us in the opposite direction than we want to go.

I'll leave this feature request open to see if other Codex users want to weigh in here, but we'd have to see many upvotes to even consider an option like this.

guidedways contributor · 3 months ago

Appreciate the insight, I agree - auto-compaction in codex is magical. It's beyond transparent and it actually works. It was easy to see it drift a few months ago but not anymore. You guys hare cooking it 👏

ariccio · 2 months ago
It is our goal to make compaction completely transparent to users. It's not something that users should need to think about. Historically, the harnesses and models have not been good enough with compaction, so we've imposed the added mental burden on users to actively monitor and manage their context windows. With the latest models and auto-compaction techniques, we're getting much closer to the ideal situation where users no longer need to think about it. For that reason, I think it's unlikely that we'd sprinkle in more manual compaction options in the existing UI. That would take us in the opposite direction than we want to go. I'll leave this feature request open to see if other Codex users want to weigh in here, but we'd have to see many upvotes to even consider an option like this.

I do agree with you in theory about transparency of compaction, but codex now seems to have a "clear context and implement" which seems to contradict it.

Personally, I never use that option, or the one in Claude code, because there's often useful info in the context window that's not explicitly included in the plan. Claude's compaction is so bad I wouldn't necessarily use a "compact and implement" option there, but I'd absolutely use a codex compact and implement.

yeliex · 2 months ago

@etraut-openai plan mode always use half or more context window, what`s the best practice to implement after plan, just implement it or compact then implement

etraut-openai contributor · 2 months ago

@yeliex, I use plan mode often. I never use manual compaction. The auto-compaction mechanism in Codex is very good.

mahdikayvan · 2 months ago

@guidedways Hey — I know this kind of issue too well. It is very close to the agent reliability problem I’m working on.

I’m building AgaveCore, and I’d like to let a few early people use it for free while I shape it into something stronger.

It helps when a coding agent starts to drift, loses important context, or gives you an output you do not fully trust.

In practice, it works through two habits:

  • tell the agent to remember-progress or remember-this when something important should not be lost
  • use consult-brain when the current task needs more grounded feedback on what to do next

Over time, as useful journals, decisions, and failures pile up, the product should help the agent make sharper decisions and take better actions with less drift.

If this sounds relevant, reply here and I’ll send the exact steps. You can also use the email or Telegram on my profile.

Cheers,
Mads.

pattty847 · 2 months ago
It is our goal to make compaction completely transparent to users. It's not something that users should need to think about. Historically, the harnesses and models have not been good enough with compaction, so we've imposed the added mental burden on users to actively monitor and manage their context windows. With the latest models and auto-compaction techniques, we're getting much closer to the ideal situation where users no longer need to think about it. For that reason, I think it's unlikely that we'd sprinkle in more manual compaction options in the existing UI. That would take us in the opposite direction than we want to go. I'll leave this feature request open to see if other Codex users want to weigh in here, but we'd have to see many upvotes to even consider an option like this.

Side note, when in long threads, having recently used /plan to create a document, and are on the edge of a compaction, the actual plan document should, if not already, be saved along with the summary verbatim. Often you will plan something, then compaction occurs, and that fresh plan with all that context details baked in are lost. if this is the case, if it is saved ignore, I apologize

enniofilicicchia · 1 month ago

Agree with OP, Yes, compact context and implement plan makes more sense than clearing

Precious information is lost when clearing, and often agent restarts checking the same folders again, wasting token

I get why generally you want to hide context handling from user, but it looks to me that replacing clear with compact, or adding the option along, is a no brainer, and easy to implement too