forgeplan watch
Start a file-watcher daemon that observes .forgeplan/**/*.md and re-indexes
any artifact that changes on disk. Ideal for interactive sessions where you
flip between a markdown editor and the CLI — edits become searchable
immediately without manual reindex calls.
forgeplan watchOptions
Section titled “Options” -h, --help Print help -V, --version Print versionHow it works
Section titled “How it works”- Opens a recursive filesystem watcher rooted at
.forgeplan/. - On every
CREATE/MODIFY/DELETEevent for a.mdfile under tracked artifact directories, schedules a debounced re-parse. - Re-parses the changed file, updates LanceDB in place, re-computes derived fields (tags, links, scoring).
- Logs each sync event to stdout so you can see what was picked up.
- Runs until you send
Ctrl-C(SIGINT) — then exits cleanly.
Debouncing coalesces rapid-fire events (e.g. an editor writing a temp file then renaming over the target), so one save = one index update.
When to use it
Section titled “When to use it”- Interactive writing sessions — you’re drafting a PRD in VS Code and
want
forgeplan list/forgeplan searchto reflect each save. - Pair work with AI agents — agent edits markdown, watcher pushes into
LanceDB, next
searchcall sees the update without a round-trip reindex. - Bulk reorganization — moving/renaming artifacts in a file manager and wanting the index to track along.
When NOT to use it
Section titled “When NOT to use it”- Batch imports — prefer
reindexorscan-importfor one-shot ingestion. - CI / scripted workflows — one-shot
reindexis simpler and deterministic. - Post-
git pull— usegit-sync, which knows exactly what changed from the git diff.
Example
Section titled “Example”# Start the watcher in one terminal$ forgeplan watch[watch] observing .forgeplan/ (Ctrl-C to stop)[watch] synced prds/prd-001-auth.md (1 artifact)[watch] synced evidence/evid-042-benchmark.md (1 artifact)
# In another terminal, edit and save — the daemon picks it up$ vim .forgeplan/prds/prd-001-auth.md$ forgeplan search "auth" # sees the new content immediatelyStop with Ctrl-C:
^C[watch] shutting down, flushing pending syncsAlternatives
Section titled “Alternatives”- Manual — run
forgeplan reindexafter a batch of edits. Simpler if you only save occasionally. - Post-pull —
forgeplan git-syncdiffs againstORIG_HEADand only re-indexes files the merge/pull actually touched.
Limitations
Section titled “Limitations”- Not a background service — runs in the foreground, so pair it with
tmux, a terminal pane, or your shell’s job control if you want it persistent. - No remote filesystem support — relies on inotify/FSEvents/kqueue (all native OS watchers), so network mounts may miss events.
- Single-workspace — run one
watchper.forgeplan/root.
See also
Section titled “See also”- CLI overview
forgeplan reindex— one-shot manual rebuildforgeplan git-sync— incremental sync after git pullforgeplan serve— MCP server for AI agents