Skip to content

Claude Code Antiregression Setup

Stop Claude Code from breaking your projects. Ready-to-use CLAUDE.md templates, subagents, hooks, and anti-regression configs.

Install: git clone https://github.com/CreatmanCEO/claude-code-antiregression-setup

Works with Claude Code · 12 GitHub stars

Install

$git clone https://github.com/CreatmanCEO/claude-code-antiregression-setup

Install command taken from the project's README or registry entry. Always review code before running it.

Claude Code Anti-Regression Setup

🇬🇧 English · 🇷🇺 Русский

The exact CLAUDE.md + subagents + hooks setup that got me into Habr's daily top-5 (20K reads, Технотекст 8 entry). Survives Claude's 1M context window — because regressions aren't a memory problem, they're a discipline problem.

Companion articles: Habr (RU) — Как я перестал бояться Claude Code · dev.to (EN) — I Stopped Claude Code From Breaking My Projects

Want a real terminal recording instead of this rendered SVG? Run bash docs/setup-demo-project.sh and follow docs/RECORDING-DEMO.md.


Why this exists

A million-token context window does not eliminate regressions — Anthropic itself reports only a 15% drop in compaction events with Opus 4.7 (April 2026). Even a developer with perfect memory will introduce bugs without process discipline. Claude with 1M tokens remembers more, but still happily "improves" your working function or "optimizes" the test that guards an important edge case.

The root cause is not "the model is dumb." It is the absence of a project constitution that survives context compaction, a separation between research and implementation contexts, and an automated gate that refuses broken commits. This repo gives you all three.

Per SFEIR Institute, 60% of Claude Code support tickets come from the ghost context anti-pattern — working without a CLAUDE.md. A simple CLAUDE.md resolves the issue in 90% of cases.

How it works — four layers of defence

graph TB
    User["You(prompt)"]
    Claude["Claude Codemain session"]
    CLAUDE["CLAUDE.mdpersistent rules · survives /compact"]
    Rules[".claude/rules/glob-scoped standards"]
    Subs[".claude/agents/planner · tester · reviewer"]
    Hooks[".claude/settings.jsonPreToolUse · PostToolUse"]
    Repo[("Your repocode · tests")]

    User --> Claude
    CLAUDE -->|"injected before every turn"| Claude
    Rules -->|"loaded only on matching files"| Claude
    Claude -->|"delegate research / tests / review"| Subs
    Subs -->|"summary only — separate context"| Claude
    Claude -->|"git commit attempt"| Hooks
    Hooks -->|"pytest fails → block"| Claude
    Hooks -->|"pytest passes → allow"| Repo

    classDef gate fill:#fee,stroke:#c44
    class Hooks gate
Layer What it does Why it works
CLAUDE.md Project constitution: stack, commands, CRITICAL RULES Re-read from disk after every /compact — no rule can be "forgotten"
Subagents planner (research), tester (full suite), code-reviewer (regression check) Each runs in isolated context; only summary returns to main session
Hooks PreToolUse on git commit runs pytest and blocks if anything fails Hard gate — Claude literally cannot bypass it without you editing settings.json
Rules glob-scoped per-language standards in .claude/rules/ Loaded only when Claude opens matching files; saves context

What you actually get

Similar plugs

Orca is the ADE for working with a fleet of parallel agents. Run any coding agent with your own subscription. Available on desktop, mobile and remote runtime.

PluginDev tools+6,803 this week

CLI proxy that reduces LLM token consumption by 60-90% on common dev commands. Single Rust binary, zero dependencies

Documented system prompts from Anthropic - Claude Fable 5.1, Opus 5.5, Claude Design, Claude Code. OpenAI - ChatGPT GPT-6-Astra, Codex. Google - Gemini 3.8 Flash, 3.1 Pro…

Wrap Antigravity, ChatGPT Codex, Claude Code, Grok Build, Muse Code, Devin as an OpenAI/Gemini/Claude/Codex compatible API service, allowing you to enjoy the free Gemini…

Explore related