Lossless AI Memory with Longhand for Claude Code
Description and use
Longhand is a local, lossless memory solution for Claude Code sessions. Instead of AI summarization, it indexes JSONL logs into SQLite and ChromaDB, providing fast semantic search, privacy, and offline capability.
Problem
AI memory tools typically summarize sessions, resulting in lossy data where specific debugging steps, reasoning traces, and failed attempts are discarded. Additionally, relying on vendor context windows creates privacy risks, vendor lock-in, and dependency on network connectivity.
Outcome
Longhand provides a lossless, offline, and private alternative to AI memory summarization. It indexes Claude Code's JSONL logs into local SQLite and ChromaDB stores, enabling fast semantic recall (~126ms) without API calls or data loss. It supports forensic replay of code states and is portable across models.
Workflow
- Install Longhand via pip:
pip install longhand - Run setup to backfill existing Claude Code history and install auto-ingest hooks:
longhand setup - Longhand automatically captures new sessions via a
SessionEndhook in Claude Code. - Query history using the MCP server tools, e.g.,
longhand recall "that webhook fix from last week" - Use specific tools like
replay_fileto reconstruct file states orget_session_timelinefor chronological replays.
Evidence
Semantic recall across 100+ sessions: ~126ms
Storage footprint: ~1GB for a heavy power user, 200–400MB typical
API calls per query: zero
- Record date: 2026-09-07T08:37:56.672Z