Catching Bugs Before Review

Creating a repeatable system for finding bugs, verifying security, and improving code quality.

Claude CodeGitAutomation

Castle Combe, EnglandPhoto: Jeremy Swagger

Regression Inspector, the internal version of Bug Hunter, now runs on every ticket I work on our enterprise platform. Across my last 10 tickets, spanning 7 repositories, it scanned 339 changed files, surfaced 73 suspicious findings, and flagged 22 probable bugs, roughly two per ticket, before a pull request was opened. Eighteen of those were confirmed as real bugs and fixed before a pull request was opened.

18 Bugs caught before review

82% Of flagged bugs confirmed

339 Files scanned

7 Repositories

Regression Inspector, last 10 tickets

Workflow diagram: a feature branch feeds a git merge-base diff, which fans out to three review skills. Bug Hunter gathers evidence, runs a two-pass review and writes a tiered report. Code Sweeper and Security Auditor scan patterns, run an agent review and write tiered reports. All three lead to the developer, who decides what to fix before opening a PR.

Catching problems before peer review.

Most code issues come to light too late, whether it's a missing guard post-refactor or a changed function signature wreaking havoc. I wanted a proactive approach to catch these problems before they reach peer review.

Giving AI agents focused jobs.

I harness AI to tackle what humans often miss. Instead of a blanket "review my code," I broke it down into three focused skills: Bug Hunter (for regressions and bugs), Security Auditor (for vulnerabilities), and Code Sweeper (for clean-code practices). Each skill excels in its area while referring to others for comprehensive insights.

Scripts gather evidence. Agents make judgments.

Every probable bug needs a concrete failure scenario.

I developed scripts to gather evidence, allowing the agents to make informed judgments. Using Node.js, I collect diffs that reflect only my changes and let scanners highlight potential issues like removed guards or risky patterns. The agents then analyze this information, treating initial matches as candidates rather than confirmed problems. Bug Hunter takes it a step further by interpreting acceptance criteria and generating edge cases for checks. It ranks findings to prioritize the riskiest changes first, ensuring every probable bug includes a concrete failure scenario. I maintain control over decisions, with auto-fixing turned off.

A proven, open-source review toolkit.

My toolkit, including Regression Inspector (the internal Bug Hunter), has proven effective. In recent projects, it scanned 339 files, identified 73 suspicious findings, and flagged 22 probable bugs before pull requests were even opened. The skills are open-source, well-tested, and built on Node.js.

Better code before review, not after.

Catching issues before they reach review means faster cycles, fewer regressions, and allowing reviewers to focus on broader architectural intent rather than nitty-gritty bugs. Plus, the toolkit is transparent; it shows its evidence, clarifies likely issues, and keeps developers accountable for their code. AI accelerates the review process while preserving human insight.