forgeplan reindex
Rebuild the LanceDB search and metadata index from the markdown files in
.forgeplan/. This is a read-only operation against your markdown sources —
the .md files are the source of truth (ADR-003), and lance/ is a derived,
gitignored cache that can always be recomputed.
forgeplan reindexOptions
Section titled “Options” -h, --help Print help -V, --version Print versionWhat it does
Section titled “What it does”- Scans every artifact directory under
.forgeplan/(adrs, rfcs, prds, epics, specs, evidence, problems, solutions, notes, refresh). - Parses YAML frontmatter + markdown body of each file.
- Rebuilds the LanceDB tables (
artifacts,links,tags,events). - Recomputes derived fields (R_eff scoring inputs, tag canonicalization).
- Leaves your markdown files untouched.
When to run
Section titled “When to run”- After
git clone—.forgeplan/lance/is gitignored and doesn’t exist on a fresh checkout. Runforgeplan init -y && forgeplan reindexto bootstrap the workspace. - After manual markdown edits — if you edited PRD/RFC files outside the
CLI (text editor, find-and-replace),
reindexsyncs the changes into LanceDB sosearch,list, andhealthsee them. - After
git pullthat brought in new artifacts from teammates — see alsoforgeplan git-syncfor the incremental variant. - Recovery from corruption — if
lance/is damaged or LanceDB schema migrated, a full reindex rebuilds from markdown truth. - Schema migration — new LanceDB columns in a Forgeplan upgrade require reindex to populate them.
Example
Section titled “Example”# Fresh clone bootstrapgit clone <repo> && cd myprojectforgeplan init -yforgeplan reindexforgeplan list # verify
# After editing a PRD in your text editorvim .forgeplan/prds/prd-001-auth.mdforgeplan reindexforgeplan search "auth"Safety
Section titled “Safety”reindex is safe to run at any time. It never writes to .md files, only
to the lance/ derived index. If you’re unsure whether the index is
in sync, just run it — the cost is a scan of your artifact tree (seconds for
typical workspaces).
v0.18.0 note (PROB-027)
Section titled “v0.18.0 note (PROB-027)”Prior to v0.18.0, reindex assumed .forgeplan/lance/ already existed and
could fail on fresh clones. As of v0.18.0 the command bootstraps the index
directory if missing, so the “clone → reindex” workflow now works end-to-end
without a separate init step on existing workspaces.
Orphan relation cleanup (v0.17.1 hotfix)
Section titled “Orphan relation cleanup (v0.17.1 hotfix)”As of v0.17.1 (PROB-028, PRD-044) reindex runs a Phase 3 pass that trims
orphan relations — links in the relations table whose source or target
artifact no longer exists in the artifacts table.
Before v0.17.1, deleting or deprecating an artifact left its relation rows
behind in LanceDB. These orphan links caused phantom ? rows in
forgeplan tree output and inflated link counts in forgeplan health. Phase 3
removes them and prints a counter:
Reindex complete: 147 artifacts, 3 removed (corrupt kind), 5 orphan relations trimmedRemoval reasons reported in the output:
| Reason | What happened |
|---|---|
corrupt kind field | Row with unparseable kind — no valid directory |
no .md file found | LanceDB row with no corresponding markdown file |
orphan relation (source missing) | Relation pointing from a deleted artifact |
orphan relation (target missing) | Relation pointing to a deleted artifact |
orphan relation (both missing) | Both ends of the link are gone |
When to run
Section titled “When to run”- After bulk deletes — if you removed several
.mdfiles manually. - After manual
.mdremoves —rm .forgeplan/prds/prd-old.mdleaves a dangling LanceDB row until you reindex. - Session start after
git pull— teammates may have deprecated or deleted artifacts on their branches. - After upgrade from pre-v0.17.1 — one reindex cleans up any accumulated orphan relations from the pre-fix era.
reindex vs scan-import
Section titled “reindex vs scan-import”reindex— targeted rebuild of LanceDB from current markdown state. Use in normal day-to-day work.scan-import— lower-level scanner that can also import legacy/foreign artifacts into a fresh workspace. Preferreindexunless you’re doing a one-time import or migration.
See also
Section titled “See also”- CLI overview
forgeplan scan-import— bulk import + rescanforgeplan git-sync— incremental sync after pullforgeplan watch— continuous auto-sync daemonforgeplan health— verify index integrity