Claude Code Logs Every Session to Disk — Here's How to Index and Recall Them

Claude Code has been writing an append-only JSONL log of every session to ~/.claude/projects/ since day one. Each line is a structured JSON object — role, timestamp, content, tool calls — forming a complete episodic record going back to your first session. One user found 1,026 sessions totaling 57MB and 76,000 turns, all sitting on disk with no built-in way to query them.
Building a Recall Layer
The solution is an open-source indexer (continuity-v2, MIT) that ingests these logs into SQLite+FTS5 with temporal edges between turns, plus an MCP server. From inside any Claude Code session, you can now run:
search_sessions("remember when we fixed that auth bug last month")
recall_session("a8f2c441")
thread_recall(root_id, depth=8)The thread_recall function performs a BFS traversal through the temporal edge graph to reconstruct a thread across session boundaries. The indexer also supports importing conversations.json from the claude.ai data export, so web chat history lives in the same index as CLI sessions.
Fixing Compaction's Hard Reset
Compaction fires when context fills up, but the transcript_path in the PreCompact payload isn't always populated at hook fire time. The fix: write a checkpoint on every single turn (not just at session end) so PreCompact always has fresh data to fall back to. Then SessionStart reads the source field — "compact" means compaction fired, "resume" means app restart, "startup" is a fresh session, "clear" is intentional. Each gets different behavior. Net result: compaction becomes a cache miss, not a hard reset.
Upstream Conversation & Similar Projects
Track the ongoing discussion at anthropics/claude-code#47023. Seven independent memory projects (Bella, NEXO Brain, Cozempic, world-model-mcp, etc.) all independently hit the same requirements. A formal hook spec is being worked out there.
The hooks take about five minutes to set up; the MCP server is a single Python file. Repo is MIT licensed.
📖 Read the full source: r/ClaudeAI
👀 See Also

Tastebud Memory: Reversible Agent Memory via Hyperdimensional Computing Vectors
Hyperdimensional computing replaces vector search for complete recall: list ALL days touching a project, detect unnamed workstreams, and decompose daily logs losslessly via dot products.

MoltPoker.xyz: Play-money Texas Hold'em for AI Agents
MoltPoker.xyz is a platform where AI agents can play No-Limit Texas Hold'em against each other using WebSocket connections, with replayable hands and visible agent reasoning during live games.

Analysis of Ollama's Reusable Go Components for Local LLM Development
A developer examined Ollama's source code and found several standalone Go components including a pure Go token sampler, GGUF reader/writer, model conversion tools, chat template rendering, and OpenAI compatibility transforms that aren't available as separate libraries.

ViralCanvas.ai provides persistent context workspace for Claude models including Sonnet 4.5
ViralCanvas.ai is a visual workspace that sits on top of Claude's models, offering access to Sonnet 4.5, Sonnet 4.6, Opus 4.5, and Opus 4.6 with persistent context attachment. The tool addresses context degradation issues in long conversations by keeping connected documents actively weighted on every prompt.