Guides

Keep Codex on task after context compaction

Preserve the current objective, phase, completed work, rejected paths, next action, and verification when a long Codex task compacts or resumes.

Answers: Codex loses task state after context compaction · Updated

SHORT ANSWER

Codex users search for this as lost task state, repeated work, restart loops, or the active checkpoint disappearing after compaction. Nightshift does not alter Codex’s compactor; it keeps the continuation pointer in project files so a resumed task can read the current phase instead of reconstructing it from conversation history.

01

The failure is the continuation pointer

A broad summary may preserve what the project is about while losing the narrower execution state: which phase is active, what already landed, which paths failed, and what must happen next. Public Codex reports describe repeated exploration and compaction loops after that pointer is lost.

  • Current objective and acceptance
  • Current phase and completed work
  • Decisions and rejected paths
  • Exact next action
  • Verification still due
02

Keep the checkpoint outside conversation history

Nightshift’s punch list remains authoritative for approved work. Product-evolution and owner-walkthrough shifts also maintain one continuation record with completed steps, decisions, rejected paths, the exact next action, and remaining verification.

  • Refresh the record at meaningful boundaries, not after every command.
  • Resume a building item before exploring a new one.
  • Use project checks and current files to re-verify claims after compaction.
03

Know what this does not repair

The durable state gives Codex a trustworthy work pointer; it does not restore missing conversation turns or change the host’s compaction implementation. Recovery still stands down when task identity or process evidence is unsafe.

Move this Codex task's objective, current phase, completed work, rejected paths, exact next action, and remaining verification into Nightshift's durable project state.
TRY IT

Start with a bounded prompt

This prompt names the outcome and preserves Nightshift’s review boundary. Paste it into the supported coding host from the project you want to change.

Move this Codex task's current objective, phase, completed work, rejected paths, exact next action, and remaining verification into Nightshift's durable project state.
BOUNDARIES

What this workflow does not claim

  • Nightshift does not modify Codex's compaction algorithm or guarantee that conversation history is restored.
  • A durable continuation record still needs sharp acceptance criteria and current verification evidence.
SOURCES

Evidence and sources

These links support the released behavior, public outcomes, or problem language described on this page.

Reported Codex compaction failure modeA public report describes task-state loss and repeated completed work after context compaction.Open evidence ↗How Nightshift worksHost differences, process leases, state files, workspace layouts, guarantees, and limits.Open evidence ↗Merged Codex hardening PRAn 11-item Nightshift run in Codex that shipped in v0.9.2.Open evidence ↗
RELATED QUESTIONS

Continue from the question you have

how to stop Codex repeating work after compactionRead the answer →how to keep Codex on task during a long sessionRead the answer →how to recover an interrupted Codex taskRead the answer →