> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/cline/cline/llms.txt
> Use this file to discover all available pages before exploring further.

# Task history recovery

> Recover lost Cline task history using the built-in reconstruction command or manual backup restoration.

If you lose access to previous tasks after updating Cline or changing settings, you can usually recover them with the built-in recovery command. This guide explains how task history is stored and how to restore it.

<Tip>
  Most cases are resolved by running the built-in recovery command described below.
</Tip>

## Quick recovery

<Steps>
  <Step title="Open the Command Palette">
    Press `Cmd/Ctrl + Shift + P`.
  </Step>

  <Step title="Run the recovery command">
    Type **Cline: Reconstruct Task History** and select it.

    The VS Code command ID is `cline.reconstructTaskHistory`.
  </Step>

  <Step title="Confirm the action">
    A confirmation prompt will appear. Click **Yes** to proceed.
  </Step>

  <Step title="Wait for reconstruction">
    Cline scans your task folders and rebuilds the history index. This may take a moment depending on how many tasks you have.
  </Step>

  <Step title="Verify recovery">
    Check the history panel to confirm your tasks have been restored.
  </Step>
</Steps>

***

## Where Cline stores data

Cline stores task history in VS Code's `globalStorage` directory, keyed to the extension ID `saoudrizwan.claude-dev`.

### Storage paths

<Tabs>
  <Tab title="VS Code">
    ```bash theme={null}
    # macOS
    ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/

    # Windows
    %APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\

    # Linux
    ~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/
    ```

    For VS Code Insiders, replace `Code` with `Code - Insiders`.
  </Tab>

  <Tab title="JetBrains">
    ```bash theme={null}
    # macOS
    ~/Library/Application Support/JetBrains/<IDE>/globalStorage/saoudrizwan.claude-dev/

    # Windows
    %APPDATA%\JetBrains\<IDE>\globalStorage\saoudrizwan.claude-dev\

    # Linux
    ~/.config/JetBrains/<IDE>/globalStorage/saoudrizwan.claude-dev/
    ```

    Replace `<IDE>` with your IDE name, for example `IntelliJIdea2023.3`, `PyCharm2023.3`, or `WebStorm2023.3`.
  </Tab>
</Tabs>

### Directory structure

```text theme={null}
saoudrizwan.claude-dev/
├── state/
│   ├── taskHistory.json           # Main history index
│   └── taskHistory.backup.*.json  # Automatic backups
├── tasks/
│   └── <task-id>/                 # Individual task data
│       ├── api_conversation_history.json
│       ├── ui_messages.json
│       └── task_metadata.json
└── checkpoints/
    └── <workspace-hash>/          # Per-workspace checkpoint storage
        └── .git/                  # Shadow Git repository for snapshots
```

The `taskHistory.json` file is an index. The actual conversation data lives in individual folders under `tasks/`. This means the index can be rebuilt even if it becomes corrupted or out of date.

***

## How the recovery command works

The `cline.reconstructTaskHistory` command rebuilds the history index from scratch without deleting any task data:

1. Backs up the current `taskHistory.json`.
2. Scans the `tasks/` directory for all task folders.
3. Reads conversation data from each task folder.
4. Recalculates token usage and costs.
5. Writes a new `taskHistory.json`.

<Warning>
  The recovery command can only reconstruct history from task folders that still exist on disk. If the `tasks/` directory or individual task folders have been permanently deleted, the data in those folders cannot be recovered.
</Warning>

***

## Manual recovery

### Restoring from a backup

Cline automatically creates backup files in the `state/` folder. To restore from one:

<Tabs>
  <Tab title="VS Code (macOS/Linux)">
    ```bash theme={null}
    cd ~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/state/

    # List available backups
    ls taskHistory.backup.*.json

    # Restore the most recent backup
    cp taskHistory.backup.1234567890.json taskHistory.json
    ```
  </Tab>

  <Tab title="JetBrains (macOS)">
    ```bash theme={null}
    cd ~/Library/Application\ Support/JetBrains/<IDE>/globalStorage/saoudrizwan.claude-dev/state/

    # List available backups
    ls taskHistory.backup.*.json

    # Restore the most recent backup
    cp taskHistory.backup.1234567890.json taskHistory.json
    ```
  </Tab>
</Tabs>

### Migrating to a new machine

You can transfer all your Cline conversations to a new computer by copying the storage folder.

<Steps>
  <Step title="Locate your Cline data on the old machine">
    Find the `saoudrizwan.claude-dev` folder using the [storage paths above](#storage-paths).
  </Step>

  <Step title="Copy the folder">
    Copy the entire `saoudrizwan.claude-dev` folder to an external drive or transfer method of your choice.
  </Step>

  <Step title="Set up your new machine">
    Install your IDE (VS Code or JetBrains) and the Cline extension.
  </Step>

  <Step title="Close your IDE">
    Make sure the IDE is fully closed before proceeding.
  </Step>

  <Step title="Paste the data folder">
    Place the copied `saoudrizwan.claude-dev` folder at the same storage path on your new machine.
  </Step>

  <Step title="Launch and verify">
    Open your IDE. Your task history should appear in Cline.
  </Step>
</Steps>

<Info>
  Task data uses the same format across operating systems. Cross-platform migration (for example, Windows to macOS) works without any additional steps.
</Info>

***

## Common problems

<AccordionGroup>
  <Accordion title="History is empty after a VS Code update">
    Run **Cline: Reconstruct Task History** from the Command Palette. If that doesn't work, check the `state/` folder for a backup file and restore it manually.
  </Accordion>

  <Accordion title="History lost after reinstalling VS Code">
    VS Code typically preserves extension data when uninstalled. Reinstall Cline and run the recovery command. If the data is gone, check whether you have a backup from before the reinstall.
  </Accordion>

  <Accordion title="&#x22;No tasks found&#x22; error">
    This error occurs when the `tasks/` folder is empty or missing. Common causes:

    * VS Code extension data was completely cleared.
    * You are using VS Code Insiders but looking in the standard VS Code storage path (or vice versa).
    * The `tasks/` folder was manually deleted.

    Verify the correct storage path for your IDE and confirm the folder exists.
  </Accordion>

  <Accordion title="Recovery ran but some tasks are still missing">
    Task folders that are corrupted or unreadable are skipped during reconstruction. The command reports how many tasks were recovered and how many were skipped. Review any error messages for details about which task folders could not be read.
  </Accordion>
</AccordionGroup>

***

## Getting additional help

If recovery does not resolve your issue:

* Open a [GitHub issue](https://github.com/cline/cline/issues)
* Ask in the Cline Discord community

When reporting, include:

* Your OS and IDE name and version
* Cline version
* What happened before the data loss
* Any error messages shown
* Relevant JSON files from the affected task folder (`api_conversation_history.json`, `ui_messages.json`, `task_metadata.json`)
