A local CLI that turns recurring AI coding failures into tested rules and regression tests for the next session.
The system at a glance.
- System
- Open-source developer tool / Python package
- Focus
- Platforms
- Status
- Published package
The challenge.
AI coding assistants can repeat the same runtime mistake in a later session. A correction in one conversation does not become a tested rule for the next one.
How the parts connect.
The runtime stays local: capture a failure, match it against a curated pattern, verify its fixture with pytest, and inject the resulting project files. Pattern matching does not call an LLM or require an API key.
What it handles.
Failure capture
Capture a failed command or Claude Code tool failure locally, including the error text needed for matching.
Pattern matching
A curated library uses deterministic regular expressions and heuristics to identify a known failure class.
Local verification
The matched pattern runs its pytest fixture in a subprocess before any guardrail is written.
Guardrail injection
A successful verification generates a Claude Code skill, Cursor rule and pytest regression template.
Claude Code hook
A PostToolUseFailure hook can feed failed tool calls into the same local pipeline.
Shell wrapper
The `immunize run` command wraps a shell command and captures a non-zero exit for analysis.
Project memory
Local SQLite records captures and injections; generated files can be reviewed and committed with the project.
How developers use it.
Use a Claude Code hook, wrap a command with immunize run, or capture a failure manually. Review the generated files before committing them for the team.
The work, end to end.
- 01Failed command
- 02Curated pattern match
- 03pytest verification
- 01Verified pattern
- 02Claude Code skill
- 03Cursor rule
- 01Verified pattern
- 02Regression template
- 03Project commit
Engineering focus.
Python 3.10+ / Typer / Pydantic / PyYAML / pytest / SQLite
Inside the workflow.
View product diagrams
What we delivered.
An Apache-2.0 Python package published on PyPI, with source and documentation available on GitHub. It prevents known failure classes from being forgotten; it does not automatically repair the current failing program.
