Skip to content
Development
Command

/watch

Set up a file watcher that triggers Claude on file changes

From plugin
claude-command-suite
1.4k199 skills89 agents199 commands
$ npx -y skills add qdhenry/Claude-Command-Suite --agent claude-code

Command definition

watch.md
description: Set up a file watcher that triggers Claude on file changes
argument: Watch path (file or directory)

File Watcher Setup

Set up a chokidar-based file watcher for: `$ARGUMENTS`

Instructions

1. Ask the user the following questions interactively (use AskUserQuestion):

  • **Prompt**: "What Claude prompt should run when files change?" (remind them they can use `{{file}}` as a placeholder for the changed file path)
  • **Glob filter** (optional): "Do you want to filter by file type?" with options like `*.tsx`, `*.ts`, `*.css`, or no filter
  • **Debounce delay** (optional): "How long to wait after the last change before triggering?" with options 200ms, 500ms (default), 1000ms

2. Verify the watch path `$ARGUMENTS` exists. If it doesn't, warn the user and ask if they want to proceed anyway.

3. Ensure `scripts/watch-files.mjs` exists. If not, inform the user it needs to be created (it should already exist as part of the file-watcher skill).

4. Ensure `chokidar` is in devDependencies. If not, run `bun add -d chokidar`.

5. Ensure `package.json` has the `watch:files` script. If not, add it:

   "watch:files": "node scripts/watch-files.mjs"

6. Run a smoke test:

  • Start the watcher in the background with the user's chosen options
  • Touch a file in the watched path
  • Verify the watcher detects the change (check its stdout for the log line)
  • Kill the background watcher

7. Print the final command the user can run:

   node scripts/watch-files.mjs <path> '<prompt>' [--glob '<pattern>'] [--debounce <ms>]

Skill Reference

See `.claude/skills/file-watcher/SKILL.md` for full documentation, examples, and troubleshooting.

Read more
@qdhenry
Ships withclaude-command-suite

A comprehensive development toolkit designed following Anthropic's Claude Code Best Practices for AI-assisted software development.

1.4k12 skills89 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
1.4k
Star history of qdhenry/Claude-Command-Suite on GitHub, a chart by star-history.com

Other commands on claude-command-suite.

More commands from other plugins.

build
Auto-invoked

build

Command

Implement tasks incrementally — build, test, verify, commit. Add "auto" to run the whole plan in one approved pass.

@addyosmani@addyosmaniInstall Command