From reflect
Build a long-lived, filtered SLICE of the global learnings KB and answer a question-set over it ("ask the auth subsystem", "ask the migration log"). Unlike /reflect:recall (a fresh hybrid query each time), a corpus is a saved filter snapshotted to disk — prime it once, ask many questions, reprime when the KB drifts. Use when the user wants a durable Q&A session against one filtered area of their own code history rather than a one-shot search.
How this skill is triggered — by the user, by Claude, or both
Slash command
/reflect:corpusThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
reflect-kb is search-shaped: every `/reflect:recall` is a fresh hybrid query.
reflect-kb is search-shaped: every /reflect:recall is a fresh hybrid query.
A corpus is the complementary pattern — a long-lived, filtered slice of the
user's own learnings that you hold open and answer a question-set against.
You (the agent) ARE the Q&A session. There is no SDK subprocess: the build step snapshots the filtered learnings to a JSON file and prints a primed context document; you read that document and answer questions over it.
For a one-shot retrieval, use /reflect:recall instead.
Space-separated key:value tokens. Bare tokens are treated as tags. All
predicates AND together; tag: may repeat (or use tag:a,b) to OR tags.
| token | meaning |
|---|---|
tag:auth / auth | learning carries this tag (case-insensitive) |
category:security | frontmatter category equals this |
project:api | frontmatter project_id/project equals this |
since:2026-01-01 | learning created/archived date ≥ this (inclusive) |
until:2026-06-30 | learning created/archived date ≤ this (inclusive) |
Run the corpus builder via the recall script (no embedding model loads — the filter is pure frontmatter logic):
plugins/reflect/skills/recall/scripts/recall.py \
--corpus auth-subsystem \
--corpus-filter "tag:auth category:security project:api" \
--format markdown
This snapshots every matching learning to
$REFLECT_STATE_DIR/corpora/auth-subsystem.json (default
~/.reflect/corpora/) — persisting the filter, a last-built timestamp, and the
KB mtime — and prints the primed context document.
Then: read the printed document and answer the user's questions using ONLY the learnings in it. Treat it as the full context for this corpus session.
The KB drifts as the user works (new learnings ingested, old ones archived). Re-run the saved filter — no need to restate it:
plugins/reflect/skills/recall/scripts/recall.py \
--corpus auth-subsystem --corpus-rebuild --format json
--corpus-rebuild re-applies the persisted filter against the current KB:
newly-matching learnings are pulled in, entries that no longer match (or were
deleted) are dropped. The JSON form reports "stale": true/false — stale
means the KB has been written since the snapshot was built, i.e. it's time to
reprime before answering further.
build_corpus(filter) runs the filter, writes the snapshot.stale), --corpus-rebuild and re-read.The deterministic build/filter/snapshot/reprime engine lives in
reflect-kb/src/reflect_kb/recall/corpus.py; the LLM-driven Q&A is yours.
npx claudepluginhub stevengonsalvez/ainb-reflect-memory --plugin reflectCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.