← All projects

PushGuard

AI code review on every git push, with three strictness presets and a fail-open design that never blocks a push.

A terminal where PushGuard blocks a git push and lists one error and one warning.

Problem

Bugs and security issues often reach the remote before anyone has reviewed the change.

Approach

A git pre-push hook that sends the diff to an OpenAI, Anthropic or Gemini model and reports what it finds before the push goes out. An interactive CLI installs the hook and edits the configuration.

  • Three presets: strict (bugs, security, performance and code quality), balanced (bugs and security) and permissive (critical issues only).
  • Model and preset can be overridden per review from the command line.

Key decisions

  • Fail-open: if the review service is unavailable, the push goes through with a warning instead of blocking the developer.
  • Safe YAML parsing, validation of git commands and file paths against command injection and path traversal, and sanitised error messages.

Next

  • Cache reviews for unchanged diffs and review only changed files.
  • Support local models (Ollama) and run in CI on pull requests.
© 2026 / Vasco Neves