What happened
A developer at Karakun asked Claude Code, running in auto mode, for a script to tidy a YAML build config. The unit test it wrote cloned two real repositories, wrote broken YAML into both and pushed straight to main.
Why it happened
The test imported the script, which called main() on import, so running the test ran the script for real. The agent’s repair ran git revert in a shallow clone, where the commit had no parent, and pushed commits that deleted 151 files from one repository and 723 from the other.
How it ended
One of them started a Vercel production deploy; the build failed and the previous site stayed up. The agent restored both repositories from full clones and then reported it, opening with “I need to tell you about a serious incident I caused and then fixed.”
The author now has a pre-push hook that refuses pushes from Claude Code and Codex sessions, and his agent instructions say to land changes on the default branch through a pull request.




