AI-powered code review for your GitHub pull requests — powered by critiq
Add instant AI code review to any repository in under 5 minutes. critiq analyzes your PR diff and posts a review comment with findings categorized by severity — before your teammates even look at it.
🔴 CRITICAL auth.py:42 SQL injection risk: user input concatenated directly into query
⚠️ WARNING api.py:15 Missing input validation on POST /users endpoint
💡 INFO utils.py:8 Consider using a context manager for file handling
- 🤖 AI-powered — understands code intent, not just style
- 🏠 Local LLM support — use Ollama for fully private, zero-cost reviews
- 🎯 Focus modes — review for security, performance, correctness, or all
- 💬 PR comments — posts findings directly on the pull request
- 📋 Step Summary — results visible in the Actions tab
- 🚦 CI gate — fails the workflow if CRITICAL issues are found
- ⚡ Fast — typically completes in under 60 seconds
# .github/workflows/critiq.yml
name: critiq Code Review
on:
pull_request:
branches: [main, master]
permissions:
pull-requests: write # required for posting PR comments
jobs:
review:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # required for git diff
- uses: faw21/critiq-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}That's it. Add ANTHROPIC_API_KEY to your repository secrets and you're done.
| Input | Description | Default |
|---|---|---|
anthropic_api_key |
Anthropic API key (Claude) | '' |
openai_api_key |
OpenAI API key | '' |
provider |
LLM provider: claude, openai, ollama |
claude |
model |
Model name (uses provider default if not set) | '' |
focus |
Review focus: all, security, performance, readability, correctness, style |
all |
severity |
Minimum severity to show: critical, warning, info, suggestion |
warning |
fail_on_critical |
Fail the workflow if CRITICAL issues are found | true |
post_comment |
Post review as a PR comment | true |
github_token |
GitHub token for posting comments | github.token |
| Output | Description |
|---|---|
has_critical |
true if CRITICAL issues were found, false otherwise |
- uses: faw21/critiq-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
focus: security
severity: critical # only show critical security issues- uses: faw21/critiq-action@v1
with:
openai_api_key: ${{ secrets.OPENAI_API_KEY }}
provider: openai
model: gpt-4o# Requires a self-hosted runner with Ollama installed
- uses: faw21/critiq-action@v1
with:
provider: ollama
model: qwen2.5:7b
post_comment: 'false' # no API key needed- uses: faw21/critiq-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
fail_on_critical: 'false'- uses: faw21/critiq-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
focus: readability
severity: info
fail_on_critical: 'false'- uses: faw21/critiq-action@v1
id: critiq
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
fail_on_critical: 'false' # don't fail automatically
- name: Notify Slack if critical issues
if: steps.critiq.outputs.has_critical == 'true'
run: |
curl -X POST ${{ secrets.SLACK_WEBHOOK }} \
-d '{"text": "⚠️ critiq found CRITICAL issues in PR #${{ github.event.pull_request.number }}"}'critiq-action requires the following permissions to post PR comments:
permissions:
pull-requests: writeIf you only want the Step Summary output (no PR comments), set post_comment: 'false' and no extra permissions are needed.
actions/checkoutchecks out the PR branch- critiq fetches the base branch (
github.base_ref) and runsgit diff - The diff is sent to your chosen LLM provider for analysis
- Results are written to the GitHub Step Summary and optionally posted as a PR comment
- The action exits with code
1if CRITICAL issues are found (whenfail_on_critical: true)
- Your code diff is sent to the LLM provider you configure (Anthropic or OpenAI)
- For fully private reviews, use
provider: ollamaon a self-hosted runner - API keys are passed as environment variables and never logged
critiq is part of a developer workflow toolkit:
| Tool | Purpose |
|---|---|
| critiq | AI code review before you push (local CLI) |
| critiq-action | AI code review in CI (this action) |
| gpr | AI-generated commit messages & PR descriptions |
| prcat | AI review of incoming PRs from teammates |
| gitbrief | Pack codebase context for LLMs |
| standup-ai | Generate daily standups from git history |
| changelog-ai | AI-generated changelogs from git history |
- mergefix — AI merge conflict resolver | chronicle | Turn git history into readable stories | | difftests | AI-generated tests from git diffs | | testfix | Automatically fix failing tests with AI |
MIT