Why Your CLAUDE.md and .cursorrules Fail (And the Pre-Commit Hook That Actually Enforces Them)
Markdown rule files (CLAUDE.md, .cursorrules, .windsurfrules, AGENTS.md) work cleanly for the first 10 minutes of a session. Once context fills up or the model hits a tricky test failure, prompts alone start slipping:
- The agent catches a crash with
except Exception: passso the test turns green. - It spins up an unreferenced helper file (
utils_v2.py) that nothing in production imports. - It leaves
breakpoint()or a test secret inside the working tree. - Worse, an autonomous loop can edit your
.github/workflows/or.cursorrulesfile to relax the rule itself.
Prompts are advisory context. Enforcement has to happen out-of-process at git commit time.
Moving Rules From Wishlists to a Deterministic Pre-Commit Gate
In our Production IDE Agent Rules & AST Guardrails Pack, every rule inside CLAUDE.md / .cursorrules / .windsurfrules / AGENTS.md maps directly to a fast, stdlib-only check inside zmb_ide_precommit.py:
- Credential Leak Blocker: rejects staged files containing
sk-,ghp_,AIzaSy, or private key headers before they ever enter git history. - Silent Exception Trap: parses every staged
.pyfile withast.parseand blocks bareexcept: passorexcept Exception: pass. - Debug Leftover Check: blocks staged
pdb.set_trace(),breakpoint(), anddebugger;. - Rule & Workflow Tamper Lock: rejects edits to
CLAUDE.md,AGENTS.md,.cursorrules,.windsurfrules, and.github/workflows/*unless you setALLOW_GUARD_EDIT=1intentionally.
Free Static AST CLI + Ready-to-Drop IDE Pack
- Open-Source AST Auditor (
zmb-audit):pip install zmb-auditand runzmb-audit . --strict(GitHub | PyPI). - Production IDE Agent Rules & AST Guardrails Pack (EUR 19): Available on Gumroad with drop-in
CLAUDE.md,.cursorrules,.windsurfrules,AGENTS.md, Python/TypeScript/MCP stack overlays, and zero-dependencyzmb_ide_precommit.pyinstaller. - Core Failure-Mode Report & Kernel Kit (EUR 14): Available on Gumroad.

