# Checkpoint and resume

A conversation may end before the engineering task does. Preserve enough project evidence that
another authorized session can understand the actual work without depending on chat history.

**In short:** Save the exact source revision, current task, changes, operation handles, verified results and
next action. On reconnect inspect the real outcome before starting another operation.

## Steps

1. Before a long command or consequential change, record what you intend to do, the owning
   task and the expected result.
2. Use [`task_start`](https://docs.cmdop.ai/reference/tools/task_start.md) for an authorized long-running command.
   Retain its returned task ID, then read its output with
   [`task_output`](https://docs.cmdop.ai/reference/tools/task_output.md). See
   [Run commands and tasks](https://docs.cmdop.ai/guides/run.md) for actual lifetime and limits.
3. At a meaningful boundary, record the machine, repository and exact source identity,
   changed paths, commands or task IDs, observed outcomes, verification, remaining blockers
   and next action in the project's own handoff location.
4. On resume, read the current project instructions and latest checkpoint. Inspect actual
   repository changes and existing task state; use
   [`tasks_list`](https://docs.cmdop.ai/reference/tools/tasks_list.md) and
   [`history_search`](https://docs.cmdop.ai/reference/tools/history_search.md) as applicable.
5. Reconcile uncertain effects at their actual destination. A disconnected client, silent
   output or missing task handle does not prove a command failed or another writer stopped.
   Do not repeat a deployment, migration or file mutation solely because its response was lost.
6. Transfer a write scope only through the existing ownership procedure after outstanding
   effects have been resolved. Use the project's current evidence, not a timer or an old chat
   message, to decide whether a handoff is safe.

## Preserve evidence safely

A private checkpoint can name real project files and task IDs; a public report should omit
sensitive operational details. Store necessary evidence in the project's approved location.
Do not include tokens, private file contents or unbounded output in a handoff.

For file changes, the [file guide](https://docs.cmdop.ai/guides/files.md) explains version-checked edits and creation
of new files. If a file has changed, read and reconcile the current version before attempting
another write.

## Check

A second session can identify what actually changed, what is still running or unknown, which
checks passed and which action is currently authorized. A snapshot containing uncommitted
work is not described as a committed revision.

## If it fails

If the outcome cannot be verified, preserve the uncertainty and stop new overlapping writes.
Ask for the missing owner decision or evidence when it is needed.

## Related

[Tasks](https://docs.cmdop.ai/concepts/tasks.md) · [Audit and history](https://docs.cmdop.ai/concepts/audit-and-history.md) ·
[Verify and deliver](https://docs.cmdop.ai/guides/workflow/testing-and-delivery.md)
