Skip to content

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.

Terminal window
hansard status
hansard doctor
hansard index status
hansard watcher status

status 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.

Re-read provider source history when importer semantics changed or sessions are missing.

Terminal window
hansard import --source cursor --since all

Running 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.

Restart the background process after configuration or runtime changes:

Terminal window
hansard watcher restart
hansard watcher logs --follow

Run a provider-memory backup outside the automatic watcher schedule:

Terminal window
hansard memory backup

Unchanged memory content updates its check time without creating a duplicate snapshot.

Export the normalized five-file bundle and attachments:

Terminal window
hansard export <session-id> --out ./session-export

Include preserved raw files only when the destination can protect unredacted provider data:

Terminal window
hansard export <session-id> \
--out ./session-export-with-raw \
--include-raw

When hansard doctor reports that original source files have aged out, preview individual files that can be restored from raw preservation:

Terminal window
hansard restore-sources claude --dry-run

The 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:

Terminal window
hansard restore-sources claude
hansard import --source claude --since all

Claude Code has a dedicated backup repair with explicit write confirmation:

Terminal window
hansard repair claude-code-backups --dry-run
hansard repair claude-code-backups --yes
hansard import --source claude --since all

For preserved ChatGPT or Claude.ai exports, restore-sources lists the newest raw exports and the explicit commands needed to import them again.

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.

  1. Review health and verify that the configured original sources still exist.

  2. Preview the exact update scope.

    Terminal window
    hansard update --dry-run --since all
  3. Restore any provider files that exist only in raw backups.

  4. Run the refresh.

    Terminal window
    hansard update --yes --since all
  5. Verify the result.

    Terminal window
    hansard doctor
    hansard 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.

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.