CLI Commands

Complete reference for the claude-hindsight command-line interface.

Use claude-hindsight --help or claude-hindsight <command> --help at any time for inline help. --version / -V prints the version string.


init

Scan Claude session directories and build the SQLite index.

claude-hindsight init [OPTIONS]
OptionDefaultDescription
--dir <PATH>~/.claude/projectsRoot directory containing project subdirectories
--db <PATH>~/.local/share/claude-hindsight/index.dbPath to the SQLite database
claude-hindsight init --dir ~/work/claude-projects

reindex

Incrementally update the index with new or changed session files.

claude-hindsight reindex [OPTIONS]
OptionDefaultDescription
--dir <PATH>(from config)Override scan directory
--fullfalseDrop and rebuild the entire index

Uses file modification timestamps to skip unchanged sessions. Run this after sessions if hooks are not installed.


serve

Start the web dashboard server.

claude-hindsight serve [OPTIONS]
OptionDefaultDescription
--port <PORT>7227TCP port for the web dashboard
--host <HOST>127.0.0.1Bind address
--openfalseOpen browser automatically on start
--otel-port <PORT>7228Port for the OTLP receiver (also starts the daemon)
claude-hindsight serve --open
claude-hindsight serve --port 8080 --otel-port 8081

daemon

Run the OTLP telemetry receiver as a standalone background process.

claude-hindsight daemon [OPTIONS]
OptionDefaultDescription
--port <PORT>7228Port to listen for OTLP spans
--idle-timeout <SECS>300Exit after N seconds with no incoming spans

The daemon receives telemetry from Claude Code hooks and feeds the Activity Timeline. It starts automatically when you run serve, or you can run it standalone for always-on monitoring.

claude-hindsight daemon --port 7228

integrate

Install or manage Claude Code hooks and OTLP configuration.

claude-hindsight integrate [OPTIONS]
OptionDescription
--otelAlso install OTLP env vars and PreToolUse hook
--forceRemove existing Hindsight hooks before reinstalling
--removeRemove all Hindsight hooks and OTLP env vars
--statusPrint current hook and daemon status
--allWrite to global Claude Code settings (all users)
# Full setup (recommended)
claude-hindsight integrate --otel

# Check what's installed
claude-hindsight integrate --status

# Upgrade hooks after a Hindsight update
claude-hindsight integrate --otel --force

# Remove everything
claude-hindsight integrate --remove

list

Launch the interactive terminal UI for browsing sessions.

claude-hindsight list [OPTIONS]
OptionDefaultDescription
--project <NAME>(all)Filter to a specific project
--limit <N>50Maximum sessions to load
--errorsfalseShow only sessions with errors
--todayfalseShow only sessions from today
--with-subagentsfalseShow only sessions that spawned subagents
--last <N>Show the N most recent sessions

TUI keybindings:

KeyAction
/ kMove up
/ jMove down
EnterOpen session detail
/Filter sessions
qQuit
claude-hindsight list --errors --today
claude-hindsight list --last 10

show

Print details of a single session to stdout.

claude-hindsight show <SESSION_ID>

Prints session metadata, message count, and a text tree of tool calls.

claude-hindsight show abc12345

watch

Tail the most recently modified session file in real time.

claude-hindsight watch [OPTIONS]
OptionDefaultDescription
--session <ID>(latest)Watch a specific session by ID
--project <NAME>(all)Restrict to a project

Follows the JSONL file from the end, printing each new node as it arrives via SSE.

claude-hindsight watch
claude-hindsight watch --project my-app

Search session content from the command line.

claude-hindsight search <QUERY> [OPTIONS]
OptionDefaultDescription
--project <NAME>(all)Restrict search to a project
--limit <N>20Max results
--jsonfalseOutput as JSON
claude-hindsight search "authentication middleware" --project api-server

export

Export session data to a file.

claude-hindsight export [OPTIONS]
OptionDefaultDescription
--output <PATH>./hindsight-export.jsonOutput file path
--project <NAME>(all)Export only a specific project
--format <FMT>jsonOutput format: json or csv
claude-hindsight export --output my-sessions.json
claude-hindsight export --format csv --project my-app --output sessions.csv

clean

Remove Hindsight data files.

claude-hindsight clean [OPTIONS]
OptionDescription
--dbRemove the SQLite index only (preserves original JSONL files)
--allRemove all Hindsight data (index + config)
--yesSkip confirmation prompt
# Reset the index (e.g. after a schema migration)
claude-hindsight clean --db

# Nuclear option — remove everything
claude-hindsight clean --all --yes

Note: clean never touches the original JSONL files in ~/.claude/projects/. Those belong to Claude Code.


config

Manage the configuration file.

claude-hindsight config <SUBCOMMAND>
SubcommandDescription
showPrint the current config as TOML
editOpen the config file in $EDITOR
validateCheck the config file for errors
resetOverwrite config with defaults
claude-hindsight config show
claude-hindsight config edit
claude-hindsight config validate

See Configuration for all available options.


paths

Manage the list of directories Hindsight scans for sessions.

claude-hindsight paths <SUBCOMMAND>
SubcommandDescription
listShow all configured scan paths
add <PATH>Add a directory to the scan list
remove <PATH>Remove a directory from the scan list
claude-hindsight paths list
claude-hindsight paths add ~/work/claude-projects
claude-hindsight paths remove ~/old-project

After adding a new path, run init or reindex to index its contents.