3days since the last Git and AI fuck-up

Incidents 28 Aug pushed to mainClaude Code

The test that pushed to main

Status: production saved by a failed build.

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.

From the cut

From the cut: The test that pushed to mainFrom the cut: Reverted.From the cut: The test that pushed to mainFrom the cut: The test that pushed to main
The day before 26 AugNothing to cleanStatus: cleaned up nothing. Nothing was the repo.Watch it

The day after: You confirmed that's fine →