It is writing the handoff.md during the rolloff.
To make things easyer for this topic, here is the entire Rollover skill.
Codex made the skill after i explained what i needed from it.
(And you can see in there it needs my explicite mention to do a rollover, because i cant yet make it access the context window itself, needed to do all this automatic).
Checkpoint and continue in a fresh Codex task
Manual Rollover
Skill
Checkpoint and continue in a fresh Codex task
Perform the proven project rollover workflow only when the user explicitly invokes [$rollover] or unambiguously asks to use the rollover skill. Never activate it merely because a task is substantial or the context might be low. Do not ask for, estimate, track, or act on a Context Left percentage.
Stop at a coherent boundary
Treat invocation as a request to move the current project work into a fresh Codex task. If one atomic tool call is already running, let it finish, then stop normal implementation. Do not start another implementation, test, build, dependency, or Git operation in the old task.
For a post-implementation rollover, preserve completed work and verification as completed state. Tell the replacement task not to repeat them. When no next priority is established, set the next action to await the user’s instruction.
Capture the exact project identity
Before editing the handoff or creating the replacement task, establish the canonical project root:
- For a Git project, resolve both the current working directory and
git rev-parse --show-toplevel.
- Otherwise, resolve the primary workspace root supplied by the current project.
- Record the absolute canonical root, current branch when applicable, repository identity, and current execution environment.
- Never infer a fallback root from the user profile, a temporary directory, the Codex configuration directory, or a drive letter.
Inspect the working-tree status and preserve all user-authored, untracked, and intentional existing changes. Read mandatory project rules and the existing root handoff.md when present.
Write the handoff
Create or update handoff.md in the canonical project root. Preserve still-relevant information and user-authored constraints while replacing stale progress. Never claim a check passed unless it ran successfully.
Use this structure:
# Project Handoff
## Rollover metadata
- Timestamp
- Canonical project root
- Execution environment
- Repository and branch, if applicable
## Current objective
## Completed work
## Important decisions and reasoning
## Constraints and protected resources
## Repository state
- Relevant tracked modifications
- Relevant untracked files
- Verification already completed
## Relevant files and symbols
## Unresolved issues and risks
## Exact next action
Keep the handoff concrete and compact but sufficient to continue without replaying the conversation. Include exact commands only when their exact form matters.
Create one replacement task
After the handoff is fully written:
- Resolve the saved project whose canonical primary root equals the recorded root.
- Create exactly one Codex task with that saved project’s identifier and the Local environment so it uses the same direct checkout.
- Never choose Worktree, Cloud, projectless, a new clone, or an invented project.
- Omit model and reasoning overrides so the user’s configured defaults apply.
- Seed the new task with the canonical root and instructions to read
handoff.md plus all mandatory project rules, verify location and repository state, and continue from the exact next action.
- Once creation succeeds, stop project work in the old task. Never let both tasks edit or build concurrently.
If task creation is unavailable, finish the handoff and clearly tell the user automatic rollover could not be dispatched. Do not substitute context compaction or create a projectless task.
Verification required in the replacement task
Before any edit, dependency operation, Git mutation, test, or build, the replacement task must:
- Resolve its working directory.
- Resolve the Git top-level when applicable.
- Confirm both match the canonical root recorded in
handoff.md using the platform’s canonical path semantics.
- Inspect its branch and working-tree status and reconcile them with the handoff.
If the root differs, stop immediately and report the mismatch. Do not create directories, clone, fetch, restore dependencies, build, or repair the location automatically.
For every shell command, set the working directory explicitly to the verified root or a deliberate descendant. Keep project files, generated artifacts, dependencies, tests, and builds inside the verified project tree unless the project already has an explicit user-approved external location.