codex just compacts repeatedly for hours at a time before it is able to make a change

Resolved 💬 18 comments Opened Mar 9, 2026 by jamesheinlein Closed Mar 14, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of Codex CLI is running?

0.112

What subscription do you have?

Pro

Which model were you using?

5.4-xhigh

What platform is your computer?

darwin m3 max

What terminal emulator and version are you using (if applicable)?

ghostty

What issue are you seeing?

each compaction leaves codex with only like 12% context remaining, and so it is impossible to actually do anything. I'm like "great, can you make the change per the spec and discussion" and then it compacts from 10% to 15%, reads a few files, compacts from 5% to 12%, reads a few files, compacts, reads a few files, compacts, etc.

it has done this about 6 times in a row, and it has not been able to patch a single file yet after around 2 hours, and I bet its understanding of the change I want is degrading due to game of telephone.

this is completely unusable and I did not see the issue on older versions like 0.109 IIRC

What steps can reproduce the bug?

run a session with a bunch of docs and files touched. not really a large change, affecting less than 30 files and 10 docs.

What is the expected behavior?

for the /compact feature to actually /compact context to some reasonable extent, or to overall design the product in a way that makes it possible for the agent to edit code without just sitting there compacting repeatedly for hours.

Additional information

_No response_

View original on GitHub ↗

18 Comments

github-actions[bot] contributor · 4 months ago

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

  • #13279
  • #13946
  • #13909

Powered by Codex Action

ohad7 · 4 months ago

seeing the same behavior. any workaround?

mercmobily · 4 months ago

This is a _real_ problem for me now

ohad7 · 4 months ago
This is a _real_ problem for me now

I switched to reasoning effort high instead of xhigh - so far it's working and didn't get stuck

mercmobily · 4 months ago
I switched to reasoning effort high instead of xhigh - so far it's working and didn't get stuck

I reverted to 5.3 and set it to HIGH, and now when I compact it ACTUALLY compacts.
(I hope this will help devs to find the problem and users to get around it!)

mercmobily · 4 months ago

I just realised I used 80% of my quota re-compacting repeatedly... ugh! Watch out people.

apollostreetcompany · 4 months ago

they know it's an issue.

adrianabelarde · 4 months ago

seems a bit fast now after changing it from xhigh to high

CatnyapC · 4 months ago

@jamesheinlein @ohad7 @mercmobily I found that manually stopping all “Codex Helper” processes in Activity Monitor stops Codex from getting stuck while auto-compacting, and then just prompting it with “continue” fixes it for me. Hope this helps!

mercmobily · 4 months ago

@CatnyapC Wait I am using codex-cli, I've never used the web version... is there an "activity monitor" in codex-cli too?

martindrapeau · 4 months ago

No, Activity Monitor on MacOS (equivalent to Task Manager in Windows),

CatnyapC · 4 months ago
@CatnyapC Wait I am using codex-cli, I've never used the web version... is there an "activity monitor" in codex-cli too?

My bad, I assumed you were using the new Codex App. I didn’t realize the CLI version had this auto-compacting issue too, thought it was only an app-side problem, since the app has been pretty bumpy since launch.
But with how unstable auto-compacting is right now, I think the app version is still worth using, since at least there’s something you can do about it when it's stuck compacting in a loop.

ohad7 · 4 months ago

i don't experience this bug any more, Been running two days with xhigh codex app, no death spiral. I think it can be closed.

etraut-openai contributor · 4 months ago

We deployed a fix for this. It was a server-side issue. Thanks everyone who reported this problem.

C-o-d-e-C-o-w-b-o-y · 2 months ago

I just downloaded Codex and am facing this issue - as soon as my session hits 258k context I literally cannot proceed, it just gets stuck on 'compacting' and then fails repeatedly

kushalj1997 · 1 month ago

Facing a similar issue - frequent context compacting, despite only 27-30% context usage. Codex is extremely slow at completing work due to this issue. Also happens when I open a new session.

jaylex32 · 1 month ago

I'm having this issue compacting after compacting without doing any work and then it wastes all my tokens, that should be reimburse.

umizame · 18 days ago

In my Codex session, it keeps reading the same files over and over, and just when it seems like it’s finally about to move on to the next task, it gets compacted again and stops.