Skip to content

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.

  • 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 coverage shows the real picture.
  • 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]
--path <PATH> Path to project root (default: current dir)
-h, --help Print help
-V, --version Print version
Terminal window
forgeplan scan

Output:

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.json
Terminal window
forgeplan scan --path ../other-project

Useful when managing multiple projects from one .forgeplan/ workspace (advanced).

Terminal window
forgeplan scan && forgeplan coverage && forgeplan drift

The canonical codebase-reconciliation sequence: refresh modules, compute coverage, check drift. Run it monthly or after major refactors.

LineMeaning
per-crate rowhow many source modules were found in each top-level dir
totalmodules 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.

scan → coverage (modules ↔ artifacts) → drift (artifacts ↔ git history) → remediate

Scan is step 0 of the quality reconciliation loop. Without it, coverage and drift have no module graph to work against.