DEV Community

Cover image for I built a file watcher for AI coding agents — would love brutal feedback
Oz Gomez
Oz Gomez

Posted on

I built a file watcher for AI coding agents — would love brutal feedback

I've been using Claude Code for the past few months — heavily. And a lot of the time, I'm running it remotely. I'll kick off a session from my phone via Telegram, leave it working on a project, and come back later to see what it did.
That's when I started noticing something uncomfortable.
The agent would modify files I didn't expect. Overwrite a .env. Delete something it considered "unused". Touch config files while doing something else entirely. When I was sitting at the machine, I'd catch it. When I wasn't — I'd find out later, sometimes much later.
So I built something to watch what it does while I'm away.
AgentGuard is a CLI wrapper and background daemon that monitors your filesystem while AI coding agents work. It detects changes to sensitive files (.env, keys, CI configs, package.json), logs everything to an audit trail, and can send you a Telegram message with rollback buttons if something looks wrong — even when you're not at the machine.
npm install -g agentguard-dev
agentguard init
agentguard claude # wraps Claude Code
Or run it as a permanent background daemon:
agentguard daemon install # starts on login via launchd
agentguard daemon status
What it actually does:

Watches configured directories permanently, even when you're away
Detects mass deletes, env overwrites, CI config changes, credential files
Sends Telegram alerts with ✅ Keep / ↩️ Rollback buttons you can tap from your phone
Writes a full audit log so you can see what the agent touched during a session

Honest limitations:

Real-time command interception doesn't work reliably — Codex is a Rust binary that bypasses our hooks, Copilot CLI has a TUI that interferes. The file watcher is the primary defense.
Tested mainly with Claude Code on macOS. Other agents and Linux need more testing.
Nobody has really used this except me.

That last point is why I'm posting this.
I have a few years of experience in testing and developer support, so I know enough to build something that works — but I built this primarily because I needed it, and Claude Code helped me write most of it, which is a bit meta. The code works, the tests pass, and it's been running as a daemon on my machine for a week watching two real projects.
But I have no idea if it's useful to anyone else, if the UX makes sense, or if I'm solving the wrong problem entirely.
GitHub: github.com/Osva2023/AgentGuard
If you use Claude Code, Codex, or aider — I'd genuinely appreciate you taking a look. Even just "this is pointless because X" would be valuable right now.
leave questions, suggestions, etc, in the comments, thanks DEVs

Top comments (0)