One session library across three machines
I keep long chat threads with coding agents alive, because a new chat starts with no context. That is a bad habit. I built a library so a new chat can look up what an old one decided.
The problem
Context sits in four places: memory files, worklogs, docs/ files, and
handoff files. Memory is tied to the folder of a session, so a new git
worktree starts empty. Agents also re-read raw transcripts to recover context.
A scan on 2026-10-10 found 507 such reads in 112 sessions. That is about 225k
tokens of results.
The design
- One private git repo holds the library. It syncs to all three machines.
- One markdown entry per topic, in
entries/<topic>.md. - Each entry has fixed parts: Answer, Decided, Blocker, Superseded, Measured, Open, Pointers, and the session ID.
- A generated
INDEX.mdlists one line per entry. - A capture step runs inside an existing session reviewer. It runs every 15 turns and at session end. It adds no new model calls.
The lookup
A library skill tells the agent the order:
- Read
INDEX.md. - Read the entries that match the topic.
- Run
lib search "<keywords>", at most three times. - Open the full transcript of a cited session.
After three empty searches, the agent says there is no prior work. The lib
CLI also has lib index and lib build-index. The search is a per-machine
SQLite FTS5 keyword index over condensed, redacted transcripts. It has no MCP
server and no embeddings.
The test
I tested 24 sessions and 12 questions with Haiku, one run per setup. The score is correct answers out of 12.
- Raw transcripts read in full: 12.
- Entries plus keyword search: 10.5.
- Entries plus hybrid search: 10.5, at a higher cost.
- Keyword search only: 9.5.
One run per cell is a small sample. The misses came from capture quality, not from retrieval.
What is still open
- Capture works only after a session reaches 15 turns or ends.
- Security-review sessions still show up in search results.
- A negative answer about the state of code costs about 100k tokens, because the agent then checks the code.
- Old transcripts hold plaintext logins. I strip logins only in entries. I must rotate those logins myself.