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 browser simulation of how dibs reacts; the agent's edits are scripted
- 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
Ready to installآمادهٔ نصب
Questions people askپرسشهای پرتکرار
Which agents does it work with?با کدام ایجنتها کار میکند؟
dibs doctor after you upgrade an agent; it checks that the hooks still fire.Claude Code، Codex، Gemini CLI، Cursor، Copilot و aider، از راه هوکهای خود هر ایجنت. بعد از بهروزرسانی هر ایجنت، dibs doctor را اجرا کنید تا مطمئن شوید هوکها هنوز کار میکنند.Does my code leave my machine?کد من از کامپیوترم بیرون میرود؟
.git/dibs/ (or .dibs/ outside git). It is never committed and nothing is sent anywhere.نه. دفتر ثبت در .git/dibs/ (یا بیرون از گیت در .dibs/) میماند، هیچوقت کامیت نمیشود و چیزی به جایی فرستاده نمیشود.What if the agent reverts my line with a shell command?اگر ایجنت با یک دستور شل خط مرا برگرداند چه؟
sed, cat > or a script is reported to the agent, shown in dibs status and stopped at git commit. dibs restore FILE puts back only your lines.dibs بعد از هر دستور بررسی میکند. برگرداندنی که با sed، cat > یا یک اسکریپت انجام شود به ایجنت گزارش میشود، در dibs status دیده میشود و پشت git commit میماند. dibs restore FILE فقط خطهای شما را برمیگرداند.How is it different from Cursor checkpoints or Claude Code rewind?چه فرقی با checkpointهای Cursor یا rewind در Claude Code دارد؟
Will it slow my agent down?ایجنت را کند میکند؟
dibs init takes about 1.2 s and each hook 0.1–0.4 s. Files over 2 MB and binaries are tracked by hash only.تقریباً نه. در مخزنی با ۳۰ هزار فایل، dibs init حدود ۱٫۲ ثانیه و هر هوک ۰٫۱ تا ۰٫۴ ثانیه طول میکشد. فایلهای بزرگتر از ۲ مگابایت و فایلهای باینری فقط با هش دنبال میشوند.