Skip to content

Manual /compact command in Codex app #11325

Closed

Description

@Khang5687

What variant of Codex are you using?

260208.1016

What feature would you like to see?

We need manual /compact command. On Codex CLI we can do that, on the app, well...

Image

Additional information

No response

Activity

  1. github-actions commented on Feb 10, 2026

    @github-actions
    Contributor

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

    Powered by Codex Action

  2. etraut-openai commented on Feb 10, 2026

    @etraut-openai
    Contributor

    Can you say more about why you want a manual compact command? We've implemented a robust auto compaction mechanism, so there should no longer be a need for developers to manage context windows manually. We've left manual compaction in the CLI for now, but our goal is to eventually remove it.

  3. Khang5687 commented on Feb 10, 2026

    @Khang5687
    Author

    Can you say more about why you want a manual compact command? We've implemented a robust auto compaction mechanism, so there should no longer be a need for developers to manage context windows manually. We've left manual compaction in the CLI for now, but our goal is to eventually remove it.

    Normally, I do not create a new chat sessions, so my Codex chat history is just compactions after compactions.
    Codex's compaction mechanism is very good! Plus, Codex does not need to re-read all the files.

    The problem I usually run into without manual /compact: I may approve Codex's plan when it is at 70% of its context window, making Codex auto compact while it is in the middle of its work.

    With manual /compact however, I will do /compact -> Context window is now only 10% full -> Codex has more context window to work on my task without auto compacting mid-work.

  4. miraclebakelaser commented on Feb 11, 2026

    @miraclebakelaser
    Contributor

    Can you say more about why you want a manual compact command? We've implemented a robust auto compaction mechanism, so there should no longer be a need for developers to manage context windows manually. We've left manual compaction in the CLI for now, but our goal is to eventually remove it.

    Here's my workflow for long-running tasks which works well:

    1. Generate an ExecPlan
    2. Compact the conversation
    3. In the new conversation, mention the plan and prompt codex to "Execute the plan. Update Progress, Surprises, Decision Log, and Outcomes as you work"
    4. After each milestone, I compact the conversation, provide the codex with the updated plan, and then ask it to continue on to the next milestone
    5. Repeat until completion
  5. Khang5687 commented on Feb 11, 2026

    @Khang5687
    Author

    Thanks @miraclebakelaser, this is a useful knowledge to me.

    1. After each milestone, I compact the conversation, provide the codex with the updated plan, and then ask it to continue on to the next milestone

    So you do manual compaction right?

  6. miraclebakelaser commented on Feb 11, 2026

    @miraclebakelaser
    Contributor
  7. MrRobot701 commented on Feb 11, 2026

    @MrRobot701

    Well, the "robust auto compaction mechanism" doesn’t work for me. When the context gets close to 258k but not close enough the auto compaction fails with this error. And you have to salvage the context by asking gpt to parse the session in another session.

    Image
  8. ignatremizov commented on Feb 11, 2026

    @ignatremizov

    +1, having control over compaction and context management (as well as more transparency into what is the prompt after compaction) is invaluable to proper workflows

  9. thisIsLoading commented on Feb 12, 2026

    @thisIsLoading

    yes, same. i do lots of spec work before letting it lose and need lots of context at times. so i find myself opening new sessions so that i dont suffer a compaction event in the middle of the spec work, which needs as many details as it gets and compaction obviously loses lots of details

  10. Undiluted7027 commented on Feb 13, 2026

    @Undiluted7027

    Manual context compaction will enable us to control the timing of compaction and ideate our workflows based on when we want the context to be compacted rather than relying solely on auto-compaction. The developer's experience becomes more predictable with the models when context compaction can be manually controlled which is in case much valuable when the user only uses a single chat session for their work. Also, a question I could not get answer to from the docs: does context get shared between threads of a project? My understanding is that as of right now, it doesn't get shared across threads.

  11. jadentripp commented on Feb 13, 2026

    @jadentripp

    /compact is an essential part of my workflow. Just like with the model picker, I need control over my setup. I don't trust automatic mechanisms for this kind of thing(yet). I regularly see performance degradation when I approach 20% context left and when I use /plan on xhigh, often the context window will only have 10% left. I understand GPT-5.3-Codex performs better than other frontier models even at high context usage and that context is lost in compaction, but I want to completely avoid any performance degradation. Basically, the problem is Codex is entering the dumb zone(https://youtu.be/rmvDxxNubIg?t=355&si=aSHUwLLoTa05e1yF) in the app and the user has no way to manually compact to avoid it. If users had the ability to configure a compaction threshold, this dumb zone could be completely avoided.

  12. NightMachinery commented on Feb 13, 2026

    @NightMachinery

    Giving users options never hurts. Auto-compaction is great, auto-compaction plus manual option is even better.

  13. ignatremizov commented on Feb 13, 2026

    @ignatremizov

    does context get shared between threads of a project?

    @Undiluted7027 not really. the maintainers are working on a SQL-backed memory system, still under development. Best sharing of context cross-thread is via AGENTS.md and SKILL.md files, or my preferred method recently, spec-kit files.

  14. 43 remaining items

  15. timurkhakhalev commented on Apr 16, 2026

    @timurkhakhalev
  16. marked Manual compaction #18152 as a duplicate of this issue on Apr 16, 2026
  17. miraclebakelaser commented on Apr 16, 2026

    @miraclebakelaser
    Contributor

    we did it, folks

    Image
  18. timothyw553 commented on Apr 16, 2026

    @timothyw553

    "codex can you add a command '/compact' which calls the the existing compact command?"

    all it took was an 80 comment thread and pushback... woohoo!

  19. Itsindigo commented on Apr 17, 2026

    @Itsindigo

    wooohooo, beautiful feature

  20. etraut-openai commented on Apr 17, 2026

    @etraut-openai
    Contributor

    This feature is now implemented!

  21. devops-taehoon-kim commented on May 4, 2026

    @devops-taehoon-kim
    Image

    I Can`t use /compact feature

    Version 26.429.30905(2345)

  22. eefan000 commented on May 6, 2026

    @eefan000

    They quietly removed the feature, just to close this issue, they added a version first and then deleted it!

  23. eefan000 commented on May 6, 2026

    @eefan000

    This feature is now implemented!

    Can you explain why this feature was removed again

  24. miraclebakelaser commented on May 6, 2026

    @miraclebakelaser
    Contributor

    See it on Version 26.429.61741 (2429). I've had slash commands disappear for me due to configs (#17772), perhaps try clearing out config.toml and seeing if compact is still missing.

  25. Molunerfinn commented on May 8, 2026

    @Molunerfinn

    Hi @etraut-openai , why this feature was removed again?

  26. ravesteijnd commented on Jun 15, 2026

    @ravesteijnd

    In the app I often get "Codex ran out of room in the model's context window. Start a new thread or clear earlier history before retrying." after a long session.

    Doing a compact fixes this. However, because I cannot do this from the app I need to:

    1. copy the UUID of the thread from the app
    2. start codex CLI with that thread ID
    3. do a compact in the CLI
    4. restart the app
    5. continue work

    Why was this feature removed?

  27. Pzixel commented on Jun 15, 2026

    @Pzixel

    In the app I often get "Codex ran out of room in the model's context window. Start a new thread or clear earlier history before retrying." after a long session.

    Doing a compact fixes this. However, because I cannot do this from the app I need to:

    1. copy the UUID of the thread from the app
    2. start codex CLI with that thread ID
    3. do a compact in the CLI
    4. restart the app
    5. continue work

    Why was this feature removed?

    don't you have the /compact command?

    Image

    Version 26.609.41114 • Released 12 Jun 2026

  28. ravesteijnd commented on Jun 15, 2026

    @ravesteijnd

    I just updated the app, I have it now. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appIssues related to the Codex desktop appenhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions