Repository navigation
Home
Persistent local memory for Claude Code. Every tool call, every file edit, every thinking block from every session — stored verbatim on your machine. Searchable, replayable, and recallable by fuzzy natural-language questions. Zero API calls. Zero summaries. Zero decisions made by an AI about what's worth remembering.
A few honest exceptions: transcripts over 500MB and individual lines over 50MB (or malformed) are dropped, not parsed; internal plugin/skill files (skill-injections in the file name, vercel-plugin anywhere in the path) and subagent transcripts (<session>/subagents/*.jsonl) aren't discovered as sessions at all; a handful of harness bookkeeping entry types (queue state, permission mode, UI titles — see Architecture) are skipped by design; Codex mirror records, turn bookkeeping, encrypted reasoning, and (by default) Codex's own subagent threads are skipped too; and opt-in redaction (redact.enabled) can mask secret-shaped text before it's stored — with one known gap, see Configuration → Hook configuration. Everything else is verbatim.
Everyone is solving AI memory by making the context window bigger. 1M tokens. 2M tokens. Context-infinite.
Longhand goes the other direction. The model doesn't need to carry the memory. The disk does.
Your past sessions are already on disk, written by Claude Code itself, in JSONL files that contain every event verbatim. Longhand reads those files, indexes them locally, and gives you semantic recall over your entire history without sending a token through anyone else's API.
Local. Complete. Yours.
- Getting Started — install, setup, first recall in under 5 minutes
- Codex — one archive for Claude Code and Codex: capture Codex threads, search both from either client (1.1.0+)
- MCP Tools Reference — the 13 tools Claude agents can call, with a decision tree and token budget, plus the four-tool shared server
-
Backup & Restore — opt-in: push the archive, secrets masked in the copy, to a private git repo you own;
restorerebuilds it on a new machine - CLI Reference — the 24 commands (plus 7 subcommand groups) you can run from the terminal
- Architecture — parser → storage (events, vectors, tool pairs, git ops) → analysis → recall
- Configuration — hook tuning, relevance thresholds, injection size, backup keys
- Security — trust boundaries and threat model
- Troubleshooting — hook not firing, MCP not showing up, ingest slow
- Roadmap — known gaps, planned features, help wanted
pip install longhand
longhand setup
longhand recall "that stripe webhook bug from last week"That's it. longhand setup ingests your existing Claude Code history, installs the SessionEnd and Stop hooks so new (and in-progress) sessions auto-ingest, installs the UserPromptSubmit hook for auto-context injection, installs Longhand's MCP server into Claude Desktop (and prints the one-line claude mcp add command for Claude Code — or install the Longhand plugin instead), and runs longhand doctor to verify everything wired correctly.
pip install --upgrade longhandComing from 0.5.x? v0.6.0 fixed two failure modes that could cause recall_project_status to miss real sessions: multi-project sessions were attributed to $HOME (because project inference only looked at the first-event cwd), and there was no reconciliation for transcripts whose SessionEnd hook failed silently. Run this once to replay your history with the corrected logic:
longhand reconcile --fixIdempotent. Prints a summary of drift (how many sessions were un-ingested, how many had project_id IS NULL) and, with --fix, re-ingests those buckets using the improved attribution. Typical throughput: ~1–2 sessions/sec.
Coming from 0.5.8 or earlier? Chain the upgrades — longhand reconcile --fix && longhand analyze --all. The first replays attribution; the second rebuilds episodes and embeddings with current extractors.
Coming from 0.13.x or earlier? v1.0 removed four deprecated CLI commands (recap, continue, patterns, reanalyze — use status, status --session, recall, and analyze --all instead) and six MCP tool listings (the tools themselves keep answering forever, with a [DEPRECATED] note — see MCP Tools Reference). The MCP reconcile tool also flipped its default from applying fixes to a dry run — pass fix: true explicitly now.
Use Codex too? After upgrading to 1.1.0, run longhand codex-sync (up to 50 threads per run — re-run, or use --watch, to work through a larger backlog); from then on reconcile --fix keeps them current. See Codex.
The most common question: does Longhand consume a lot of tokens when Claude uses it?
No — the tools you'll use most are capped by design. recall, get_session_timeline, search, recall_project_status, and find_commits all accept a tunable max_chars (5 of the 13 tools); list_sessions and list_projects truncate at a fixed 16,000 characters in their default modes (their project_id/match modes are uncapped). A full recall across 100+ sessions returns ~4K tokens. Reading one raw session JSONL directly costs 10–50× more. Longhand itself makes zero API calls; the only tokens consumed are the MCP payload Claude reads back. Full breakdown, per-tool caps, and tuning knobs: MCP Tools Reference → Token budget.
Current as of v1.3.2. Stable, daily-driver tested, security-audited (zero critical findings), on PyPI, available as a Claude Code plugin, and captures Codex Desktop / CLI threads into the same archive, indexing each one automatically once it goes quiet — as long as codex-sync is actually running (the scheduled reconciler, the launchd template, --watch, or a reconcile --fix; nothing finalizes in the background on its own). Validated against the author's own live store: 1,045 sessions (6 Codex), 403,365 events, 59 projects, 2,750 episodes, 9,495 segments, 5,640 git operations — 8.0 GB SQLite + 2.9 GB Chroma (measured 2026-11-22, Apple M4). Warm recall ran at a 128ms median in the 2026-09-27 benchmark. 838 unit tests passing. Since 1.3.0 the whole archive can be backed up — opt-in, after a consent screen, secrets masked in the copy — to a private git repository you own, and restored from it on a new machine.
Main repo: github.com/Wynelson94/longhand · CHANGELOG · Releases