GitHub: github.com/srijanshukla18/vigil
When I have coding agents running autonomously in a repo, I want a small terminal pane on the side where I can watch what files they are touching and see the exact inline diffs in real time.
Existing CLI tools each do only one piece of this:
watch/viddy: re-runs a command every N secondsfswatch/entr: prints file paths when events fire, no UI or diffslazygit: shows git diffs, but isn’t a live chronological event stream of what the agent just touched 2 seconds ago
At first I tried hacking it together with a one-liner:
fswatch -r . | xargs -I{} sh -c 'echo "--- {} ---" && git diff {}'
Which fell apart pretty fast:
git diffcompletely misses new untracked files, scratch files, or files outside a git repo- when an agent formats or saves 15 files at once, the terminal scrollback explodes
- no easy way to pause scrolling, inspect a diff, or clear the screen without restarting the command
So I vibe-coded a small Rust TUI for it called vigil.
What vigil does
Run one command in the directory you want to watch:
vigil .
What you get:
- recursive file watcher on the directory
- live event stream (created / modified / deleted) with inline colored text diffs
- auto-follows new edits by default, pauses auto-scroll as soon as you scroll up manually
- debounces rapid save bursts and skips binary/huge files
- ignores
.git,node_modules,target,.DS_Storeout of the box
How it’s built
Kept the Rust crate stack super standard:
notifyfor cross-platform filesystem eventssimilarfor computing line diffs in memoryratatui+crosstermfor the TUIclapfor CLI flags
Wait - how does it show diffs for untracked files if it doesn’t use git diff?
When vigil starts up, it snapshots an in-memory baseline of the text files in the directory. Whenever a file changes on disk, similar diffs the new file contents against the last cached version in memory and updates the snapshot. That way you see exact line-by-line diffs even on brand-new scratch files or repos that haven’t been committed yet.
Keybindings are standard vim-style:
j/kto scroll,g/Gfor top/bottomdto toggle inline diffs on/offcto clear the event streamqto quit
Why I keep it open
When a background agent is running for 10+ minutes, you don’t wanna stare at its chat stream reading every tool call, and you also don’t wanna walk away blind and come back to 40 ruined files.
Keeping vigil . open in a corner pane lets you glance over and immediately see:
- is the agent editing the same file 8 times in a loop?
- did it randomly start touching files in a folder it has no business editing?
- are the generated tests landing where they should?
If it looks good, I let it cook. If I see it touching weird files in vigil, I hit Ctrl+C on the agent right away before it wastes another 50k tokens.