The Claude Memory Compiler organises files into four top-level directories.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/coleam00/claude-memory-compiler/llms.txt
Use this file to discover all available pages before exploring further.
daily/ holds immutable conversation logs. knowledge/ holds the compiled output the LLM writes and maintains. scripts/ holds the CLI tools. hooks/ holds the Claude Code automation layer. Understanding which layer owns which files — and how they reference each other — is the key to navigating and extending the system.
Full project tree
Directory roles
daily/ — immutable source
Daily logs are the raw material of the system. They are append-only: flush.py adds entries to them, but nothing ever edits or deletes them after the fact. Think of them as version-controlled source files — the compiler reads them but never modifies them.
Each file is named YYYY-MM-DD.md and contains structured session entries written by flush.py.
knowledge/ — LLM-owned compiled output
The knowledge/ directory is fully owned and maintained by the LLM. Humans read it but should rarely edit it directly. The three subdirectories map to the three article types:
| Directory | Article type | Created by |
|---|---|---|
knowledge/concepts/ | Concept articles | compile.py |
knowledge/connections/ | Connection articles | compile.py |
knowledge/qa/ | Q&A articles | query.py --file-back |
knowledge/ root:
knowledge/index.md is the master catalog and the primary retrieval mechanism. Every article has a row in this table. When query.py answers a question, it reads index.md first to select which full articles to fetch — no vector search needed.
knowledge/log.md is an append-only chronological record of every compile, query, and lint operation. It is never overwritten, only appended to.
scripts/ — CLI tools
Contains the four user-facing scripts (compile.py, query.py, lint.py, flush.py) plus shared infrastructure (config.py for path constants, utils.py for helpers). State files (state.json, last-flush.json) are also stored here at runtime but are gitignored.
hooks/ — Claude Code automation
Contains the three hook scripts that fire automatically when Claude Code sessions start, end, or trigger auto-compaction. These are the entry points that make the system fully automatic.
reports/ — lint output (gitignored)
lint.py writes its markdown reports here as lint-YYYY-MM-DD.md. The directory is gitignored so reports don’t accumulate in version control. They are regenerated on the next lint run.
Structural files
knowledge/index.md — master catalog
The index is a markdown table. Every article appears as one row, giving the LLM a structured overview of the entire knowledge base before it reads any article in full.
compile.py adds rows when it creates new articles and updates the Updated column when it modifies existing ones. query.py --file-back adds rows for filed Q&A articles.
knowledge/log.md — build log
An append-only chronological record. Every major operation appends a timestamped entry:
State tracking
Two JSON files inscripts/ track runtime state. Both are gitignored and regenerated automatically.
scripts/state.json
Tracks compilation history and cumulative costs.
| Key | Description |
|---|---|
ingested | Map of daily log filenames to their last-seen SHA-256 hash (first 16 hex chars), compilation timestamp, and cost |
query_count | Total number of queries run with query.py |
last_lint | ISO 8601 timestamp of the most recent lint.py run |
total_cost | Cumulative API cost across all operations in USD |
scripts/last-flush.json
Tracks deduplication for the background flush process.
flush.py is called twice for the same session_id within 60 seconds (which can happen when both pre-compact.py and session-end.py fire in quick succession), the second call reads this file and exits without running the LLM.