/reflect:recallfrom reflect
Retrieves relevant prior learnings from a global knowledge base using hybrid vector + graph search. Reranks results by confidence, recency, and tag overlap. Useful when starting work, debugging recurring issues, or before implementing features with potential prior art. Supports staged recall workflow for deep investigations.
Ships in reflect. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Queries the global learnings KB (GraphRAG + vector) and surfaces the top-N most relevant learnings for the current work, reranked by confidence, recency, and tag overlap.
Also fires automatically via the SessionStart hook (see
hooks/session_start_recall.py) with a 3-result cap, any confidence
(reranked by confidence/recency/tag-overlap). This skill is the
explicit, higher-limit path.
| Invocation | Behavior |
|---|---|
/reflect:recall <query> | Default — 10 results, any confidence, markdown out |
/reflect:recall <query> --limit 5 --confidence HIGH | Tight filter |
/reflect:recall <query> --mode local | Graph-neighborhood search (finds related concepts) |
/reflect:recall <query> --mode global | Community-based (broad patterns) |
/reflect:recall <query> --format json | Structured output for programmatic use |
/reflect:recall <query> --no-cache | Skip cache, force fresh query |
/reflect:recall <query> --field rule | S1: just one structured field per hit (rule/fix/root_cause/problem) — cheapest injection |
When you need more than the one-shot top-N — e.g. tracing how a problem
evolved, or hydrating several related learnings — use the staged pipeline in
scripts/recall_stages.py instead of repeated full recalls. It is the
token-cheap discipline (~10x savings vs. hydrating everything up front):
# Step 0 — print the contract (self-documenting bootstrap)
uv run {{HOME_TOOL_DIR}}/skills/recall/scripts/recall_stages.py workflow
# Step 1 — compact ID-only index: {id, title, score, project, date}
# (~50-100 tokens/result)
uv run {{HOME_TOOL_DIR}}/skills/recall/scripts/recall_stages.py index "$QUERY" --limit 20
# Step 2 — chronological neighbours around an interesting hit
# (anchor by ID, or pass a query to find the anchor automatically)
uv run {{HOME_TOOL_DIR}}/skills/recall/scripts/recall_stages.py timeline --anchor <ID> --depth-before 3 --depth-after 3
# Step 3 — full bodies + entity sidecars, ONLY for the filtered IDs
# (~500-1000 tokens/result; always batch 2+ ids)
uv run {{HOME_TOOL_DIR}}/skills/recall/scripts/recall_stages.py hydrate <ID> [<ID> ...]
Never run Step 3 without filtering through Steps 1-2 first. The index and timeline rows are deliberately ID-only so you can triage many results cheaply and hydrate only what survives.
{{HOME_TOOL_DIR}}/skills/recall/scripts/recall.py:
uv run {{HOME_TOOL_DIR}}/skills/recall/scripts/recall.py "$QUERY" --limit 10 --format markdown
[lrn-id], key insight, and how-to-apply.reflect search <id> or check the reflect repo's documents/ dir
(~/.claude/global-learnings/documents/ by default).--tags a,b,c for reranking boost.reflect search CLI (from reflect-kb,
install via uv tool install reflect-kb) as a subprocess. Resolved via
shutil.which("reflect"); falls back to the legacy
~/.learnings/cli/learnings only if the canonical CLI is missing.CE × confidence_boost × recency_boost × tag_boost × proof_boost
— cross-encoder relevance is primary; each secondary signal is a
multiplicative boost 1 + α·(norm − 0.5) bounded to ±α/2 (Hindsight
shape, port R8), so no single signal can dominate.
RECALL_CONFIDENCE_ALPHA / RECALL_RECENCY_ALPHA /
RECALL_TAG_ALPHA / RECALL_PROOF_ALPHA~/.reflect/recall_cache/, 1h TTL.~/.reflect/recall_log.jsonl for
future helpfulness analysis (Phase 6 of the retrieval plan)./reflect:ingest — populate the KB/reflect:status — KB health, coverage, pending reviewshooks/settings-snippet.json)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
10 skills in this plugin
/consolidatereflect:consolidateProject-level memory consolidation. Merges orphaned worktree memory
directories into a single .agents/MEMORY.md for the current project.
Deduplicates, sections, and proposes cleanup of orphan dirs.
Does NOT index into the global knowledge base — use reflect:ingest for that.
/corpusreflect:corpusBuild 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./costreflect:costReport reflect drain spend over a time window — tokens split by cached
(cache_read), uncached writes (cache_creation), and io (input+output), with a
$ estimate, grouped by day / outcome / model / transcript. Reads the drainer's
cost log and surfaces outlier runs and cache-reuse health (the 41.5M-token
failure mode = low cache reuse + high cache writes). Also reports the recall
followup rate (the recall-quality self-monitor: how often a session searched
again within 30s and got disjoint results). Use to answer "what is
reflection costing me" for the last day / week, or "is recall satisfying".
/errors-ackreflect:errors-ackTriage and acknowledge entries in the reflect errors sink
(~/.reflect/errors.json). Invoked from the statusline ⚠N badge when
pipeline errors accumulate (drain poison, parser crashes, ingest
failures, hook timeouts).
/exportreflect:exportExport or import the reflect knowledge base as a deterministic,
git-friendly tarball — the learnings markdown corpus plus the reflect.db
rows in one snapshot. Use to back up the KB, move it to another machine,
or restore it: `export` writes the tarball, `import` restores it (with an
optional GraphRAG reindex). Answers "snapshot my reflect KB", "move my
learnings to another machine", or "restore my knowledge base from a backup".
/ingestreflect:ingestThe global knowledge indexer. Harvests ALL memory sources across all tools
(Claude, Codex, Copilot, Gemini) and all project types into the unified
GraphRAG + QMD knowledge base. Archives originals, generates entity sidecars,
and dual-indexes for future retrieval. This is THE command that makes the
knowledge base comprehensive.
2 plugins in one repository ship this exact skill · first indexed Jul 16, 2026
npx claudepluginhub stevengonsalvez/ainb-reflect-memory --plugin reflect