You
You fixed one line by hand.
The agent
It rewrote the file from memory.
dibs stops AI coding agents from undoing what you typed.
Agents don't see the edits you make between their turns, so they "fix" them back. dibs tells them what you changed, blocks the revert before it lands, and restores only your lines if one slips through.
Claude Code · Codex · Gemini CLI · Cursor · Copilot · aider
The arena a real-time copy of what dibs does in your repo
- 1 Edit a line in
api.py(trytimeout=30) - 2 Give the agent a task
- 3 Watch it try to write from memory
One turn, both sides of the seam
You edit by hand
Between turns you change timeout=10 to timeout=30. dibs records it as yours — with the lines, the time, and the file.
The agent gets a brief
[dibs] Since your last turn these files were
changed outside your session — by the human, by hand.
• api.py — edited by human (+1 −1, 2m ago)
- r = requests.get(url, timeout=10)
+ r = requests.get(url, timeout=30)It tries anyway
Before any edit runs, dibs checks whether it removes lines you added or brings back lines you deleted. Claude Code asks you; Codex, Gemini and Cursor get a denial that names your lines.
The edit bounces
dibs: this edit to api.py would undo changes the human made by hand. It removes lines the human added or changed: + r = requests.get(url, timeout=30) Keep the human's version and make your change around it.
Something slipped through?
A sed in a shell command, or an agent with no hooks. dibs sees it right after, tells the agent, blocks the commit, and puts back only your lines.
Your lines come back
$ git commit -m "add logging" dibs: this commit contains files where an AI agent undid lines you edited by hand: #7 api.py (claude): r = requests.get(url, timeout=30) $ dibs restore api.py ✓ restored the human lines in api.py (undoing #7)
Verified with the real CLIs — honestly
Real agent binaries, real config parsing, real hook runners. Only the model's replies were scripted (no accounts were used).
| Agent | Version | Guard before edit | Shell revert caught | Brief reaches model |
|---|---|---|---|---|
| Claude Code | 2.1.295 | ✓ ask | ✓ | ✓ |
| Codex CLI | 0.162.0 | ✓ deny | ✓ | ✓ |
| Gemini CLI | 0.63.0 | ✓ deny | ✓ | ✓ |
| aider | 0.86.2 | after the run | ✓ | ✓ --read |
| Cursor agent | 2026.10.01 | unit tests from its source · needs a Cursor login to run end to end | ||
| Copilot | — | not run · needs VS Code + a Copilot account | ||
Call dibs in 20 seconds
Python 3.9+, no dependencies. Everything stays in .git/dibs/ on your machine.
# install (not on PyPI yet) pipx install git+https://github.com/mrzroot/dibs@v0.1.1 # in each repo dibs init # wires your agents' hooks dibs doctor # checks they will really run dibs status