Codex session stuck or compacting: what to do

Check active tools, approvals, network retries and compaction before treating a silent turn as stuck. Preserve progress before continuing elsewhere.

Start here

Save your work, then check for pending approvals, tool activity and repeated compaction before starting another turn.

Check what Codex is waiting for

No new text does not identify a single cause. The model may be working, a tool may be running, an approval may be waiting, the network may be retrying, or context compaction may be in progress. Read the visible status and any actual error before interrupting work.

What you seeNext action
A tool or command is still runningInspect its progress and whether it needs input.
Approval or user input requestedResolve the visible request if appropriate.
Compacting contextAllow a normal compaction to finish; watch for completion or an error.
Repeated compaction without useful outputPreserve progress and compare a fresh task.
Context-window error on every retryStop resending the same prompt; prepare a new task with a concise handoff.
Stream disconnected or idle timeoutFollow the connection guide.

When compaction is normal

Compaction makes room in the model’s working context. A TUI change added a visible Compacting context status and timer. Older or different clients may display it differently; the pull request does not establish a shipping version for every client.

An advancing timer measures elapsed time, not guaranteed progress. Do not interrupt ordinary compaction immediately, but do not wait indefinitely just because a clock continues to tick. Look for a completed turn, an error, or a repeated cycle with no output.

If the same context error keeps returning

A Windows desktop report describes repeated context-window failures even for a short follow-up. Another report describes recurring compaction notices without useful progress. These are examples of failed recovery, not evidence that every slow turn is broken.

Before moving work:

  1. Preserve the last useful answer, current task goal and remaining steps.
  2. Inspect the project files and Git diff to see what has actually changed.
  3. Record any running process or external action whose result is uncertain.
  4. Start a new task in the intended project with that concise handoff.
  5. Ask the new task to verify the current state before continuing edits or repeating external actions.

Keep the old task available as a record. A new task working normally is a workaround; the original task may remain unresolved.

Compact deliberately when the client supports it

The CLI commands reference documents /compact. Use the command offered by your installed client when you want to reduce active context. Save important requirements first. It is not a guaranteed repair for a session whose compaction requests already fail.

If you need to reopen a CLI session, codex resume and its documented options are covered in the resume guide. Resuming does not remove a context error by itself.

If the cause is still unclear

Save unsent text and note the last visible action and timestamp. Check whether another idle task in the same client can answer a small harmless prompt; the comparison may consume usage. Avoid sending duplicates into the stalled task while it could still be executing.

After saving work and resolving active operations, one normal relaunch can be a useful comparison. If the same failure returns, collect the error rather than cycling through restarts or increasing permissions.

How to tell it worked

The intended task produces a useful response and can continue. A finished timer or a compaction notification alone is insufficient. Record separately whether the original recovered or you continued in a new task.

If reporting the problem, include the client build, OS, exact error, elapsed time, active tool/approval state and fresh-task comparison. Keep credentials and unrelated conversation content out of shared logs. Do not delete session files or databases as a generic hang repair.

This guide is part of our Codex sessions troubleshooting.

Compare another message in the Codex error guide library. First check whether this is a Codex service-side problem → View live Codex status.

Useful Codex tools

Sources

Each source lists what it is used to support. Sources are re-read on the review schedule, not continuously.

How this page is checked
Evidence level
Reported - based on public reports, not reproduced here
Last reviewed
2026-09-22
Content updated
2026-09-22
Full version scope
Public desktop reports on Windows and macOS; the locally installed CLI version in one report was not a verified desktop backend version. No universal affected or fixed release is asserted.
Symptoms indexed
  • A turn stops producing output and you cannot tell whether the model is still thinking or the client has died
  • The client shows 'Compacting context' with an elapsed timer while no reply appears
  • A message appears: 'Codex ran out of room in the model's context window. Start a new thread or clear earlier history before retrying.'
  • Compaction appears to succeed ('Context automatically compacted') but the session makes no progress

Reviewer note

Reviewed against current official references and original issue reports on 2026-09-22. General diagnostic steps are distinguished from reported outcomes; no cross-platform failure reproduction is claimed.

Last updated: