catchdev
Tells you what your AI coding agent just broke.
That GIF is real: it's catch flagging the SECRET_KEY_FALLBACKS session bug
that lived in Flask 3.1.0 for ~4 months before anyone noticed. catch ran the
affected tests, re-ran the failures against the pre-diff baseline, and pointed
at the exact regression. Reproduce it yourself.
10-second install
pip install catchdev
Usage
cd some-ai-generated-project
# make some changes (or let an agent make them)
git add .
catch # check staged changes
catch --commit HEAD~1 # check the last commit
catch --all-tests # run the full suite instead of affected tests
catch --skip-deps # skip PyPI dependency risk checks
catch --fail-on-suspicious # also block on suspicious (not just dangerous) deps
catch --output report.md # write a markdown report (for PR comments)
echo $? # 1 = problems found, 0 = clean
In a GitHub Actions PR, catch automatically diffs against
origin/$GITHUB_BASE_REF instead of HEAD~1 (squash merges break HEAD~1).
How it works
- differ — parses
git diff --unified=0into changed files, changed line numbers, and newly added imports / dependency entries. - mapper — builds (and caches in
.catch_cache.json) an AST import graph of the project, then walks it backwards from each changed file until it hits test files. When possible it narrows down to the specific test functions that call the functions your diff touched. - runner — runs the affected tests with pytest, then re-runs any failures against the pre-diff baseline in a temporary git worktree to distinguish NEW failures from pre-existing ones.
- depcheck — queries PyPI for every new dependency: does it exist, how old is it, how many downloads, and did you mean a similarly-named popular package? (Hallucinated package names — "slopsquatting" — are a real supply chain risk with AI-generated code.)
- report — pretty terminal output and an exit code you can wire into a hook or CI.
Why not just...?
| catch | LLM review (CodeRabbit etc.) | static gates (dont-break, Solumbe) | |
|---|---|---|---|
| Actually runs your tests | ✓ | ✗ | ✗ |
| Tells new failures from pre-existing | ✓ | ✗ | ✗ |
| Deterministic (same answer every run) | ✓ | ✗ | ✓ |
| Catches hallucinated packages | ✓ (live registry check) | unreliable | partial |
| Cost per run | free | tokens/subscription | free |
| Works as a hard CI gate | ✓ exit code | ✗ | ✓ |
Use it everywhere
GitHub Action (posts the report as a PR comment):
# .github/workflows/catch.yml
name: Catch
on: [pull_request]
jobs:
catch:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: pip install -e .
- uses: soham131345/catchdev@v1
catch runs catch on its own PRs — see .github/workflows/catch.yml in this repo.
Pre-commit / pre-push hook — add to .pre-commit-config.yaml:
- repo: https://github.com/soham131345/catchdev
rev: v0.1.0
hooks:
- id: catch
Running tests on every commit annoys people; pre-push is the sweet spot:
- id: catch
stages: [pre-push]
Claude Code skill — your agent checks its own work before committing.
Copy skills/catch/SKILL.md into
~/.claude/skills/catch/ (or drop the packaged catch.skill from Releases
into your skills directory). After that, Claude runs catch --staged before
every commit and fixes what it breaks instead of shipping it.
Exit codes
0— all affected tests pass, no dangerous dependencies1— new test failures OR dangerous dependencies2— catch itself couldn't run (not a git repo, etc.)
License
MIT
Metadata
Release files for catchdev 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| catchdev-0.1.3.tar.gz | 21.3 kB | Without provenance | Details for catchdev-0.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| catchdev-0.1.3-py3-none-any.whl | Python 3 | none | any | Details for catchdev-0.1.3-py3-none-any.whl |
Total release size: 41.4 kB
Release files / catchdev-0.1.3.tar.gz
| Download URL | catchdev-0.1.3.tar.gz |
|---|---|
| Size | 21.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ebd879337eb013f7e9dd5704b20c3ed12b3d8590d2e3ef98a4dc91ea871f07e7
|
|
BLAKE2b-256 checksum How to use checksums |
670bae61e9d0c6d78427c9315dff08fdcbd45d12d9b76321f988456f991df52d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.9
|
Release files / catchdev-0.1.3-py3-none-any.whl
| Download URL | catchdev-0.1.3-py3-none-any.whl |
|---|---|
| Size | 20.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2416d8df6828ff3d093e46e883de42b2595a627c9f9155e3c87a4badfe312229
|
|
BLAKE2b-256 checksum How to use checksums |
8f4cbcd547d49a84a31496602c59b12f62746aa0f9bd57aa6bb2931c61f03e6e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.9
|
Security for catchdev 0.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.