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

McPherson AI releases two new QSR operations skills on ClawHub: food cost diagnostics and labor leak auditing
Two new free skills have been published on ClawHub: qsr-food-cost-diagnostic catches COGS issues weekly with a four-lever diagnostic, and qsr-labor-leak-auditor provides daily labor tracking with mid-week alerts to prevent overspend.

Brain-MCP Developer Documents Tools for Claude AI Instead of Humans
A developer maintaining the Brain-MCP server added a 'For AI Assistants' section to documentation with behavioral instructions, resulting in Claude using tools more intelligently and proactively injecting context when topics change.

NexQuant: Rust-native 3-bit KV-cache engine for edge deployment
NexQuant is a production-hardened Rust engine that enables running high-context models on consumer hardware with 3-5x memory reduction. It supports Metal, CUDA, Vulkan, and CPU backends.

Project Ledger: Human-in-the-Loop Memory System for AI Coding Agents
A GitHub project introduces a YAML-based ledger system where humans curate what AI agents remember about codebases. It includes a /ledger skill, UserPromptSubmit hook for automatic context injection, and Haiku auditor review.