# Jules

> Import Jules sessions from the Jules API. Jules keeps no local history, so the import runs when you ask for it or turn it on in Settings.

Jules does not save conversations on your machine, so Hansard reads them from
the Jules API. Each import reads both active and archived sessions.

## Source IDs

| Source  | Use it for                                                                                                                |
| ------- | ------------------------------------------------------------------------------------------------------------------------- |
| `jules` | Jules sessions, read from the Jules API. Runs when you ask for it or turn it on in **Settings → Imports → Cloud agents**. |

## How the import works

`hansard import jules` sends read-only requests to the Jules API using your
Jules API key. It lists your active and archived sessions, then reads each
session's first prompt and its activity stream. Your messages and the agent's
replies become turns. Plans, approvals, progress updates, and status changes
appear as context in the conversation. Shell commands become tool calls with
their exit codes, and change sets become file edits with their diffs.

The repository comes from the source attached to the Jules task, and any media
the API returns is saved as attachments. The Jules API does not report model
names, token usage, or cost, so those fields stay empty. Run the command again
to update the sessions you already imported and add any new ones, or turn on
**Jules** in **Settings → Imports → Cloud agents** so the watcher refreshes it
every six hours.

## Import and keep current

**Import now**

```sh
hansard import jules --since all
hansard index rebuild
```

Set `JULES_API_KEY` or `jules.apiKey` in Hansard's config. Without a key, the
import prints setup instructions instead of failing. Hansard never stores the
key in the archive.

**Keep current**

Enable **Jules** in **Settings → Imports → Cloud agents** for automatic
refreshes every six hours. For an immediate refresh, run:

```sh
hansard import jules --since 30d
```

## Review the import in the app

1. When the import finishes, open **Conversations** and select **Filter & sort**.
2. Set **Source** to **Jules** 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.

## What Hansard preserves

- User and agent messages, plans, approvals, progress updates, and final
  states.
- Shell commands with their exit codes, and change sets as file edits with
  their diffs.
- Media, stored as attachments.
- The repository from the session's source.

## Known limitations

- Jules reports no model and no token or cost usage. Sessions have no model or
  cost unless you set `jules.modelHint`, which Hansard records as a model you
  declared.
- A session with no repository is grouped under `jules/uncategorized`.
- Each import is a snapshot. The watcher keeps Jules current only after you
  turn it on in **Settings → Imports → Cloud agents**.
- Session pages have no guaranteed time order. Hansard follows continuation
  pages even when a page is empty or contains only older sessions.
- An activity page or item limit stops publication of that session. The
  previous complete archive and successful import checkpoint remain intact.
- Preserved API responses do not yet support offline raw replay.

## Refresh an existing archive

```sh
hansard import jules --since all
hansard index rebuild
```
