I built a multi-agent code review system on the Anthropic Claude SDK that integrates directly with GitHub Actions to autonomously analyze every pull request for security vulnerabilities and code quality issues, then posts structured findings as PR comments with zero manual intervention.

Multi-Agent PR Review

The system uses the Claude SDK’s agent orchestration to run specialized sub-agents in parallel: one focused on security vulnerability detection, one on code quality, and one that synthesizes findings into a readable summary. All results are posted directly as structured PR comments through the GitHub API, triggered automatically on every pull request open and update event.

Agentic Onboarding Pipeline

A key challenge for any code review agent is understanding an unfamiliar codebase before it can reason about changes meaningfully. I designed an onboarding pipeline that uses AI tool use to autonomously explore unknown repositories and generate complete technical documents covering architecture, conventions, and patterns. Document generation runs in parallel using asyncio, and results are cached by file structure hash so that subsequent runs on the same codebase skip the generation step entirely. This cut pipeline runtime by 3x and eliminated redundant API calls on re-runs.

Cost Optimization and Resilience

Running an agent on every pull request makes cost and reliability production concerns rather than nice-to-haves. I optimized the system by routing tasks to complexity-matched models, directing simpler checks to cheaper models and reserving more capable models for nuanced reasoning. This reduced per-PR cost by 23% without sacrificing coverage.

For resilience, I implemented graceful degradation so that individual agent failures surface as informative comments rather than silent crashes or pipeline failures. Teams can also configure agent behavior through a YAML file, adjusting thresholds, enabled checks, and model preferences without touching code.