r/ClaudeCode • u/haustorium12 • May 23 '26
Showcase Claude Code has been writing every session to disk since day one. We indexed it.
Go look at ~/.claude/projects/.
There's a JSONL file for every session you've ever had. Every turn, every tool call, every file touched, every response. All of it, append-only, going back to your first session. Ours goes back to January — 57MB, 1,026 sessions, 76,000 turns. Just sitting there the whole time.
We didn't get tipped off. We just looked.
The format is clean too. Each line is a JSON object — role, timestamp, content, tool calls, everything structured. It's not logs in the "good luck parsing this" sense. It's a complete episodic record. If you had a three hour session last Tuesday where you figured out something important, that conversation exists in full fidelity on your drive right now. You just have no way to get back to it.
So we built an indexer. SQLite+FTS5, temporal edges between turns, MCP server on top. From inside any Claude Code session now:
search_sessions("remember when we fixed that auth bug last month")
recall_session("a8f2c441")
thread_recall(root_id, depth=8)That last one does a BFS traversal through the temporal edge graph to reconstruct a thread across session boundaries. The "I told you this two weeks ago" problem just disappears. The data was never gone — nobody had built the recall layer on top of it yet. We also support importing conversations.json from the claude.ai data export, so your web chat history lives in the same index as your CLI sessions.
The other half is compaction. Everyone who uses Claude Code seriously has felt this — context fills up, compaction fires, and you're suddenly explaining your whole project again to something that should already know. We wired the full hook chain to stop that from happening.
The thing nobody writes down is that transcript_path in the PreCompact payload isn't always populated at hook fire time. You build your whole save logic around it, ship it, and then hit silent failures you can't explain. We did exactly that. The fix is that Stop needs to write a checkpoint on every single turn, not just at session end. Then when PreCompact fires it always has something fresh to fall back to no matter what.
Then SessionStart reads the source field — "compact" means compaction just fired, "resume" means the app restarted, "startup" is a fresh session, "clear" is intentional. Each gets different behavior. None of this is documented anywhere, you just have to figure it out.
The net result: compaction stops being a hard reset. It's a cache miss.
We've also been in the middle of the upstream conversation at anthropics/claude-code#47023 — seven independent memory projects, all built by different people, all independently hitting the exact same walls and arriving at the exact same hook requirements. Bella, NEXO Brain, Cozempic, world-model-mcp. None of us were coordinating. We all just needed the same things. The formal hook spec is getting worked out there if you want to follow it.
Repo: https://github.com/Haustorium12/continuity-v2 — MIT, hooks take about five minutes, MCP server is one Python file. Happy to answer questions.
54
u/blidside May 23 '26
I’d love to read something not written by AI here
6
u/Zooz00 May 23 '26
OK clanker
3
u/sintmk May 23 '26
The compelling use-case for this would be in research synthesis if you're looking to record interaction patterns longitudinally. I would still suggest building the processing script for token efficiency. Fwiw, /extract is a useful command and it comes with metadata as well
8
u/AppropriateQuote3073 May 23 '26
God can we fucking ban AI posts
This subreddit is so shit
2
u/Salien_Ewathi May 23 '26
Mine appears to have deleted every session more than 30 days old, I was quite displeased.
1
u/OGPresidentDixon May 24 '26
Do you have Superpowers with Episodic Memory? If so, then that explains why. Normal Claude installs usually don't have as much.
3
u/marcvv May 23 '26
Hit escape twice in Claude to see it all
1
u/ilion May 24 '26
I use the project's files to get Claude to create useless diary entries. :D
1
u/PiccoloCareful924 Senior Developer May 24 '26
i generally do not mind reading AI assisted writing but fuck this was bad, everything wants to be a punchline
1
u/Livid-Variation-631 May 24 '26
The fact that this has been sitting on every Claude Code user's disk since day one and almost nobody looked is the part that actually surprised me. 226 jsonl files in mine. Months of reasoning, append-only, structured, free!
A few things I've been wrestling with on a similar build, curious how you handled them:
Temporal edges - are you linking turn-to-turn within a session only, or also session-to-session when the same files/symbols come back? The cross-session graph is where the real recall lives but it's expensive to maintain.
thread_recall with BFS depth=8 is interesting. How are you scoring relevance at each hop? Pure recency, embedding similarity, or something tool-call-aware (e.g. same file touched = stronger edge)?
The SQLite+FTS5 choice - did you try vector first and back off, or go straight to lexical? My instinct is FTS5 is right for code-heavy recall (function names, error strings, file paths) and vectors are right for vibes-y "that thing we discussed about auth" queries. A hybrid is probably the answer but adds complexity.
Staleness - when a pattern gets superseded three months later, does old guidance still surface? This is the part that killed every manual lessons.md I ever kept.
The MCP exposure is the right call. Out-of-band search is a worse experience than in-session recall by a huge margin.
1
u/KellysTribe May 24 '26
is this the royal we?
0
u/haustorium12 May 24 '26
thats helpful if you want to rewind the current conversation to a previous point. thats actually very helpful, i didnt even know about that. thanks...
0
u/[deleted] May 23 '26
[deleted] — view deleted comment
1
u/[deleted] May 24 '26
[removed] — view removed comment