
File Watcher
Sets up file system watchers that trigger actions when your config files, env files, or dependencies change. You register watch paths through SessionStart or CwdChanged hooks, then handle changes via FileChanged events. The built-in cwd-changed.js already handles env injection, so this is mainly useful when you want to extend that with additional reactive workflows like auto-reminding to run npm install when package.json changes or restarting TypeScript checks when tsconfig.json updates. Watchers use a 500ms stability threshold to avoid firing on rapid successive changes. Keep your handlers quick since they run synchronously. The matcher syntax is a bit clunky with pipe-separated filenames, but it works.
- skills.sh installs
- 165
- GitHub stars
- 2.9K
- last updated
- Jun 8, 2026
Install
$ npx -y skills add rohitg00/pro-workflow --skill file-watcher --agent claude-codeInstalls into .claude/skills of the current project.
Files
File Watcher
Use Claude Code's FileChanged and CwdChanged hooks to create reactive workflows that respond to file system changes.
Trigger
Use when:
- Setting up auto-reload for config changes
- Watching for dependency updates
- Monitoring build output
- Creating reactive development workflows
How File Watching Works
Claude Code's SessionStart and CwdChanged hooks support returning watchPaths to register file watchers. The current cwd-changed.js script focuses on env injection; to add watch registration, your hook script must output this JSON structure:
{
"hookSpecificOutput": {
"hookEventName": "SessionStart",
"watchPaths": [
"/absolute/path/to/.env",
"/absolute/path/to/package.json"
]
}
}
When watched files change, the FileChanged hook fires with:
{
"hook_event_name": "FileChanged",
"file_path": "/path/to/changed/file",
"event": "change"
}
Environment Injection
CwdChanged and FileChanged hooks can write to CLAUDE_ENV_FILE to inject environment variables into subsequent Bash commands:
Sponsors
Details
- Repository
- github.com/rohitg00/pro-workflow
- Categories
- Frontend Development, Automation & Workflows
- First seen
- Jun 11, 2026
More from rohitg00/pro-workflow
All 35- Safe Mode164
- Plan Interrogate163
- Batch Orchestration162
- Bug Capture162
- Agent Teams161
- Permission Tuner161
- Sprint Status159
- Llm Gate158
- Wiki Query157
- Wiki Builder156
- Survey Generator154
- Wiki Research Loop154
- Wiki Viewer153
- Skill Optimizer140
- Module Map
- Token Efficiency239
- Pro Workflow213
- Wrap Up210
- Deslop203
- Context Optimizer196
- Learn Rule194
- Session Handoff191
- Smart Commit190
- Compact Guard189