pr0h0
AI / Developer Tools

CodeGuardian

A self-hosted AI pull-request reviewer: a GitHub App that reviews PRs with Claude, Codex or any OpenAI-compatible model, runs static analysis, and can commit fixes and tests on request.

CodeGuardian started as a local CLI for security-focused code review. It is now a self-hosted AI pull-request reviewer that runs as a GitHub App on my own machine.

PRs into a repo's default branch are reviewed automatically when they are opened, updated or marked ready, and later pushes get incremental reviews of only what is new. Reviews go through the Claude Agent SDK (a Claude subscription, an Anthropic API key or OpenRouter), OpenAI's Codex SDK, or any OpenAI-compatible endpoint, with a fallback chain between them. In agentic mode the reviewer can read the whole repository read-only, not just the diff.

Everything else happens in PR comments: @codeguardian review, fix, fix all, generate tests, learn <rule>, or any question about the change. A web UI covers organisations, repositories and seats, review guidance and gates, team metrics, and on-demand security audits.

Per-repo rules live in .codeguardian.yaml, which is read from the PR's base branch so a PR cannot change its own review rules.

Key features

  • Automatic and incremental reviews of PRs into the default branch, with debounce, draft and author/label filters
  • Several model backends: Claude Agent SDK, OpenAI Codex SDK or any OpenAI-compatible API, with a fallback chain
  • Agentic review that reads the whole repo read-only, plus static analysis and linters
  • Commands in comments: review, full review, fix, fix all, generate tests, resolve, pause/resume and free-form questions
  • Learnings: rules saved from comments, optionally scoped to paths, applied to future reviews
  • Approval by risk: approve or request changes based on finding severity and merge risk, with stricter rules for sensitive paths
  • Pre-merge checks for titles, descriptions and linked issues, and an auto-written PR summary
  • Web UI with organisations and seats, team metrics, CSV export, a digest and security audits
  • Secrets and personal data detection, including commit history