# Recover or continue a local task

> Resume safely after chat creation, worktree setup, provider, turn, connection, or checkout failures.

Canonical URL: https://docs.zuse.sh/how-to/local-recover-task



## Goal [#goal]

Continue a local task from its last durable state without repeating work or discarding recoverable changes.

## Applicability [#applicability]

Use this workflow in the **desktop app**. The exact ability to resume an external provider thread depends on the provider, but the Zuse chat timeline, queued messages, workspace, and Git state remain the first places to recover context.

## Prerequisites [#prerequisites]

* Keep the affected chat open when possible.
* Do not delete its worktree or reset its branch while diagnosing the failure.
* Note the visible failure layer: chat creation, setup, provider authentication, turn, connection, terminal, or directory.

## Steps [#steps]

1. Reselect the existing chat instead of creating a replacement immediately. Confirm its messages, selected session, workspace indicator, and **Changes** state.
2. Identify where progress stopped:
   * A chat-creation card with **Retry** means the project or chat did not finish being created.
   * **Environment setup failed** means the worktree exists but its setup command failed.
   * **Authentication required**, **Sign in**, or **Open Provider Settings** means the provider session needs credentials.
   * A provider error with **Retry** means the most recent user turn can be sent again.
   * **Reconnecting** with an attempt counter means Zuse is still trying to restore the provider connection.
   * A missing-directory warning means the selected checkout is no longer available at its recorded path.
3. Use the recovery action for that layer:
   * Choose **Retry** on failed chat creation.
   * Fix the setup output and choose **Rerun setup**.
   * Complete provider sign-in, then return to the same chat.
   * Let automatic reconnection finish; after the final attempt, choose **Retry** if it is offered.
   * For a generic provider failure, choose **Retry** once. Check the timeline before retrying again so a completed side effect is not duplicated.
4. Inspect **Changes** and the terminal before sending a replacement instruction. Files or commits may have been created even when the final response failed.
5. Continue with a short, state-aware instruction such as: “Read the current diff and test output, summarize what already completed, then continue from the first failing check.”
6. Review queued follow-up messages. Zuse stores queued items with the session and sends them in order; remove or reorder any instruction that is stale after recovery.

Hiding the terminal pane does not end its shell. Return to the same chat to reconnect to its terminal before starting a second process unnecessarily.

## Verify recovery [#verify-recovery]

1. Confirm the workspace indicator still points to the intended checkout.
2. Run:

```sh
git status --short
git log -3 --oneline
```

3. Compare the current files and commits with the last successful timeline message.
4. Confirm only one provider turn is active and queued follow-ups still match the task.
5. Rerun the last relevant test or verification command before accepting the continuation.

## Troubleshooting and recovery limits [#troubleshooting-and-recovery-limits]

* **Retry would duplicate an external action:** inspect Git, the pull request, and other affected systems first. If the action already succeeded, ask the agent to continue from that result instead of replaying it.
* **Provider sign-in succeeds but the old thread cannot resume:** keep the same Zuse chat, start a usable session if needed, and provide a concise handoff based on the durable timeline and current diff.
* **The terminal looks empty after returning:** reselect the chat and terminal. If its process ended, use the preserved output and start only the necessary command again.
* **The worktree directory was deleted:** recover committed work from its branch or remote. Uncommitted files from a deleted checkout are outside Zuse's recovery boundary.
* **The queue contains obsolete instructions:** pause or edit the queue before resuming so stale messages are not sent after the recovered turn.
* **Failures continue across layers:** export the relevant error, collect [diagnostics](/reference/diagnostics.md), and preserve the chat and checkout until the cause is understood.

Return to [parallel worktrees](/how-to/local-parallel-worktrees.md) for a clean replacement workspace, or continue the existing branch through [pull-request completion](/how-to/local-complete-pull-request.md).
