Skip to main content
When a Native task stops because of a crashed session, dropped connection, reboot, accidental branch switch, or interrupted Archive, preserve the current state first: do not delete state files and do not recreate a change with the same name. For day-to-day recovery, return to the Agent chat in the original workspace and describe what happened (for example, type /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 in comet-state.yaml inside the repository and synced alongside brief.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:
  1. 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.
  2. 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.
  3. 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 unknown action 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.
For the underlying protocol, see SDK failure recovery and unknown results.

Recovering from Builder failures and Verifier errors

1. Builder fails after partial edits

When a Builder edits part of the codebase and submits failed 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 and comet-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:
  1. Stop advancing the task; if any action is still running, wait for it to finish or verify its outcome.
  2. 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.yaml if you configured a custom artifact root.
On the new device (or in a checkout missing the local Run):
  1. 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”).
  2. 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.
  3. The Runtime restores the stage, confirmed Shape, approvals, and history without redoing completed Shape or Build work. The Agent then checks for any unknown actions 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. If git pull produces merge conflicts or two conflicting versions of the same state version exist, resolve the Git conflict manually first—do not hand-edit comet-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:
The transfer bundle generates a manifest with SHA-256 hashes for all tracked files, untracked files, Git bundles, patches, and checkpoints. On import, Comet verifies the target branch, baseline commit, and every file hash, and rejects path traversal or symbolic links. Any Builder that was still running at export time is automatically marked 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 running or unknown actions, 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:
If power fails or a process exits mid-archive, ask the Agent to run diagnostics first, then recover safely based on where it stopped:

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.md is 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-message or --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.
Note: 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:
The mutating recovery and repair commands below are normally run by the Agent in the background and are listed for offline terminal troubleshooting:

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:
The Runtime validates 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.
Continue reading: Task progress and interruption recovery, Native Runtime protection and recovery, and Parallel changes and conflict control.
Last modified on December 1, 2026