# Goose

> Import Goose CLI, desktop, and API sessions, tools, reasoning, and usage.

Goose stores local CLI, desktop, and API conversations in a shared SQLite
session database. Hansard also reads Goose's older JSONL session files.

## Source IDs

| Source  | Use it for                                                       |
| ------- | ---------------------------------------------------------------- |
| `goose` | Local Goose sessions, scheduled runs, and linked child sessions. |

## How the import works

Hansard reads `sessions/sessions.db` under Goose's data directory, normally
`~/.local/share/goose` on macOS and Linux, or `%APPDATA%/Block/goose/data` on
Windows. It also checks the historical macOS application-support directory.
An absolute `GOOSE_PATH_ROOT` selects `<root>/data/sessions`; relative values
are ignored, matching Goose. `HANSARD_GOOSE_DIR` selects session directories
and `HANSARD_GOOSE_DB` selects databases; both accept path-separated lists.

A consistent SQLite snapshot includes committed write-ahead-log changes and
is preserved in the raw archive. Each session has its own fingerprint, so
continuing one conversation updates it without reimporting unrelated sessions.
For migrated histories, SQLite takes precedence over same-ID JSONL files.
The shared store does not reliably identify which interface created a session.

## Import and keep current

**Import now**

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

**Keep current**

**Automatic** source selection includes `goose`. For a **Custom** list:

```sh
hansard config sources enable goose
hansard watcher restart
```

## Review the import in the app

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

- Prompts, replies, recorded reasoning, tool arguments and results, and file edits.
- Embedded attachments, MCP resources, tool errors, and extension identity.
- Session titles, working folders, timestamps, models, recorded settings, and child links.
- Per-message requested and resolved model metadata, separately from response
  models recorded by the usage ledger. The current session model configuration
  does not relabel earlier messages. Ledger rows without message identifiers
  are not assigned to particular replies by timestamp alone.
- Cumulative input, output, and cache-token totals. Usage ledgers include compacted
  requests; per-model splits are used when the ledger accounts for the full total.
- Reported costs and their distinction between provider-reported and estimated values.
- Recipes, extension state, and auxiliary database records in the raw snapshot.
- Global `.goosehints` and `AGENTS.md`, project `.goosehints`, and Goose memory
  files through `hansard memory backup`. The bundled memory extension uses its
  native config directory independently of `GOOSE_PATH_ROOT`. An explicit
  `GOOSE_MOIM_MESSAGE_FILE` is also backed up.

## Known limitations

- CLI, desktop, and API sessions retain the common Goose identity. Hansard does
  not invent separate interface labels when the store omits them.
- Scheduled and hidden sessions use the SDK accounting rules: active delegated
  work can enter headline accounting, while one-shot jobs appear in the jobs
  split. Neither contributes human turns or conversation-depth samples.
- Session totals cover only that session; child usage is counted separately.
  Older stores can lack usage, cache splits, or request-level model attribution.
  Latest-context counters are never substituted for cumulative usage.
- Message-level usage stays in provider metadata. Accounting uses the ledger or
  cumulative session totals, which remain complete after context compaction.
  Explicit zero counters remain in session metadata; missing counters remain
  unknown. A local synthetic endpoint can supply these values, so their presence
  alone does not establish hosted billing or metering.
- Unknown content blocks are counted in session metadata. Malformed sessions
  are reported without replacing a valid archive. Imports allow at most
  250,000 sessions or rows per session and 128 MB of message content per session.
- Remote resource links are retained without fetching their contents. Config
  files, credentials, caches, and runtime logs are not conversation sources.
- Custom hint filenames and referenced hint files are not evaluated. Shared
  project `AGENTS.md` files use the regular project-instruction backup.

## Refresh an existing archive

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

Reimport after upgrading the Goose parser to refresh model attribution and
unknown-versus-zero usage metadata. Changes to scheduled-session accounting
rules apply at read time without a reimport.
