Skip to main content

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.

The Claude Memory Compiler uses the Claude Agent SDK, which runs on your existing Claude subscription. Anthropic has clarified that personal use of the Claude Agent SDK is covered under Claude Max, Team, and Enterprise plans — no separate API key or billing account is required. Costs below are in USD and represent approximate per-operation consumption against your subscription quota.

Cost table

OperationEstimated cost
Compile one daily log0.450.45–0.65
Query (no --file-back)~0.150.15–0.25
Query (with --file-back)~0.250.25–0.40
Full lint (with contradictions)~0.150.15–0.25
Structural lint only$0.00
Memory flush (per session)~0.020.02–0.05
These figures are estimates based on typical knowledge base sizes (50–200 articles). Compile costs increase as the knowledge base grows because the LLM receives the full knowledge/index.md and all existing articles as context on each compilation run.

Why compile costs are highest

compile.py sends the most tokens per run. The prompt includes:
  • The full AGENTS.md schema (~500 tokens)
  • The current knowledge/index.md (grows with each article)
  • All existing knowledge articles (grows as the KB scales)
  • The daily log being compiled
With a fresh knowledge base, compile costs sit near the low end of the range. As the KB grows toward 200+ articles, expect costs to drift toward the high end. The --all flag recompiles every log from scratch and should be used sparingly.

Free operations

Structural lint (--structural-only) makes zero API calls. All six structural checks — broken links, orphan pages, orphan sources, stale articles, missing backlinks, and sparse articles — are pure file-system operations. Run them as often as you like at no cost. The SessionStart hook is also completely free. It reads local files and outputs a JSON string; no LLM is involved.

Cost tracking

Every operation that makes an API call updates scripts/state.json with the actual cost returned by the SDK:
{
  "ingested": {
    "2026-04-01.md": {
      "hash": "a1b2c3d4",
      "compiled_at": "2026-04-01T14:30:00+00:00",
      "cost_usd": 0.52
    }
  },
  "query_count": 14,
  "last_lint": "2026-04-05T10:00:00+00:00",
  "total_cost": 8.37
}
The total_cost field accumulates across all compile and query operations. The flush.py process does not currently write its per-flush cost to state.json, so the flush row in the table above is an approximation.

Tips to reduce costs

Run compile.py --dry-run to see which daily logs are queued for compilation before spending any tokens. This is especially useful after --all is needed to confirm the scope.
uv run python scripts/compile.py --dry-run
The LLM contradiction check is the only lint step that costs money. Run it weekly or on demand; use --structural-only for all other lint runs.
uv run python scripts/lint.py --structural-only
--file-back costs ~$0.10 more per query because it writes a Q&A article and updates index.md and log.md. Use it only for questions whose answers are worth preserving permanently.
# Exploratory — cheaper
uv run python scripts/query.py "Quick question about X"

# Preserve answer — use when the answer is genuinely reusable
uv run python scripts/query.py "What is my standard approach to X?" --file-back
--all recompiles every daily log, multiplying compile costs by the total number of logs. Use it only after making structural changes to AGENTS.md that require fresh extraction passes across the whole history.
The end-of-day auto-compilation triggered by flush.py after 6 PM compiles only the logs that have changed since their last compilation. This is the lowest-cost way to keep the knowledge base up to date — it avoids redundant recompile runs that manual invocations can cause.

Build docs developers (and LLMs) love