# Set up with an agent

> Paste one prompt into a coding agent to install Hansard, import your history, and connect recall, then check the result.

A coding agent with terminal access, such as Claude Code or Codex, can install
and set up Hansard for you. The prompt below asks for a complete local setup and
says what to leave off. The agent follows the setup guide that ships with the
npm package, so it runs the same checks as `hansard init`.

## Copy the prompt

```text
Set up Hansard on this machine from scratch. Hansard archives my conversations with coding agents into a local, searchable history. Assume nothing is installed yet.

1. Check for Node.js 20 or newer with `node --version`. If it is missing or older, install the current LTS release with the package manager this machine already uses (Homebrew, winget, apt, or nvm). Ask before any step that needs administrator rights.
2. Install the CLI with `npm install -g hansard` and confirm `hansard --version`. If the command is not found, put npm's global bin directory on PATH instead of installing a second copy.
3. Read the setup guide at `hansard/skills/setup/SKILL.md` inside the directory printed by `npm root -g`, and follow it for everything below.
4. Run the read-only preview, `hansard init --dry-run`, and summarize the detected sources, their sizes, and the free disk space.
5. Use local storage and import all available history, not only recent sessions, from every detected local source, as long as the preview shows enough free space. If it does not, stop and show me the numbers. Watch the same sources for new sessions, start the watcher with login startup, install recall for the supported agents already on this machine, and enable same-project agent collaboration. Follow the import run and report any source that failed. If it is still running when everything else is done, say it is in progress rather than finished.
6. On macOS or Windows, run `hansard app` to install and open the Hansard app. Elsewhere, or if the app is unavailable, open the browser viewer with `hansard web`.
7. Do not run sources that need my action; list them for me instead. For ChatGPT and Claude.ai, tell me how to request a data export and the import command to run when the file arrives. For cloud agents I appear to use, such as Codex cloud, Claude Code cloud, Devin, Jules, or Cursor cloud agents, give me the import command for each.
8. Verify with `hansard status` and `hansard doctor`. Then tell me the archive location, how many conversations came from each source, which agents have recall and need a restart to load it, and whether the watcher starts at login.

Keep remote sync, sharing, telemetry, CLI usage tracking, and agent access to memories off unless they are already configured. If Hansard is already installed, keep the existing archive and settings and only fill in what is missing. Ask me only when a choice is missing or something blocks progress.
```

## What the agent does

1. **Checks Node.js.** If Node.js 20 or newer is missing, the agent installs the
   current LTS release with the package manager your machine already uses, such
   as Homebrew, winget, apt, or nvm. It asks before any step that needs
   administrator rights.
2. **Installs the CLI** with `npm install -g hansard` and confirms that the
   `hansard` command works. If the command is not found, it fixes your `PATH`
   instead of installing a second copy.
3. **Reads the setup guide** inside the installed package and follows it for
   the remaining steps.
4. **Previews setup** with `hansard init --dry-run`, then summarizes the sources
   it found, their sizes, and your free disk space. The preview changes nothing.
5. **Creates a local archive** and imports all available history from every
   local source it detected, as long as there is enough free space. If there is
   not, it stops and shows you the numbers.
6. **Keeps the archive current.** It watches the same sources for new
   conversations, starts the watcher, and turns on login startup.
7. **Connects your agents.** It installs recall for the supported agents already
   on your machine. It also turns on messaging and helper agents between
   sessions in the same project.
8. **Opens Hansard.** On macOS it runs `hansard app` to install and open the Mac
   app. Elsewhere, or when the app is not available, it runs `hansard web`.
9. **Lists what needs you.** It does not import sources that need your action.
   For ChatGPT and Claude.ai, it explains how to request a data export and gives
   the import command to run when the file arrives. For cloud agents you appear
   to use, such as Codex cloud, Claude Code cloud, Devin, Jules, or Cursor cloud
   agents, it gives the import command for each.
10. **Verifies and reports.** It runs `hansard status` and `hansard doctor`,
    then tells you the archive location, how many conversations came from each
    source, which agents have recall and need a restart, and whether the
    watcher starts at login. If an import is still running, it says so instead
    of reporting it finished.

The prompt keeps remote sync, sharing, telemetry, plan usage tracking, and agent
access to memories off unless they are already configured. If Hansard is
already installed, the agent keeps your archive and settings and fills in only
what is missing. It asks you questions only when a choice is missing or
something blocks progress.

## Change the prompt before you send it

The agent treats the prompt as your instructions, so edit its text to change a
choice.

| To                            | Change the prompt                                                                                                                             |
| ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| Import recent history only    | Replace "import all available history, not only recent sessions" with "import the last 90 days".                                              |
| Skip a source                 | Add a sentence such as "Do not import Cursor history."                                                                                        |
| Store the archive elsewhere   | Add a sentence such as "Store the archive in /home/user/hansard-data."                                                                        |
| Skip login startup            | Replace "start the watcher with login startup" with "start the watcher without login startup".                                                |
| Leave agent collaboration off | Replace "and enable same-project agent collaboration" with "and leave agent collaboration off".                                               |
| Skip the Mac app              | Delete step 6.                                                                                                                                |
| Let agents read your memories | Replace "CLI usage tracking, and agent access to memories" with "and CLI usage tracking", then add "Give recall access to archived memories." |
| Set up sync                   | Add a sentence that names the destination, such as "Set up Personal Sync to my S3 bucket."                                                    |

## Check the result

When the agent finishes:

1. Restart any agent that was open during setup, including the one that ran it,
   so it loads recall.
2. Run `hansard import status` to see whether the import finished.
   `hansard import follow` shows progress while it runs.
3. Run `hansard status` to see the watcher state and the number of conversations
   from each source.
4. Open the app, and search for a conversation you remember.
5. In a restarted agent, ask it to recall that conversation. In Claude Code,
   type `/recall` followed by a few words about it.

If a source failed or a check shows a warning, run `hansard doctor`. It names a
command for each warning. See also [Troubleshooting](https://www.hansard.dev/reference/troubleshooting/).

## Change choices later

| To change                                                 | Run                                       |
| --------------------------------------------------------- | ----------------------------------------- |
| Sources to import and watch                               | `hansard config sources edit`             |
| Login startup, plan usage tracking, and other preferences | `hansard config setup`                    |
| Recall in another agent                                   | `hansard integrations add-to codex`       |
| Agent messaging                                           | `hansard peers setup off`                 |
| Helper agents                                             | `hansard agents setup off`                |
| Older history                                             | `hansard import --source all --since all` |

Next, follow the [Quickstart](https://www.hansard.dev/getting-started/quickstart/) to find and open a conversation.
