-w, --watch (Watch): Keep the command running and re-run it (or refresh output) whenever the input changes. Watch mode keeps a command running and repeats its work whenever something changes. npm run dev with Vite rebuilds your assets when you save a file. jest --watch reruns the tests that relate to your change. kubectl get pods -w keeps printing as pods start and stop.
Frequently asked questions about -w, --watch (Watch)
How is -w, --watch (Watch) used in practice?
The point is a short feedback loop. You save, and a second later you see whether it worked. That keeps you in the flow instead of switching to a terminal every few minutes.
What should you keep in mind with -w, --watch (Watch)?
Watchers use file system events, and those have limits. Very large projects can hit the operating system's limit on watched files, and some setups with Docker or network drives miss changes completely. If a watcher seems to ignore your edits, that is usually the cause. Restarting it is a quick check; raising the watch limit or using polling is the longer fix.
Use before running or suggesting shell commands with flags, especially destructive or broad ones (-f/--force, -r/-R recursive, -a/--all, -y/--yes, prune, --hard), and when a user asks what a flag means (-v, -q, -n/--dry-run, -h, -o, -p, -t, -u, -w, -x, -c, -i). Explains flags per tool and prefers dry runs and narrow scopes.
Use this skill before running, or recommending, any Docker command that deletes, wipes, resets, or otherwise irreversibly changes state — even if the user just says to "clean up", "clear the cache", "start fresh", "wipe everything", "nuke it", "reset", "force remove", or "tear down" Docker resources. Covers generic Docker CLI destructive operations not owned by a more specific skill — `docker rm`,
Master ShellCheck static analysis configuration and usage for shell script quality. Use when setting up linting infrastructure, fixing code issues, or ensuring script portability.