Tool blocks AI agents from re-adding code your team already reverted
A developer has released revert_guard.py, an open-source pre-commit tool that prevents AI coding agents from reintroducing code a team has previously reverted. The problem arises because each new AI agent session starts without memory of past decisions, meaning it can re-propose changes — such as adding a database column — that were deliberately rolled back for reasons like regulatory compliance. The tool works entirely offline with no API keys, reading a repository's existing git log to identify prior reverts and blocking any incoming diff that re-adds a flagged entity. It exits with code 1 and prints the original revert date and stated reason, giving reviewers immediate context. The project was inspired by a real incident shared by developer Mason Delan, in which a fresh Claude Code session re-proposed a PCI-DSS-triggering database column that had been reverted a month earlier.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in