Guides

Keep Codex on task after context compaction

Give Codex an on-disk continuation point before a long session compacts: completed work, rejected paths, exact next action, and verification still due.

Updated

SHORT ANSWER

Does context compaction end a long Codex task?

Compaction can shorten the conversation Codex sees; it does not mean the task has ended. Keep the approved list and current work pointer in project files, then read those files and recheck the working tree after compaction.

01

Before: a summary loses the execution point

Illustrative example: Codex has fixed a parser, rejected a broad API rename, and still needs to run the parser tests. A conversation summary that says only 'improve parsing' invites another investigation or an accidental repeat. Put the finished change, rejected rename, exact next command, and remaining acceptance in durable state before that boundary.

Current item: Reject malformed input without changing the public API.
Done: parser branch updated; focused fixture added.
Rejected: renaming parse() would break callers.
Next: run npm test -- parser, fix any failure, inspect diff.
Still due: verify valid input path and write item receipt.
02

After: resume from the files

After compaction, read punch-list.md, the active item receipt or opportunity-map.md when that shift uses one, and the current Git diff. Re-run the named check before ticking. Completed boxes stay completed; the next action is explicit rather than inferred from a compressed chat summary.

  • Approved scope remains in the punch list.
  • Decisions and rejected paths remain in their respective records.
  • A check claimed in earlier conversation is revalidated against current files when needed.
03

Compaction, early stops, and crashes are different

Compaction is a context change inside a continuing task. An attempted early stop with open items is handled by Codex's stop hook. A dead process requires watchman evidence and a resumable identity for same-conversation revival. None of these mechanisms restores missing turns or proves a checked item's quality.

Codex stopping early ↗Crash recovery ↗
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.

Record the active Codex item, what is done, rejected paths, exact next action, and verification still due in Nightshift project files.
BOUNDARIES

What this workflow does not claim

  • Nightshift does not change Codex compaction or restore missing conversation turns.
  • Compaction is distinct from an early stop or a dead process.
SOURCES

Evidence and sources

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

How Nightshift worksHost differences, process leases, state files, workspace layouts, guarantees, and limits.Open evidence ↗Workflow contractThe shipped one-item loop, decision boundary, gates, recovery, and clock-out behavior.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

Codex stops with unfinished workRead the answer →continue work across coding hostsRead the answer →recover a crashed Codex taskRead the answer →