/comet continue or say “Check where that task stopped without editing code first”). The Agent runs read-only diagnostics in the background, verifies the current stage, pending actions, and blockers, and tells you how to proceed—you do not need to memorize or type long recovery commands yourself.
Native recovers reliably across interruptions because of its two-layer persistence design:
- Complete local Run record (
Run): Stored in the Comet data directory under your home directory and isolated per workspace. It records every action claim, submission receipt, pending confirmation, and archive step. - Git-synced recovery checkpoint (
run_checkpoint): Stored incomet-state.yamlinside the repository and synced alongsidebrief.md, target Specs, and code. Even if you switch machines or clear the local data directory, you can restore the original task from the repository checkpoint without leaking local session tokens or carrying over in-flight actions.
Quick recovery lookup by symptom
Match your situation in the table below to see what to tell the Agent in chat and what Comet handles in the background.Handling running or unknown actions
When diagnostics report a running or unknown action, external work was dispatched and the Runtime has not yet received a confirmed outcome.
Native does not rely on OS PIDs or process trees to judge whether a task is alive, nor does it kill processes by historical PID or automatically rerun commands. PIDs can be reused after a reboot or container rebuild, and killing a process cannot undo half-written files or already-sent remote requests.
In these cases, the Agent works through three steps with you:
- Check the original platform session: Inspect the Agent platform where the task was dispatched to see whether the session or subtask is still running. If it is, keep waiting instead of reclaiming or dispatching a duplicate.
- Verify actual side effects: If the session has exited, check
git status, modified files, test logs, and any remote commits, pushed branches, or pull requests. - Advance based on verified facts:
- Confirmed outcome: Have the original claimant report the result using its original claim identity (submitting the same result again is idempotent and will not double-advance the Run).
- Sole
unknownaction in archive, delivery, or cleanup: After confirming the original process has stopped, use the archive recovery path (see Archive transaction recovery below). - Outcome cannot be confirmed: Preserve the workspace, note the missing evidence, and wait for manual verification rather than replaying operations with potential external side effects.
Recovering from Builder failures and Verifier errors
1. Builder fails after partial edits
When a Builder edits part of the codebase and submitsfailed due to an error, environment issue, or interruption, the Runtime preserves both the workspace code and the failure record. Do not discard the task to start over, and do not reset state manually.
The Agent shows you which files changed, why the Builder failed, and the risk of continuing. Choose one of two paths in chat:
- Continue from existing edits: Tell the Agent you reviewed the changes and want to finish from the current code. In the background, the Agent submits the continue decision with the current proposal hash and state version. The Runtime creates a new Builder task tied to the original failure record in the same workspace, then runs checks and verification after completion.
- Revise requirements or narrow scope: If the failure reveals an issue with the plan or acceptance criteria, describe the requirement adjustments in chat. The Agent returns the change to Shape for reconfirmation.
2. Verifier errors, blockers, or failed verification
Missing local Run and cross-device recovery
Complete local Runs are stored in the Comet data directory under your home directory and are never committed to Git. If you switch computers, re-clone the repository, or clear local caches, the repository still holds the change artifacts andcomet-state.yaml, allowing you to restore progress from the checkpoint.
When writing run_checkpoint, the Runtime one-way redacts local session tokens, downgrades in-flight actions to unknown, and attaches tamper-evident hashes and history checks so cross-device recovery never leaks credentials or replays unfinished work. See Task progress and interruption recovery for details.
Standard steps for switching devices
On the old device:- Stop advancing the task; if any action is still running, wait for it to finish or verify its outcome.
- Commit and push the following to the remote branch:
- Current code changes and the change branch;
comet-state.yaml,brief.md, target Specs, and referenced artifacts under the change directory;.comet/config.yamlif you configured a custom artifact root.
- Pull the repository, check out the branch, and tell the Agent in chat to continue the change (for example, “Continue
<change-name>and check its status first”). - The Agent runs read-only diagnostics, confirms that the local Run is missing and the repository checkpoint is valid, and—after your confirmation—restores the original Run from
run_checkpoint. - The Runtime restores the stage, confirmed Shape, approvals, and history without redoing completed Shape or Build work. The Agent then checks for any
unknownactions left unreported on the old device and reruns only checks that are invalid or missing on the new machine.
Code that was never committed to Git cannot be restored from state files alone. Ifgit pullproduces merge conflicts or two conflicting versions of the same state version exist, resolve the Git conflict manually first—do not hand-editcomet-state.yaml.
Transfer in-progress Supervisor subtasks
If a Supervisor Change has already provisioned its integration worktree and child worktrees and is currently in Child Build (before final parent Verify, integration, or parent repair), and you need to move all branches and uncommitted work to another machine or local checkout, run the transfer commands in your terminal. This is one of the few operations meant to be run directly in the terminal:unknown on import and must be reconciled before continuing.
Workspace and branch mismatch recovery
To prevent cross-directory mistakes, ordinary status checks and diagnostics inspect only the current workspace and do not automatically scan every Git worktree on your machine.- Cannot find a worktree change from the main directory: Switch your terminal or Agent to that change’s worktree directory before continuing. Do not create a duplicate change with the same name in the main directory.
- Switched to the wrong local branch:
- If the branch switch was accidental, switch back to the originally bound branch.
- If you intentionally want to take over the same idle Run on the current branch, tell the Agent “Take over this task on the current branch.” After verifying there are no
runningorunknownactions, the Agent performs an explicit workspace rebind in the background while preserving existing edits and approvals. Rebinding is rejected if any action has an unverified outcome.
Recovering interrupted Archive, delivery, and cleanup
The Native SDK archive pipeline runs in a fixed sequence:Archive transaction recovery
During archive recovery, the Runtime verifies on-disk evidence step by step instead of blindly replaying operations:- Recovering parent delivery (Supervisor only): Marks the original action complete only if the target branch points to the exact verified integration commit. If the target branch has not advanced or has diverged, recovery refuses without re-running a fast-forward merge.
- Recovering Spec application and archive finalization: Verifies the original Run, transaction log, Spec change records, directory move state, and archive receipt (if
verification.mdis missing, it can be regenerated from the saved verdict). Already-moved directories are not moved again; already-completed finalization is recorded solely from complete persisted evidence. If recovery only records or finishes archiving a previously verified candidate, the response explicitly notes that later edits were not re-verified. - Recovering temporary worktree cleanup (Supervisor only): Proceeds only when temporary child worktrees and the integration worktree are completely clean and their branches are merged into the target commit. Any uncommitted changes preserve the worktree and reject deletion.
- Legacy compatibility mode (Compat) commit or merge message rejected by project Hooks: When archiving with
--commit-messageor--merge-message, if a Git Hook rejects the message text, already-written Spec transactions and local code are preserved. Adjust the message according to the Hook output and rerun the unfinished archive or delivery step—Specs are not applied a second time.
doctor --repair does not execute SDK archive transactions. When an archive transaction is unfinished, resolve any environment issues first and then run archive recovery. Once archiving finishes, verify Git push, merge, or pull request state separately against the remote; see Archive and delivery.
When you must stop for manual intervention
comet native doctor strictly separates read-only diagnosis from explicit repair so troubleshooting never alters state unexpectedly. In the following high-risk situations, the Runtime stops and waits for manual inspection—never delete directories or edit YAML files to bypass them:
- The same change exists in both the active and archive directories;
- Configuration,
brief.md, Spec, or checkpoint files are corrupted with no trusted source; - Active and history Run ownership records conflict and cannot be reconciled automatically;
- The transaction log contradicts the files on disk.
Terminal read-only diagnostic commands (safe to run anytime)
If you want to inspect status, blockers, and diagnostic codes outside chat, run these read-only commands in the project (or target worktree) root. They do not modify any files or state:Agent background recovery and offline repair command reference
Agent background recovery and offline repair command reference
1. Common recovery and repair commands
2. Builder / Verifier recovery commands (invoked by the Agent with current protection parameters)
3. Legacy archive transaction missing original Spec Git versions (--legacy-spec-backup)
When recovering an older archive transaction that already wrote Specs, the Runtime first tries read-only hash matching against the Git index and HEAD. Only if an error explicitly reports missing Git versions for original Specs do you provide a pre-archive backup JSON (stored outside the project directory as a regular, non-symlink file) for the Agent to pass during recovery:schema, runId, transactionId, path ownership, original file hashes, and the complete candidate summary. The backup can only recover the originally verified candidate—it cannot approve new code edits or fabricate missing verification evidence.
