filewatch-channel
v0.1.3
Published
A Claude Code channel that watches files and directories for changes and pushes events into the running session.
Maintainers
Readme
filewatch-channel
A Claude Code channel that watches files and directories for changes and pushes events into the running session. This lets external processes (cron jobs, pipelines, other tools) trigger Claude to act on new data without human intervention.
Usage
Add to .mcp.json
{
"mcpServers": {
"filewatch": {
"command": "npx",
"args": ["filewatch-channel", "./data", "./output"]
}
}
}Start Claude Code with the channel
During the research preview, custom channels require the development flag:
claude --dangerously-load-development-channels server:filewatchRun alongside other channels
Filewatch works alongside other channels like Discord or Telegram:
claude --channels plugin:discord@anthropic --dangerously-load-development-channels server:filewatchHow it works
- Watches the specified paths recursively using
fs.watch - On file change, pushes a notification with the file path and event type into the Claude Code session
- The agent can then use the
Readtool to inspect file contents if needed - Debounces rapid changes (500ms) to avoid flooding
- Ignores
.git,node_modules, dotfiles, and.envfiles
Example: cron job writes data, agent reacts
A cron job drops a CSV into ./data/ every hour:
# crontab
0 * * * * /usr/local/bin/fetch-metrics.sh > /path/to/project/data/metrics-$(date +\%Y\%m\%d\%H).csvWith filewatch watching ./data, Claude receives each new file as a channel event and can process it, generate a report, commit results, or notify you via another channel.
Configuration
Watch paths are passed as CLI arguments. Relative paths are resolved from the current working directory.
npx filewatch-channel ./data ./reports ../shared/inboxRequirements
- Node.js >= 20.12.0
- Claude Code v2.1.80+
- Claude.ai login (Console/API key auth not supported for channels)
License
MIT
