Deterministic API regression checks for AI agents: snapshot a baseline, catch broken contracts.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent — or use 1-click editor setup below.
💡 Paste into ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
Before you commit, know what broke.
When an AI coding agent edits your app it can silently break an API contract — a removed field, a changed status code, a test that now fails — and still report success. RegressGuard records a known-good baseline and tells you (or the agent) exactly what regressed.
It is built to live inside the agent's own loop. RegressGuard ships as an MCP server, so agents like Claude Code and Cursor can verify their own work and self-correct before a human ever sees the diff — zero extra steps. The same engine also runs as a plain CLI for humans and CI.

Break → detect → fix → green. Reproduce it yourself: ./demo/demo.sh.
macOS / Linux (recommended)
Homebrew
Verify
Have ripgrep installed? ripgrep also ships as
rg, and whichever comes first on PATH wins —rg checkcould silently run ripgrep instead of RegressGuard. Ifrg versiondoesn't say "RegressGuard", invoke the full path (e.g./usr/local/bin/rg). The pre-commit hook and GitHub Action already use absolute paths and are unaffected;rg doctorflags the collision.
RegressGuard detects your test command, framework, and dev server URL automatically.
Make sure your dev server is running, then:
Output:
Let Claude Code, Cursor, or Codex make its changes.
Clean — safe to commit:
Regression found — commit blocked:
Exit code 1 on critical — works with git hooks and CI.
Now rg check runs automatically before every git commit. When a critical regression is detected, the commit is blocked with a compact output:
Bypass with git commit --no-verify only when you accept the risk.
This is RegressGuard's primary mode. Instead of waiting for a human to run rg check, the AI agent calls it as a tool inside its own edit loop — so it catches and fixes regressions it just introduced, before handing the change back to you.
Start the server (stdio transport):
Register with Claude Code:
Register with Cursor (.cursor/mcp.json):
The agent then has three tools:
| Tool | Purpose |
|---|---|
snapshot | Record the current passing state as the baseline |
check | Compare current state against the snapshot; returns structured findings with severity |
status | Sub-second health check (snapshot age, route/config/hook status) — no tests run |
Tool responses are the same machine-readable payload as rg check --json — see docs/json-contract.md. Every tool call is recorded to an append-only audit log under .regressguard/ (tool, status, duration, timestamp).
A typical loop: the agent edits code → calls check → reads the structured findings → fixes the regression → calls check again → only then reports done.
| Command | Purpose |
|---|---|
rg init | Configure RegressGuard for this project |
rg quickstart | Auto-configure and snapshot in one command |
rg snapshot | Record the current passing state |
rg check | Compare current state against the snapshot |
rg status | Sub-second health check (snapshot age, routes, hook) — no tests run |
rg explain <route> | Show before/after diff for a specific route |
rg watch | Watch files and auto-run check on changes |
rg mcp serve | Run the MCP server so AI agents can self-verify (see above) |
rg hook install | Install the pre-commit git hook |
rg hook uninstall | Remove the git hook |
rg config get <key> | Read a config value |
rg config set <key> <value> | Write a config value |
rg doctor | Diagnose setup issues |
rg upgrade | Update rg to the latest version |
rg completion <shell> | Generate shell autocompletions (bash, zsh, fish) |
rg version | Print version and build metadata |
Run rg <command> --help for flags, examples, and exit codes.
Config lives in .regressguard/config.json (human-readable, git-ignoreable).
Auth modes: bearer (Authorization header), cookie (Cookie header), or omit for public routes only.
ignoreFields: Fields to exclude from schema comparison — useful for volatile app-specific values like requestId or traceId.
rg snapshot runs your test suite and hits each configured route. It records pass/fail counts, HTTP status codes, and a normalized schema hash for each response.
rg check reruns the same tests and routes, then diffs against the snapshot:
Schema comparison automatically normalizes JSON payloads:
id, uuid, token, nonce, timestamp, createdAt, updatedAt, deletedAt, created_at, updated_at, deleted_at, sessionId, accessToken, refreshToken, expiresAt, expires_at) before hashing."date", "uuid", "token").ignoreFields defined in config.This ensures the shape integrity of endpoints remains stable across runs even when database IDs and timestamps change.
A route whose only change is a non-blocking WARNING (e.g. a timing regression) is reported on its own line and is not counted in the "Routes: N unchanged" summary or in summary.passed of --json output.
These are deliberate trade-offs in v1 — favoring zero false positives over exhaustive detection. They are on the roadmap, not accidental:
rg check records failing test names (jest, vitest, bun, go test output) and flags a CRITICAL when a test that passed at baseline starts failing — even if the net failure count is unchanged. When names cannot be parsed from your runner's output (or the baseline predates name recording), it falls back to count comparison: a CRITICAL only when the number of failing tests increases. Pair rg check with your normal test runner in CI for exhaustive per-test assertions.| Code | Meaning |
|---|---|
0 | Pass or warnings only — safe to commit |
1 | Critical regression detected — commit blocked |
2 | Usage, config, or runtime error |
GitHub Action — runs rg check on every PR and comments the findings:
See action.yml for all inputs (version pinning, working directory, server URL).
Python, FastAPI, and Django support is planned for v2.
A minimal Next.js API fixture is included in fixtures/nextjs-app for demos and testing. See fixtures/README.md.
This repo — the CLI and MCP server — is free and MIT, forever. A hosted team layer
(cross-repo dashboard, history retention, compliance export) is scoped in
docs/paid-layer-spec.md. Anything that runs on one machine for
one repo stays free; the paid layer is strictly additive.
See CHANGELOG.md for release history.
MIT — see LICENSE.
From the same developer as git-scope.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/regressguard)<a href="https://allmcps.com/mcp/regressguard"><img src="https://allmcps.com/api/badge/regressguard?style=directory" alt="Regressguard on AllMCPs" /></a>