Skip to content

CLI Reference

nathan nelson edited this page Jul 11, 2026 · 3 revisions

CLI Reference

Longhand's commands, each with a one-line purpose. Current as of v0.13.0 — run longhand --help for the always-true list.

Setup & diagnostics

longhand setup

One-shot orchestrator: ingest + analyze + install hooks + register MCP + doctor. Run once after install.

longhand doctor

Verify installation. Checks database, hooks, MCP registration, index health. First thing to run when something isn't working.


Ingest & analyze

longhand ingest [path]

Discover and parse Claude Code JSONL files into SQLite + ChromaDB. Incremental by default.

longhand reconcile [--fix]

Reconcile on-disk transcripts against the sessions table. Prints a bucket summary (fully indexed, partially indexed, null-project, oversize-skipped, missing). With --fix, re-ingests what's missing using current project-inference logic — useful any time you suspect a hook failure left gaps (the doctor freshness and hook-error rows will tell you). Idempotent; safe to run any time.

longhand analyze [--all]

Re-run extractors and analysis on existing sessions. Use --all after upgrading to re-process historical data with new logic.


Browse & search

longhand sessions

List ingested sessions with event and edit counts.

longhand projects

List inferred projects with categories.

longhand search <query>

Semantic search across all events. Accepts filters for session, project, tool, file, event_type.

longhand stats

Storage footprint and indexing stats.


Session inspection

longhand timeline <session-id>

Chronological view of a session. Supports --offset, --tail, pagination.

longhand context <session-id>

Get surrounding context for a specific event.

longhand diff <event-id>

Show before/after diff for a single edit event.


Recall & narrative

longhand recall "<question>"

Proactive fuzzy recall. Time parsing + project match + episode search. The command you'll use most.

longhand status — the single resume command (git-status shape)

Three modes, plus --json on all of them:

  • bare status — recent-work digest: sessions, outcomes, projects, first asks (--days N, -p <project>, --limit N)
  • status <project-name> — where did we leave off on X. Git-aware.
  • status --session <session-id> — the tail of one session so you can pick up where you left off (--events N)

Deprecated resume commands (removed at v1.0)

longhand recap → bare status · longhand continue <id>status --session <id> · longhand patternslonghand recall "<topic>". All three still run through 0.x and print a pointer to their replacement.

longhand history <file>

Every edit to a file across all sessions, chronologically.

longhand replay <session-id> <file>

Reconstruct exact file state at a point in a past session.

longhand git-log [session-id]

Extract git operations (commits, pushes, checkouts) from one or all sessions.

longhand export <session-id | latest-fix>

Export a session or episode to a standalone markdown file.


Hooks & integrations

longhand hook install | uninstall

Wire the SessionEnd auto-ingest hook into ~/.claude/settings.json.

longhand prompt-hook install | uninstall

Wire the UserPromptSubmit auto-injection hook.

longhand mcp install | uninstall

Register Longhand's MCP server with Claude Code / Claude Desktop.

longhand config

View and tune hook behavior — relevance threshold, injection size, etc. See Configuration.

Clone this wiki locally