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

Open-source Claude Code skill /unzuck curates social media feeds into dashboard
A free, open-source Claude Code skill called /unzuck scans feeds across Hacker News, Reddit, LinkedIn, YouTube, Twitter/X, Instagram, and Facebook in parallel using browser automation, scores items against user interest profiles, and generates interactive HTML dashboards.

Gemma4 26B-A4B Delivers Fast Local Performance with Web Search and Image Support
The gemma-4-26B-A4B model achieves approximately 145 tokens per second on an RTX 4090 and includes web search MCP and image support for chat applications. A blog post details setup and cross-platform usage on Mac and iPhone.

AgentMind: A Claude Code Plugin That Learns and Applies Your Coding Preferences
AgentMind is a Claude Code plugin that observes your coding patterns, learns preferences like tool choices and style rules, and automatically injects that context into future sessions. It uses a six-step core loop and confidence scoring to determine when to apply learned preferences.

Foreman: Open Source Slack Bot for Remote Control of Local Claude Code
Foreman is a free, open source Slack bot that provides remote control for locally running Claude Code instances. It allows developers to send tasks to Claude from their phone while maintaining full local access to filesystem, tools, and environment.