# Aider

> Import Aider Markdown conversations and preserve optional history files from your repositories.

Aider saves each conversation as a Markdown file inside the repository you
worked in. Hansard finds those files in common project folders under your home
directory.

## Source IDs

| Source  | Use it for                                                                     |
| ------- | ------------------------------------------------------------------------------ |
| `aider` | `.aider.chat.history.md` files and the Aider history files saved next to them. |

## How the import works

Hansard looks for `.aider.chat.history.md` files
in `~/Documents/GitHub`, `~/Developer`, `~/Projects`, `~/Code`, and `~/Work`, up
to five folders deep. Each `####` heading in the file starts a new prompt, and
the Markdown after it becomes the assistant's reply. The nearest Git repository
sets the project, so a conversation stays with the codebase where you ran
Aider.

The optional `.aider.llm.history` is timestamped text. Matching assistant
responses can add response-time evidence. It contains no model, request ID,
token usage, or cost. Hansard preserves `.aider.input.history` as raw evidence
without turning it into messages. Neither sidecar creates another conversation.
Repeated imports update the existing conversation and preserve the source files.
Hansard does not inspect current Git state to synthesize historical edits.

## Import and keep current

**Import now**

```sh
hansard import --source aider --since all
hansard index rebuild
```

To import history outside these folders, set `HANSARD_AIDER_ROOTS` to a
comma-separated list of paths. The launch directory never becomes an
implicit discovery root.

**Keep current**

With **Automatic** source selection, the watcher already includes `aider`.
With a **Custom** list, enable it. The watcher picks it up within 30 seconds:

```sh
hansard config sources enable aider
```

The watcher scans the common project folders listed above, not the directory
you last ran a command from.

## Review the import in the app

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

- Each `####` prompt and the Markdown response that follows it.
- The project, taken from the nearest Git repository.
- Response times from `.aider.llm.history` records that match a response.
- Tool text and commit notices already present in the Markdown history.
- Copies of the chat, LLM, and input history files.

## Known limitations

- The Markdown chat file has no exact time for each message.
- Aider's audited history files do not record model names, token usage, or cost.
- Chat start times are local wall-clock values with an unknown timezone.
- Hansard does not offer a command to resume an Aider conversation.

> **Custom history file:** If a repository keeps its chat history under a different file name, set
> `HANSARD_AIDER_CHAT_HISTORY_FILE` to that file's path.

## Refresh an existing archive

Available provider files refresh after parser updates. To import a previously
missed chat from Aider's history:

```sh
hansard import --source aider --since all
```

To rebuild from a verified archived source bundle without Aider's files:

```sh
hansard rebuild --from-raw --provider aider
```

The current parser keeps ordinary assistant headings and trailing tool output.
