Stop Claude Code from breaking your projects. Ready-to-use configs, agents, hooks, and templates.
Claude Code progressively breaks projects during long sessions due to context window exhaustion (~200K tokens). At 90% utilization, it forgets earlier decisions and introduces regressions. 80% of context gets consumed by file reads and tool results — not your conversation.
The community calls this "context drift" and it's the #1 source of AI-introduced regressions.
This repo provides a battle-tested anti-regression setup through four layers:
- CLAUDE.md — Persistent project rules that survive context compaction
- Subagents — Isolated AI specialists (planner, tester, reviewer) with separate context windows
- Hooks — Automated test gates that block broken commits
- Rules — Modular, glob-scoped coding standards
├── CLAUDE.md.template # Project constitution — fill in your details
├── .claude/
│ ├── settings.json # Hooks: auto-test reminders, commit blocking
│ ├── agents/
│ │ ├── planner.md # Research and planning (never writes code)
│ │ ├── tester.md # Full test suite runner + regression checker
│ │ └── code-reviewer.md # Quality, security and regression reviewer
│ └── rules/
│ ├── python-backend.md # Python-specific rules (glob-scoped)
│ └── frontend.md # Frontend-specific rules (glob-scoped)
├── plans/
│ └── .gitkeep # Planner agent saves implementation plans here
└── docs/
├── WORKFLOW.md # Daily anti-regression workflow guide
└── MCP-SETUP.md # MCP server installation instructions
git clone https://github.com/CreatmanCEO/claude-code-antiregression-setup.git
cp -r claude-code-antiregression-setup/.claude /path/to/your/project/
cp claude-code-antiregression-setup/CLAUDE.md.template /path/to/your/project/CLAUDE.md
mkdir -p /path/to/your/project/plansOpen CLAUDE.md in your project root and replace all [placeholders] with your project's actual data.
claudeClaude reads CLAUDE.md automatically. Try:
> Use the planner agent to analyze our codebase and create a plan for [your task]
Edit .claude/settings.json — replace python -m pytest tests/ with your project's test command.
Claude reads this at the start of every session. It survives compaction. Your CRITICAL RULES live here.
Key stat: 60% of Claude Code support tickets come from the "ghost context" anti-pattern — working without CLAUDE.md. A simple CLAUDE.md resolves 90% of cases.
| Agent | Purpose | Why Isolated? |
|---|---|---|
planner |
Research codebase, create plans | Research reads many files — would bloat main context |
tester |
Run full test suite, catch regressions | Test output is verbose — stays out of working memory |
code-reviewer |
Review for quality, security, patterns | Fresh perspective without implementation bias |
Commit-blocking hook prevents Claude from committing code that breaks tests. Zero exceptions.
Files in .claude/rules/ load only when Claude works with matching file patterns — saves context.
See docs/WORKFLOW.md for the complete daily workflow.
- Plan first:
Use planner agent→ review → approve - Small diffs: One step → tests → next step
- Monitor context:
/compactat 60-70% - Checkpoint:
git commitbefore risky changes - Review:
Use code-reviewerbefore final commit - Rewind if broken:
Esc + Esc→ restore code only
| Component | Tool | Cost |
|---|---|---|
| IDE | Google Antigravity | Free |
| AI Coding Agent | Claude Code (Max subscription) | $100/mo |
| UI Testing | Gemini 3 Pro (built into Antigravity) | Free |
| Browser Automation | Playwright MCP | Free |
See docs/MCP-SETUP.md for MCP server installation.
PRs welcome! Priority: language-specific rules, framework-specific agents, additional hooks.
- awesome-claude-code — Curated list of skills, hooks, agents
- claude-code-workflows — Production-ready workflow plugins
- Claude Code Docs: Best Practices — Official recommendations
Nick — Python developer and digital architect at CREATMAN
- GitHub: @CreatmanCEO
- Website: creatman.site
MIT