RegressGuard
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@RegressGuardcheck for regressions after my latest changes"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
RegressGuard
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.
# Agent-native (primary): the agent calls these as MCP tools in its loop
check → status # see "Agent-native verification (MCP)" below
# the baseline stays yours: agents cannot re-record it
# Human / CI (also works): two commands, no test-writing, under 15 seconds
regressguard snapshot # record the known-good state
regressguard check # compare after edits — see what broke
Break → detect → fix → green. Reproduce it yourself: ./demo/demo.sh.
Install
macOS / Linux (recommended)
curl -fsSL https://raw.githubusercontent.com/Bharath-code/regressguard/main/install.sh | shVerify
regressguard version # first line must say "RegressGuard"Upgrading from v0.1.x? The binary was renamed from
rgtoregressguardbecausergcollides with ripgrep. There is norgshim and the oldrg upgradecan't fetch v0.2.0: re-run the installer, delete the oldrg, then runregressguard hook install(old hooks callrg;regressguard doctorflags them).
Related MCP server: BumpGuard
Quickstart (3 minutes)
1. Initialize your project
cd your-project
regressguard initRegressGuard detects your test command, framework, and dev server URL automatically.
2. Record the baseline before your AI session
Make sure your dev server is running, then:
regressguard snapshotOutput:
Snapshot
OK Tests 42 passed, 0 failed 6.8s
OK Routes 6 captured, 2 skipped
OK Schemas 6 hashed
Saved:
.regressguard/snapshot.json
Next:
Ask your AI agent to make the code change, then run:
regressguard check3. Run your AI agent
Let Claude Code, Cursor, or Codex make its changes.
4. Check for regressions before committing
regressguard checkClean — safe to commit:
Check
OK No regressions detected
Tests 42 passed, 0 failed
Routes 6 unchanged
Timing within tolerance
Safe to commit.Regression found — commit blocked:
Check
X 2 regressions detected
Route Before After Change
GET /api/users schema schema schema
- role (string, removed)
+ age (number, added)
POST /api/user/update 200 500 status
Likely cause:
Auth/session behavior or routing changed during the last code edit.
Changed files since snapshot:
app/api/users/route.ts
internal/auth/session.go
Next:
regressguard check --verbose
git diff
Commit blocked.Exit code 1 on critical — works with git hooks and CI.
Git Hook (auto-protect every commit)
regressguard hook installNow regressguard check runs automatically before every git commit. When a critical regression is detected, the commit is blocked with a compact output:
RegressGuard pre-commit
X 1 regression detected
POST /api/user/update status changed from 200 to 500
Run:
regressguard check --verbose
Commit blocked. Use --no-verify only if you accept the risk.Bypass with git commit --no-verify only when you accept the risk.
Agent-native verification (MCP)
This is RegressGuard's primary mode. Instead of waiting for a human to run regressguard 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):
regressguard mcp serveRegister with Claude Code:
claude mcp add regressguard -- regressguard mcp serveRegister with Cursor (.cursor/mcp.json):
{
"mcpServers": {
"regressguard": { "command": "regressguard", "args": ["mcp", "serve"] }
}
}The agent then has two tools:
Tool | Purpose |
| Compare current state against the snapshot; returns structured findings with severity |
| Sub-second health check (snapshot age, route/config/hook status) — no tests run |
The baseline is human-owned. Agents get no snapshot tool by default. If they
could re-record the baseline, an agent could accept its own regression
(check fails → snapshot → check passes). You record the baseline with
regressguard snapshot. To let agents re-baseline anyway, set this in
.regressguard/config.json and restart the MCP server:
{ "mcp": { "allowSnapshot": true } }Tool responses are the same machine-readable payload as regressguard 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.
Commands
Command | Purpose |
| Configure RegressGuard for this project |
| Auto-configure and snapshot in one command |
| Record the current passing state |
| Compare current state against the snapshot |
| Sub-second health check (snapshot age, routes, hook) — no tests run |
| Show before/after diff for a specific route |
| Watch files and auto-run check on changes |
| Run the MCP server so AI agents can self-verify (see above) |
| Install the pre-commit git hook |
| Remove the git hook |
| Read a config value |
| Write a config value |
| Diagnose setup issues |
| Update regressguard to the latest version |
| Generate shell autocompletions (bash, zsh, fish) |
| Print version and build metadata |
Run regressguard <command> --help for flags, examples, and exit codes.
Configuration
Config lives in .regressguard/config.json (human-readable, git-ignoreable).
{
"version": 1,
"testCommand": "npm test",
"serverUrl": "http://localhost:3000",
"auth": {
"mode": "bearer",
"testToken": "your-test-token",
"headerName": "Authorization",
"prefix": "Bearer"
},
"ignoreFields": ["requestId", "traceId"],
"routes": [
{ "method": "GET", "path": "/api/health" },
{ "method": "GET", "path": "/api/users" },
{ "method": "GET", "path": "/api/admin", "skip": true }
]
}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.
How it works
regressguard snapshotruns your test suite and hits each configured route. It records pass/fail counts, HTTP status codes, and a normalized schema hash for each response.regressguard checkreruns the same tests and routes, then diffs against the snapshot:CRITICAL: test suite newly failing, status code changed, response schema changed (e.g. field removed/added/changed)
WARNING: response time increased >200ms and >50% of baseline
PASS: everything within acceptable variance
Schema comparison automatically normalizes JSON payloads:
Default Dynamic Keys: Strips 16 common dynamic keys (
id,uuid,token,nonce,timestamp,createdAt,updatedAt,deletedAt,created_at,updated_at,deleted_at,sessionId,accessToken,refreshToken,expiresAt,expires_at) before hashing.Pattern Detection: Automatically detects ISO-8601 date strings, UUIDs, and JWTs, replacing them with generic type representations (
"date","uuid","token").User Customization: Respects custom
ignoreFieldsdefined 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.passedof--jsonoutput.
Known limitations
These are deliberate trade-offs in v1 — favoring zero false positives over exhaustive detection. They are on the roadmap, not accidental:
Test identity comparison is best-effort.
regressguard checkrecords 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. Pairregressguard checkwith your normal test runner in CI for exhaustive per-test assertions.Array schemas are inferred from the first element. The schema normalizer represents a JSON array's shape using its first element. If later elements have a different shape (heterogeneous arrays), that divergence is not reflected in the schema hash and will not be flagged.
Exit codes
Code | Meaning |
| Pass or warnings only — safe to commit |
| Critical regression detected — commit blocked |
| Usage, config, or runtime error |
Scripting and CI
# JSON output for scripts and agents
regressguard check --json | jq .status
# Verbose diagnostics on stderr (stdout stays clean JSON)
regressguard check --json --verbose
# Disable color for CI
NO_COLOR=1 regressguard checkGitHub Action — runs regressguard check on every PR and comments the findings:
- uses: Bharath-code/regressguard@v0
with:
server-command: npm run devOn pull requests the action compares against the snapshot committed on the base branch (regressguard check --base origin/main), so a PR that edits .regressguard/snapshot.json to hide a regression still fails. Require a human approval when the baseline changes with a CODEOWNERS rule:
/.regressguard/snapshot.json @your-handleCommit .regressguard/snapshot.json (regressguard init adds .regressguard/* + !.regressguard/snapshot.json to .gitignore); everything else in .regressguard/ stays local.
See action.yml for all inputs (version pinning, working directory, server URL).
Supported stacks (v1)
Frameworks: Next.js App Router, Express, Hono
Test runners: Vitest, Jest, Bun test, npm test
Package managers: npm, pnpm, yarn, bun
Auth: Bearer token, Cookie header, public routes
Python, FastAPI, and Django support is planned for v2.
Demo fixture
A minimal Next.js API fixture is included in fixtures/nextjs-app for demos and testing. See fixtures/README.md.
Open core
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.
Changelog
See CHANGELOG.md for release history.
License
MIT — see LICENSE.
From the same developer as git-scope.
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP server for building and testing AI agents with multi-model experimentation and insights.
Monitor MCP servers, API contracts and AI outputs for schema drift. Alerts on breaking changes.
AgentGuard — 20-tool AI safety MCP: policy preflight, risk scoring, audit logging, rate limits.
MCP server for secureFlows: token-free URL builders and integration-linting tools for AI agents.
Related MCP Servers
- AlicenseAqualityAmaintenanceMCP server that lets coding agents test AI agents. Create YAML test cases, snapshot golden baselines, check for regressions, and generate visual reports all from inside Claude Code or any MCP-compatible tool. Works with LangGraph, CrewAI, OpenAI, Claude, Mistral, and any HTTP API.1058 npm704 PyPI136Apache 2.0
- AlicenseAqualityDmaintenanceBumpGuard is an MCP server that tells your AI coding agent exactly which lines of your code break when you upgrade a dependency, and verifies AI-written code against the actually installed API.64MIT
- AlicenseNot gradedqualityDmaintenanceMCP server that captures and recalls coding session memory (failures, decisions, diffs) for AI agents, enabling cross-agent continuity and preventing repeated mistakes.108 npmMIT
- AlicenseAqualityDmaintenanceAn MCP server that helps catch context drift in AI coding agents by comparing actual code changes against the original request, allowing users to keep or roll back unintended additions.2MIT