| name | gdd-recall |
| description | Search cross-cycle memory: decisions, learnings, experience archives. Returns ranked matches. |
| argument-hint | <query> [--reindex] |
| tools | Read, Write, Bash |
| disable-model-invocation | true |
@reference/retrieval-contract.md
{{command_prefix}}recall
Searches .design/archive/, .design/learnings/LEARNINGS.md, .design/CYCLES.md, and STATE.md decision blocks for the given query and returns ranked matches. Uses FTS5 when better-sqlite3 is available, ripgrep next, Node fs scan as universal fallback.
Steps
-
Parse argument: extract <query> and optional --reindex flag.
- If no query and no
--reindex: print usage and exit.
- If
--reindex only: rebuild the index (see step 3), then exit.
-
Check backend: run
node -e "const {backendName}=require('./scripts/lib/design-search.cjs');console.log(backendName())"
Print a one-line notice: Search backend: fts5 | ripgrep | node-grep.
-
Reindex if requested: run
node -e "require('./scripts/lib/design-search.cjs').reindex(process.cwd())"
Print: "Index rebuilt."
-
Search: run
node -e "
const s=require('./scripts/lib/design-search.cjs');
const r=s.search(process.argv[1], process.cwd(), {limit:20});
console.log(JSON.stringify(r));
" -- "<query>"
Parse the JSON array of {file, line, text} objects.
-
Format results: print in this shape:
## Recall: "<query>" (N matches, backend: fts5)
### 1. .design/archive/cycle-2/EXPERIENCE.md:42
> Decided to skip dark-mode token layer in cycle 2 — cost–benefit did not clear threshold
### 2. .design/learnings/LEARNINGS.md:18
> L-03 · color · cited:4 · Color contrast failures cluster around interactive states, not surfaces
Group by file. Truncate text at 120 chars. Cap at 20 results.
-
Signal relevance: for every result whose text contains an L-NN learning ID, record a surfaced signal:
node -e "
const rc=require('./scripts/lib/relevance-counter.cjs');
rc.record('L-NN','surfaced','.design');
"
-
Empty result: if no matches, print:
No matches for "<query>" in cross-cycle memory.
Tip: run {{command_prefix}}recall --reindex if the archive has been updated since last index build.
Do Not
- Do not modify any source file.
- Do not run git commands.
- Do not write
.design/STATE.md.
RECALL COMPLETE