Introduction
Claude Memory Compiler is a personal knowledge base tool for Claude Code, with 365+ GitHub stars. It automatically captures Claude Code sessions via hooks, uses the Claude Agent SDK to extract key decisions and lessons learned, and compiles them into structured, cross-referenced knowledge articles. No vector database — it uses a structured index.md approach. Inspired by Karpathy's LLM knowledge base architecture. Ideal for heavy Claude Code users.
Claude Memory Compiler — Build Memory from AI Sessions
Workflow
- Session ends → hooks trigger flush.py
- Knowledge extraction → Claude Agent SDK identifies decisions, patterns, lessons
- Daily log → saved to timestamped files
- Compilation → compile.py organizes into cross-referenced articles
- Injection → SessionStart hook loads index.md into the next session
Core Features
- Auto-capture — hooks trigger at session end
- No vector DB required — structured index.md works better at personal scale
- Health checks — lint.py runs 7 checks
- Query interface — command-line search of the knowledge base
FAQ
Q: What is Claude Memory Compiler? A: An open-source tool that auto-captures Claude Code sessions and compiles them into a structured, searchable knowledge base.
Q: Do I need a vector database? A: No — the structured index.md approach outperforms RAG at personal scale.