Install fswatch via Homebrew: brew install fswatch
Watch a directory and print changed file paths: fswatch /path/to/watch
Recursively watch a directory tree: fswatch -r /path/to/watch
Filter by event type (e.g., only new file creations) using --event: fswatch --event Created -r /path/to/watch
Pipe output to a handler script in a loop: fswatch -r /path/to/watch | while IFS= read -r file; do echo "Changed: $file"; done
Known gotchas
fswatch on macOS uses the FSEvents backend which reports paths at the granularity of directories in some circumstances; individual file paths may not always be reported depending on the event batch.
The pipeline loop blocks indefinitely; wrap it in a background process or launchd agent for production use, and handle signals to allow clean shutdown.
fswatch --event accepts event name strings such as Created, Updated, Removed, Renamed; not all backends support all event types — check fswatch --list-monitors to see which backend is active.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp