This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Persistent, compounding knowledge base for any repository. Reads raw evidence from Entire CLI sessions and git history, extracts ALL knowledge worth remembering (decisions, preferences, patterns, gotchas, business rules, architecture, brand — anything discussed in sessions), and compiles it into a wiki at .reflect/wiki/. The wiki is indexed by qmd (required) for hybrid search (BM25 + vector + reranking). Agents query qmd directly for project memory — no context injection needed. The more sessions pile up, the more reflect knows.
reflect— CLI entry point (Python)lib/— CLI modules (evidence, context, init, search, status, sessions, timeline, improve, metrics, ingest, lint, wiki)lib/evidence.py— fixed evidence gathering pipeline (Entire CLI + git)lib/wiki.py— wiki layer utilities (frontmatter, page I/O, index scanning, index.md)lib/ingest.py— two-step wiki ingest (triage → write) + qmd re-indexinglib/lint.py— wiki health checks (stale, orphan, duplicate, coverage, resolved)skill/SKILL.md— skill source (dev copy; install copies to.claude/skills/reflect/)SPEC.md— specification for.reflect/directory formathooks/session-start.sh— SessionStart hook for knowledge base freshnessinstall.sh— installer (symlinks CLI to~/.local/bin)README.md— user-facing docsROADMAP.md— future phasesCLAUDE.md— this file
- Edit
lib/evidence.pyto change evidence gathering - Edit
lib/context.pyto change synthesis pipeline, system prompt, or validation - Edit
lib/wiki.pyto change wiki utilities (frontmatter, page format, index.md) - Edit
lib/ingest.pyto change knowledge extraction (triage/write subagent prompts) - Edit
lib/lint.pyto change wiki health checks - Edit
lib/to change CLI commands - Edit
.reflect/format.yaml(in any repo) to customize seed categories - Edit
skill/SKILL.mdto change the Claude Code skill (source of truth) - Test locally:
python3 reflect statusorpython3 reflect search <query> - Test wiki:
python3 reflect init && python3 reflect ingest --verbose && python3 reflect lint - Install CLI via
./install.sh; the skill is project-local under.claude/skills/reflect/
- When writing code that shells out to external CLIs or APIs, verify available commands/endpoints with
--helpor reference docs before implementation — don't assume command signatures. - For changes that affect core architecture (learning mechanism, data flow, required dependencies), confirm the design decision (optional vs required, additive vs replacement) with the user before implementing.