Thread Lifecycle
Manage Codex sessions across start, resume, fork, compact, and handoff.
Key takeaways
- Long-running work needs thread hygiene; without lifecycle rules a session accumulates stale assumptions, duplicated plans, and unclear ownership.
- Know the five lifecycle actions: Start for clean context, Resume after interruption, Fork to explore a variant, Compact to reduce context load, and Stop to summarize final state.
- Make handoffs explicit with current goal and acceptance criteria, files changed, commands already run and their results, known blockers, and the next safe action.
- If the thread no longer reflects actual repository state, stop and re-ground from files and git status before continuing.
Long-running work needs thread hygiene. Without lifecycle rules, the session accumulates stale assumptions, duplicated plans, and unclear ownership.
Lifecycle Actions
| Action | Use |
|---|---|
| Start | New task with clean context |
| Resume | Continue the same task after interruption |
| Fork | Explore a variant without disturbing the main path |
| Compact | Preserve useful state while reducing context load |
| Stop | End a task and summarize final state |
Handoff Checklist
- Current goal and acceptance criteria.
- Files changed or expected to change.
- Commands already run and their results.
- Known blockers or open questions.
- Next safe action.
Failure Mode
If the thread no longer reflects the actual repository state, stop and re-ground from files and git status before continuing.