Custom Context Compaction
Open 💬 5 comments Opened Feb 28, 2026 by saulrichardson
💡 Likely answer: A maintainer (github-actions[bot], contributor)
responded on this thread — see the highlighted reply below.
What variant of Codex are you using?
Codex App
What feature would you like to see?
You should allow for customizable compaction routines. This could help solve the context window issues people run into when using MCPs. I want my agent to read and have access to all that information but only for while I'm using the MCP. When I'm done it doesn't need to be in the window at all. People should have more control of what gets compacted and how, not to mention when. Context compaction is important for better controllability when it comes to agents. I should be able to see everything that is in the window, specify what parts should be more compacted versus others or make sure that certain tool calls remain the in window, etc.
Additional information
_No response_
5 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
duplicate
reopening as this request is specific to codex app while other issues are for cli
+1 PLEASE give us better compaction options
I routinely run into compaction error loops where I have to discard my whole thread.
@saulrichardson Hey — I felt this issue immediately, and it is very close to the exact pain I’m trying to solve.
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:
remember-progressorremember-thiswhen something important should not be lostconsult-brainwhen the current task needs more grounded feedback on what to do nextOver 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.