CLI command
watch
Monitor a solution continuously and re-run analysis after file changes so simplification work gets immediate feedback.
Command contract
watch is the refactoring loop. It keeps the current solution shape visible while you are actively changing code.
Simplification sessions, teaching demos, and iterative cleanup where you want to see the effect of each edit quickly.
No. It watches the solution tree and streams refreshed output.
Returns 0 when stopped cleanly. Returns 1 for usage errors; runtime watch failures are printed to stderr.
Usage
Start with the exact command shape the CLI supports today.
dotnet simplicity watch path/to/YourSolution.sln Refactoring loop
Keep watch running in one terminal while you simplify code in another.
dotnet simplicity watch samples/Sample.Simplified/Sample.Simplified.sln What it prints or produces
watch starts with an initial snapshot, then prints refreshed snapshots and filter verdicts after debounced file changes.
- Full solution path in the initial “Watching …” banner.
- Initial snapshot plus filter verdicts immediately after startup.
- Updated snapshot sections after file changes, using a 500 ms debounce.
- Change display that shows which file changed, including rename old -> new formatting.
- Missing-config warnings shown once until a simplicity.json file appears again.
Watching /path/to/YourSolution.sln
Press Ctrl+C to stop.
Initial snapshot
----------------
Simplicity Snapshot (2026-05-01)
----------------------------------------
Projects: 2
Total files: 23
Primary path files: 5
Abstraction layers: 1
Filter Verdicts
---------------
TwoAmTest: PASS (1.00)
HalfRule: PASS (1.00)
PrimaryPathFirst: PASS (0.79) Operational notes
These behaviors matter when you move from a local run to team automation.
- The watcher ignores bin, obj, .git, .vs, and simplicity-report to avoid self-triggering noise.
- Configuration is reloaded on every pass, so threshold changes in simplicity.json show up without restarting the process.
- watch is meant for local feedback, not CI. Use diff for merge gates and report for persistent artifacts.
Related pages
Use the surrounding docs when you need setup, filter interpretation, or CI context.
diff
Use diff to confirm the same improvements against the committed baseline.
Companionreport
Generate a shareable artifact once the live session produces a better result.
SupportTroubleshooting markdown
Use the repository troubleshooting guide when file watching or IDE state becomes noisy.