forgeplan scan
forgeplan scan walks the project tree and builds an inventory of source modules.
It respects .gitignore, groups files by crate / package / directory, and writes
the resulting list into the workspace so that coverage and drift can cross-reference
it against Affected Files sections in artifacts.
Think of scan as the “read your own repo” step. It doesn’t touch artifacts directly — it just makes the module graph queryable by the other quality commands.
When to use
Section titled “When to use”- First time running coverage/drift in a workspace — scan must precede them.
- After a big refactor that adds/removes modules — rescan to refresh the inventory.
- In CI: rescan before any coverage check so stale module lists don’t cause false positives.
- Before onboarding a teammate — rescan so
coverageshows the real picture.
When NOT to use
Section titled “When NOT to use”- Just to read files — use your shell. Scan is workspace-aware, not a generic file lister.
- If coverage/drift already ran and your code hasn’t changed — scan is idempotent but wasteful.
forgeplan scan [OPTIONS]Options
Section titled “Options” --path <PATH> Path to project root (default: current dir) -h, --help Print help -V, --version Print versionExamples
Section titled “Examples”Scan the current project
Section titled “Scan the current project”forgeplan scanOutput:
Scanning /Users/me/forgeplan... crates/forgeplan-core 14 modules crates/forgeplan-cli 8 modules crates/forgeplan-mcp 5 modules website/src 12 modules
39 modules indexed in .forgeplan/modules.jsonScan a sibling repo
Section titled “Scan a sibling repo”forgeplan scan --path ../other-projectUseful when managing multiple projects from one .forgeplan/ workspace (advanced).
Full coverage pipeline
Section titled “Full coverage pipeline”forgeplan scan && forgeplan coverage && forgeplan driftThe canonical codebase-reconciliation sequence: refresh modules, compute coverage, check drift. Run it monthly or after major refactors.
Output interpretation
Section titled “Output interpretation”| Line | Meaning |
|---|---|
| per-crate row | how many source modules were found in each top-level dir |
| total | modules indexed — this becomes the denominator for coverage |
The scan is language-agnostic but tuned for Rust/TypeScript/Python layouts. Empty directories and test-only modules are excluded by default.
How it fits the workflow
Section titled “How it fits the workflow”scan → coverage (modules ↔ artifacts) → drift (artifacts ↔ git history) → remediateScan is step 0 of the quality reconciliation loop. Without it, coverage and drift
have no module graph to work against.
See also
Section titled “See also”forgeplan coverage— per-module decision coverageforgeplan drift— decisions whose code moved awayforgeplan scan-import— rebuild LanceDB index from markdownforgeplan health— aggregates coverage into the dashboard- CLI overview