# Claude

> Import Claude Code CLI, desktop, Cowork, and Agent SDK sessions, and Claude Code cloud and Remote Control sessions on request.

Claude sessions come from several places: the Claude Code CLI, Claude Code
sessions started from the Claude desktop app, Cowork, Agent SDK jobs, and
Claude Code cloud and Remote Control sessions. Each has its own source ID, so
import the ones you use.

## Source IDs

| Source                | Use it for                                                                                                                                      |
| --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| `claude`              | Interactive Claude Code CLI sessions.                                                                                                           |
| `claude-code-desktop` | Claude Code sessions started from the Claude desktop app.                                                                                       |
| `claude-cowork`       | Cowork sessions: older local audit files and remote sessions the desktop app has cached.                                                        |
| `claude-cowork-cloud` | Account-wide tagged Cowork cloud tasks through saved Claude Code sign-ins.                                                                      |
| `claude-sdk`          | Claude Agent SDK sessions, both delegated work and one-shot jobs.                                                                               |
| `claude-cloud`        | Claude Code cloud and Remote Control sessions. Runs when you ask for it or turn it on in **Settings → Imports → Cloud agents**, and only reads. |

Claude.ai account exports have their own workflow; see
[ChatGPT, Claude.ai, and Gemini exports](https://www.hansard.dev/imports/web-exports/#claudeai).

## How the import works

For Claude Code CLI and Agent SDK sessions, Hansard reads Claude Code's JSONL
session files and groups entries by session ID. It rebuilds one ordered
conversation from user and assistant messages, thinking, tool calls and
results, settings, and token usage. Sessions started from the desktop app are
recognized from the launch details they record. Delegated SDK work and one-shot
SDK jobs stay distinguishable, and each subagent becomes its own conversation
linked to its parent instead of being merged into it. The subagents a
workflow starts join the conversation that ran the workflow as its subagent
runs. A reply whose rows repeat a partial output count is counted once, at its
final token usage.

Forks keep their own session identity and a link to their parent. Copied parent
history stays in raw evidence and does not count again in search or Stats.
Moving a session store preserves child identities. Existing archive links keep
their recorded child IDs after an importer upgrade.

Cowork works differently: Hansard imports older local audit files plus any
remote session details the Claude desktop app has already cached. The
`claude-cloud` command uses your existing Claude Code sign-in to read cloud and
Remote Control sessions. A session that ran on Anthropic's workers becomes a
**Claude Code cloud** conversation. A Remote Control session ran on your own
machine, so it stays a Claude Code conversation. When it matches a local session
by its Remote Control ID, Hansard combines their details into one conversation.
It never merges conversations only because their text looks alike. Running an
import again updates the existing conversations instead of adding copies.
Cloud records explicitly tagged as Cowork are excluded from `claude-cloud`;
sharing a sessions endpoint does not make them Claude Code conversations.

A development build of the [Hansard browser extension](https://www.hansard.dev/imports/browser-capture/)
can also read Claude Code on the web sessions from a signed-in claude.ai tab,
without a Claude Code sign-in. Turn on **Claude Code on the web** in the
extension's settings. Its captures join the same conversations as
`claude-cloud`, so either route can run first, and Cowork tasks stay with the
Cowork import. A capture whose last event page says more events follow waits
as a failed capture until **Rescan all history** in the extension reads it in
full, so Hansard never archives the conversation incomplete.

Both `claude-cloud` and the extension skip sessions that belong to other
Anthropic products, as claude.ai's Code view does: Cowork tasks, workflow
agents, warm workers that hold no conversation, and sessions tagged for other
products. A session that a saved claude.ai conversation names as its
workspace belongs to that conversation and is skipped too. The import's
warnings name the reason for each skipped session.

Run `hansard rebuild --from-raw --source-type claude-cloud-history` to rebuild
Claude Code cloud conversations from the responses earlier imports and
captures kept, without contacting Claude. The rebuild stops for review when
the kept responses disagree or no longer hold a message the archive has.

Run `hansard import claude-cowork-cloud --since all` to read retained Cowork
tasks without first opening each task in Claude Desktop. The command uses
saved Claude Code profiles and the provider's `cowork-remote` filter. Use
`--profile` to select one profile and `--full-events` to reread retained events.
Enable **Claude Cowork cloud** in **Settings → Imports → Cloud agents** for
automatic refresh every six hours. Interrupted event walks resume from their
last archived page. Desktop cache and cloud captures share the recorded task
identity and preserve fuller messages and raw snapshots.

This route covers explicitly tagged Cowork tasks. The task workspace of an
untagged unified chat arrives through the browser extension instead: when it
captures a Claude.ai conversation linked to a workspace, Hansard archives that
workspace as its own conversation, linked to the chat and separate from it.
A capture holds at most about 24 MB of workspace events. A longer workspace is
archived up to that point, and its import warning names the reason.
Both kinds appear under **Claude Cowork cloud** in the Source filter. Neither
route establishes coverage for Chrome, Office, Tag, Science, Security, or
Design projects outside Cowork tasks. Each completed Write call keeps the text
it wrote, as ordered revisions of that file, and an Artifact call links to the
latest completed write of its file. A browser capture also saves the current contents of each
file that a recorded call in the workspace names, up to 64 files and 64 MiB.
It reads only those paths, so files that no recorded call names are not
saved.
Run `hansard rebuild --from-raw --source-type claude-cowork-cloud-history` to
replay preserved cloud snapshots without contacting Claude. Conflicting event
revisions cause replay to stop for review.

## Import and keep current

**Import now**

```sh
hansard import --sources claude,claude-code-desktop,claude-cowork,claude-sdk --since all
hansard index rebuild
```

To add cloud and Remote Control sessions:

```sh
hansard import claude-cloud --since all
```

`claude-cloud` reads your Claude Code sign-in from the macOS Keychain, or from
`.credentials.json` in `~/.claude` (or `CLAUDE_CONFIG_DIR`) on Linux and WSL.
It also reads every Claude Code profile you registered with `hansard account`,
and imports a session two profiles can both see once. Add `--profile <label>`
to read one profile. It only reads from Claude and never changes your
sign-in. Cloud-only sessions are grouped under the Git repository named on
the session.

**Keep current**

With **Automatic** source selection, the watcher already includes the four
local Claude sources. With a **Custom** list, enable them. The watcher picks them up within 30 seconds:

```sh
hansard config sources enable claude,claude-code-desktop,claude-cowork,claude-sdk
```

To keep cloud sessions current, turn on **Claude Code cloud** in **Settings →
Imports → Cloud agents**. The watcher then refreshes it every six hours.
Otherwise, run the command again when you want newer cloud sessions.

## Review the import in the app

1. When the import finishes, open **Conversations** and select **Filter & sort**.
2. Set **Source** to **Claude Code CLI, Claude Code Desktop, Claude Cowork, or Claude SDK jobs** and set **Time** to the window you imported. Use **Folder** to narrow the list when you use this harness in several projects.
3. Select a conversation to check its messages, tool calls, files, commits, model, and token usage.

To keep archiving new sessions from a local harness, open **Settings → Imports**. **Automatic** follows every supported harness installed on this computer. **Custom** lets you turn individual harnesses on or off. Cloud sources and account exports never run from here; each needs its own import command. If a conversation you expect is missing after you reset the filters, run the import command on this page again with `--explain-skips` where the source supports it.

Hosted sessions appear under **Claude Code cloud**. Remote Control sessions are
labeled **Claude Code Remote Control** and stay in their Claude Code project,
or in **Claude Code (Uncategorized)** when the session recorded no workspace.

## What Hansard preserves

- Messages, thinking, tool calls and results, token usage, model fallbacks,
  notifications, permissions, modes, hooks, compaction points, and Git details.
- Full saved tool outputs, workflow files, readable tool files, and the related
  files Claude Code kept next to the session.
- Workflow scripts as raw evidence. Hansard does not execute these scripts.
- Cowork task, permission, retry, tool summary, selected folder, and attachment
  details when the desktop cache has them.
- Desktop and Cowork model settings separately from recorded reply models.
  A current setting never fills a missing reply model or replaces the model
  recorded on a tool-using reply. Per-attempt usage keeps its recorded models.
- A Remote Control label only when the session records evidence that separates
  it from an ordinary SDK job.
- A name set with `/rename` or `claude -n`, which titles the conversation over
  Claude Code's own AI title, and a rename or an agent's title in the Claude
  desktop app, which titles it over the app's generated title.

## Known limitations

- A remote Cowork session can be imported only after Claude Desktop has cached
  its details. You may need to open or revisit the conversation there first.
- Repeated Cowork cache imports retain earlier turns and raw snapshots when
  the desktop cache rolls over. Older metadata cannot replace a newer snapshot;
  omitted model and folder settings preserve earlier values, while explicit
  clears take effect. Fuller or conflicting archived replies stay preserved
  with a warning. Raw replay refuses conflicting event revisions.
- Cowork retains at most 256 MiB of source snapshots in one import. Missing or
  damaged earlier raw files, changed cache bytes during capture, or the size
  limit stop that session's update and leave its archive unchanged. Other
  sessions can continue. This cache route cannot establish account-wide history
  completeness.
- When the cache did not keep a remote attachment's contents, Hansard records
  only that the attachment existed. Cowork sessions with no selected folder are
  grouped under `claude-cowork/uncategorized`.
- One-shot SDK jobs are archived and searchable, but Stats leaves them out of
  its main totals by default.
- Sessions that contain only `/status`, `/usage`, `/exit`, or `/quit`, with no
  assistant or tool activity, are skipped.

> **Missing Cowork transcript:** Open the remote Cowork conversation in Claude Desktop and wait for it to load.
> Then run `hansard import --source claude-cowork --since all` again.

## Refresh an existing archive

```sh
hansard import --sources claude,claude-code-desktop,claude-cowork,claude-sdk --since all
hansard index rebuild
```

A reimport rereads Claude's files. `hansard rebuild` works only from files
already in the archive, so it cannot add Cowork events or Claude Code files
that were never imported.

Reimport `claude` and `claude-sdk` to recover fork identities, workflow
scripts, and workflow subagent runs that earlier parsers left out, and the
final token counts of replies that earlier parsers counted more than once:

```sh
hansard import --sources claude,claude-sdk --since all
```

The watcher already re-reads the conversations in its import window with the
current importers. A truncated CLI or SDK source cannot
replace even a short archived conversation.

To title older conversations by the names set with `/rename` or `claude -n`,
re-read them with the current importer:

```sh
hansard rebuild --stale-parsers --provider claude_code
```

Reimport `claude-code-desktop` and `claude-cowork` after upgrading to correct
earlier archives that attributed a session's current model setting to its
past replies. Replies without their own model evidence remain unattributed.
If only a partial Cowork cache is available during a parser upgrade, earlier
messages retain their parser version and the import reports the pending
refresh. Revisit the earlier history in Claude Desktop and import again.

Earlier releases archived hosted cloud sessions as Claude Code conversations.
Run the cloud import once to move them to **Claude Code cloud**. The same run
moves Remote Control sessions without a recorded workspace to
**Claude Code (Uncategorized)**:

```sh
hansard import claude-cloud --since all
```

To do the same from the responses the archive kept, without contacting Claude,
run `hansard rebuild --from-raw --source-type claude-cloud-history --since all`.

To add the files that completed Write calls recorded to earlier Cowork cloud
imports, run:

```sh
hansard import claude-cowork-cloud --since all
```

The same command refreshes recorded repository, worker-status, and other
session details even when the provider's update timestamp has not changed.
An automatically Uncategorized cloud session moves into its repository when
that information becomes available. Its conversation identity and history
remain the same.

The current configured model is kept as a session setting, separately from
the model recorded on each reply. It never fills missing reply models or
attributes token usage. Parser upgrades reread the retained event history;
matching messages refresh only when the returned event preserves their
recorded content and metadata. A local Remote Control transcript retains its
own evidence.

If the provider returns less history, earlier messages and raw evidence stay
in the archive. A warning reports messages still awaiting a parser refresh;
the source keeps its earlier parser version until those messages can refresh.
Retry the full retained event walk with:

```sh
hansard import claude-cloud --since all --full-events
```

This cannot recover events the provider no longer retains. An older cloud
metadata snapshot cannot overwrite a newer archived snapshot, and an omitted
session field keeps its previously recorded value.
