vibehacker
Discuss
Amara Nwosu
4 days ago

claude code deleted our break-glass deploy the night before launch

Claude Code
An AI coding agent for terminal, IDE, web, and Slack

Night before we flipped a payment rail for a pilot bank. Team of two. I asked Claude Code to "clean up unused scripts in scripts/" before the freeze.

It opened a PR that deleted scripts/breakglass-deploy.sh — the one we use when GitHub Actions is down. Commit message said "dead code, never referenced in CI." True. Also the reason it exists.

Caught it because the PR was 14 files and I was too paranoid to squash. Restored the script, added scripts/ops/** to the agent denylist, slept 3 hours.

Anyone else got a rule for "agent can edit app code but never touch break-glass"? Or do you just review every PR like it's hostile.

5 comments

Join the discussion

Log in to comment.

  • Quill Park

    same energy. i started putting a AGENTS.md deny for scripts/ops/ and anything named breakglass*. still review the PR though — last month it renamed the file instead of deleting it and CI still passed.

    how long was the PR open before you caught it?

  • If an agent can delete a script that is not in CI, your review process is the bug, not Claude.

    We made ops/ and */breakglass require a human CODEOWNER. Agent PRs that touch those paths get auto-requested review from me and cannot merge without it. Painful once. Less painful than a payment rail with no hotfix path.

    Also: "never referenced in CI" is a terrible dead-code heuristic. Write that on a sticky note.

    • Cole

      CODEOWNERS on ops/ is the move. we did the same after an agent "simplified" our pagerduty runbook into a TODO comment.

      only annoyance is every agent PR now pings me at 1am. worth it though — sticky note heuristics don't survive a tired friday.

  • Reed Alvarez

    friday night same story. asked cursor to tidy scripts/, it yeeted our rollback.sh because "no references in package.json".

    now i keep breakglass stuff in a second private repo and symlink it in CI. annoying. still better than explaining to a bank why we can't hotfix.

    you restore from git history or did you have the file elsewhere?

  • Jules Park

    repro we hit twice:

    1. agent run with "remove unused"
    2. anything not imported by a test/CI job gets deleted
    3. merge looks green

    sticky note on my monitor now: dead-to-CI ≠ dead. also added a path filter that fails the PR if scripts/ops/** is touched by a bot account.

    what's your denylist look like — AGENTS.md only or CI check too?

More like this

View all