Skip to main content

catchdev

Tells you what your AI coding agent just broke.

catch flags a real 4-month Flask regression in 2 seconds

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

  1. differ — parses git diff --unified=0 into changed files, changed line numbers, and newly added imports / dependency entries.
  2. 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.
  3. 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.
  4. 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.)
  5. 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 dependencies
  • 1 — new test failures OR dangerous dependencies
  • 2 — catch itself couldn't run (not a git repo, etc.)

License

MIT

Metadata

Release files for catchdev 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for catchdev 0.1.1
File Size Uploaded Provenance Actions
catchdev-0.1.1.tar.gz 20.9 kB Without provenance Details for catchdev-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for catchdev 0.1.1
File Interpreter ABI Platform Actions
catchdev-0.1.1-py3-none-any.whl Python 3 none any Details for catchdev-0.1.1-py3-none-any.whl

Total release size: 40.7 kB

Release files / catchdev-0.1.1.tar.gz

Download URL catchdev-0.1.1.tar.gz
Size 20.9 kB
Tags Source
SHA-256 checksum
How to use checksums
3dabe0c50edb95903ce4d1a3baadc48765fc4ab26bda660d203ed7493c4bf2d1
BLAKE2b-256 checksum
How to use checksums
b29bfae66c7e3bc2c9935941645b4b40d79c60f4640b38b6357c6522824fed62
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.1-py3-none-any.whl

Download URL catchdev-0.1.1-py3-none-any.whl
Size 19.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e47312e8d620ed32df38a7cb3cc0cc13d3d410e0bc97833c3913d5cb8af48e23
BLAKE2b-256 checksum
How to use checksums
4d26a4500058d8202abce0c0de13760526bccb3483fd50457772cce8cbccabda
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.1

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page