Maintenance and recovery
Most Hansard maintenance can refresh one derived layer without rebuilding the entire archive. Start with diagnostics, then choose the narrowest command that matches the stale data.
Routine checks
Section titled “Routine checks”hansard statushansard doctorhansard index statushansard watcher statusstatus reports active paths, watcher state, session counts, index state, sync,
and recent writes. doctor checks required and recommended system tools,
parser-version drift, missing original sources, search state, autostart, source
coverage, and remote sync.
Use --json with status or doctor for machine-readable diagnostics.
Choose the right refresh
Section titled “Choose the right refresh”Re-read provider source history when importer semantics changed or sessions are missing.
hansard import --source cursor --since allRe-derive viewer payloads and compressed view pages from archived transcript and event files. Provider source history is not read.
hansard rebuildhansard rebuild --provider cursor --since 90dhansard rebuild --force --since allRecreate local indexes used by history, recall, memories, and viewer lists.
hansard index rebuildRunning rebuild cannot apply a new provider parser because it starts from the
normalized transcript and events already in the archive. Conversely, a healthy
archive does not need a source reimport merely because its search index is
stale.
Maintain the watcher and memories
Section titled “Maintain the watcher and memories”Restart the background process after configuration or runtime changes:
hansard watcher restarthansard watcher logs --followRun a provider-memory backup outside the automatic watcher schedule:
hansard memory backupUnchanged memory content updates its check time without creating a duplicate snapshot.
Preserve a session before repair
Section titled “Preserve a session before repair”Export the normalized five-file bundle and attachments:
hansard export <session-id> --out ./session-exportInclude preserved raw files only when the destination can protect unredacted provider data:
hansard export <session-id> \ --out ./session-export-with-raw \ --include-rawRecover missing provider files
Section titled “Recover missing provider files”When hansard doctor reports that original source files have aged out, preview
individual files that can be restored from raw preservation:
hansard restore-sources claude --dry-runThe restore command writes only missing individual files to their recorded original paths. It never overwrites existing files and does not restore shared SQLite stores. Follow a successful restore with a complete provider import:
hansard restore-sources claudehansard import --source claude --since allClaude Code has a dedicated backup repair with explicit write confirmation:
hansard repair claude-code-backups --dry-runhansard repair claude-code-backups --yeshansard import --source claude --since allFor preserved ChatGPT or Claude.ai exports, restore-sources lists the newest
raw exports and the explicit commands needed to import them again.
Full refresh after an upgrade
Section titled “Full refresh after an upgrade”hansard update is the destructive local refresh path. It clears local
agent-session archive/index data, import fingerprints, cache/spool state, and
local sync bookkeeping before reimporting configured sources. It does not
delete remote objects or original provider histories.
-
Review health and verify that the configured original sources still exist.
-
Preview the exact update scope.
Terminal window hansard update --dry-run --since all -
Restore any provider files that exist only in raw backups.
-
Run the refresh.
Terminal window hansard update --yes --since all -
Verify the result.
Terminal window hansard doctorhansard status
Update keeps configuration, redaction rules, web-account labels, manually
imported web-chat archives, unavailable-source archives, original provider
histories, and recall integrations. Use --sources <a,b,c> to override the
configured sources for that refresh, --no-index to skip index rebuilding, or
--no-restart to leave a previously running watcher stopped.
Reset, delete, and uninstall
Section titled “Reset, delete, and uninstall”These commands have distinct scopes:
| Command | Effect |
|---|---|
hansard delete <session-id> |
Removes one archived copy; the provider history is untouched. |
hansard reset --dry-run |
Previews removal of Hansard config, state, logs, indexes, reveal cache, and local archive objects. |
hansard reset --yes |
Performs that local reset for fresh setup. Original provider histories and recall integration files remain. |
hansard uninstall --keep-data |
Stops the watcher and disables login startup while retaining archive and configuration data. |
hansard uninstall |
Also removes local Hansard data after confirmation; integration files are listed for manual cleanup. |
Prefer an exported session, a narrow rebuild, or a source-specific reimport before using reset.