Claude Memory Compiler — Evolving Knowledge Base
Auto-capture Claude Code sessions into a structured knowledge base. Hooks extract decisions and lessons, compiler organizes into cross-referenced articles. No vector DB needed. 365+ stars.
What it is
Claude Memory Compiler automatically captures decisions, patterns, and lessons from your Claude Code sessions and compiles them into a structured knowledge base. Hooks run after each session to extract noteworthy information, and a compiler step organizes everything into cross-referenced articles. The result is an evolving wiki that grows as you work, without requiring a vector database or external infrastructure.
This tool targets developers who use Claude Code daily and want to build institutional memory from their AI-assisted coding sessions. Teams that lose context between sessions or across team members benefit most.
How it saves time or tokens
Without persistent memory, developers re-explain context to Claude Code every session, wasting tokens on repetition. Claude Memory Compiler eliminates this by surfacing past decisions and patterns automatically. The structured output means you can reference previous solutions directly instead of re-deriving them, cutting both token consumption and debugging time.
How to use
- Clone the repository and install dependencies
- Configure hooks to run after Claude Code sessions
- Run the compiler to organize captured knowledge into cross-referenced articles
Example
git clone https://github.com/anthropics/claude-memory-compiler.git
cd claude-memory-compiler
npm install
# Configure hooks
npm run setup-hooks
# After working sessions, compile knowledge
npm run compile
# Browse your knowledge base
npm run serve
Related on TokRepo
- AI memory tools — Compare memory solutions for AI agents
- AI coding tools — Browse developer-focused AI tools
Common pitfalls
- The compiler works best with frequent, focused sessions rather than marathon coding sprints that mix unrelated topics
- Knowledge articles need occasional manual curation to merge duplicates and correct misclassifications
- Hook configuration must match your Claude Code setup; incorrect paths cause silent failures
Frequently Asked Questions
No. The system uses structured markdown articles with cross-references and full-text search. There is no dependency on a vector database, embedding model, or external search infrastructure.
Hooks run after Claude Code sessions to extract decisions, patterns, and lessons from the conversation. The compiler then organizes these extractions into structured articles with cross-references to related topics.
Yes. The knowledge base is stored as files that can be committed to a shared Git repository. Team members compile their sessions into the same base, building collective institutional memory.
Growth depends on session frequency and content. The compiler deduplicates and merges related topics, so the knowledge base grows in depth rather than unbounded breadth. Periodic curation keeps it manageable.
The hooks are designed for Claude Code sessions. Adapting them to other tools requires modifying the extraction logic to match that tool's session format and output structure.
Citations (3)
- Claude Memory Compiler GitHub— Hooks extract decisions and lessons from Claude Code sessions
- Anthropic Documentation— Structured knowledge base without vector database dependency
- Claude Code Overview— Cross-referenced article compilation from session data
Related on TokRepo
Source & Thanks
Created by Cole Medin. Licensed under open source.
claude-memory-compiler — ⭐ 365+
Thanks to Cole Medin for building a practical memory system for Claude Code power users.
Discussion
Related Assets
Claude-Flow — Multi-Agent Orchestration for Claude Code
Layers swarm and hive-mind multi-agent orchestration on top of Claude Code with 64 specialized agents, SQLite memory, and parallel execution.
ccusage — Real-Time Token Cost Tracker for Claude Code
CLI that reads ~/.claude logs and breaks down Claude Code token spend by day, session, and project — pluggable into your statusline.
SuperClaude — Workflow Framework for Claude Code
Adds 16+ slash commands, 9 cognitive personas, and a smart flag system to Claude Code in one pipx install.