Cette page est affichée en anglais. Une traduction française est en cours.
SkillsApr 9, 2026·3 min de lecture

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.

Introduction

Claude Memory Compiler is an evolving personal knowledge base for Claude Code with 365+ GitHub stars. It automatically captures your Claude Code sessions via hooks, extracts key decisions and lessons using the Claude Agent SDK, and compiles them into structured, cross-referenced knowledge articles. No vector database needed — uses a structured index.md approach that works better at personal scale. Inspired by Karpathy's LLM Knowledge Base architecture. Best for power users of Claude Code who want persistent memory across sessions.

See also: Claude Code Skills on TokRepo.


Claude Memory Compiler — Build Memory from Your AI Sessions

The Problem

Claude Code sessions are ephemeral — valuable decisions, debugging insights, and architectural choices are lost when the session ends. You end up re-explaining the same context over and over.

The Solution

Claude Memory Compiler hooks into your Claude Code workflow and builds a growing knowledge base automatically:

  1. Session End → hooks trigger flush.py
  2. Extraction → Claude Agent SDK identifies decisions, patterns, and lessons
  3. Daily Logs → insights saved to timestamped daily files
  4. Compilationcompile.py organizes into cross-referenced articles
  5. Injection → SessionStart hook loads index.md into next session

Key Features

  • Automatic capture — hooks fire on session end + pre-compaction safety net
  • Knowledge extraction — AI identifies decisions, patterns, and lessons learned
  • No vector database — structured index.md works better at personal scale
  • Health checkslint.py runs 7 checks (broken links, orphans, contradictions, staleness)
  • Daily compilation — automatically triggers after 6 PM local time
  • Query interface — search your knowledge base from the command line

Setup

# Install dependencies
uv sync

# Copy hooks config to your project
cp .claude/settings.json your-project/.claude/settings.json

# Compile knowledge base
uv run python scripts/compile.py

# Query your knowledge base
uv run python scripts/query.py "How did I handle the auth migration?"

# Run health checks
uv run python scripts/lint.py

How Knowledge Is Organized

knowledge/
  index.md          # Master index, injected into each session
  architecture/     # System design decisions
  debugging/        # Bug patterns and solutions
  conventions/      # Code style and project rules
  integrations/     # Third-party service patterns

FAQ

Q: What is Claude Memory Compiler? A: An open-source tool that automatically captures Claude Code sessions and compiles them into a structured, searchable knowledge base that persists across conversations.

Q: Does it require a vector database? A: No. It uses a structured index.md approach inspired by Karpathy's LLM Knowledge Base architecture, which works better than RAG at personal scale.

Q: How does it integrate with Claude Code? A: Via Claude Code hooks — it captures sessions automatically on end, extracts insights, and injects the knowledge index at session start.


🙏

Source et remerciements

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

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.