How It Works
Understand GitSniff's multi-step code review analysis pipeline.
GitSniff's code review follows a sophisticated multi-step pipeline designed to provide thorough, accurate feedback.
Step 1: Pre-analysis
When a PR is created or updated, a fast AI model quickly scans the changes to:
- Assess the overall risk level of the changes
- Identify which types of issues might be present
- Recommend which security scanning tools should run
- Determine the optimal model for deep analysis
This step uses a lightweight model to keep costs low and response times fast.
Step 2: Security scanning
Based on pre-analysis recommendations, GitSniff runs the appropriate security tools in parallel:
| Tool | What it scans |
|---|---|
| Bearer | Sensitive data exposure, API keys, credentials |
| Semgrep | Code patterns, anti-patterns, language-specific issues |
| Trivy | Dependency vulnerabilities, container security |
| Lint | Code style and formatting issues |
Only relevant tools are run based on the changes in the PR, keeping scan times minimal.
Step 3: AI analysis
The selected AI model performs a comprehensive review that considers:
- The code diff (added, modified, and removed lines)
- Security scan results from Step 2
- Repository context (if enabled)
- Custom instructions (if configured)
- The programming language and framework being used
The model produces:
- A risk score (0-100)
- Categorized findings (bugs, security, performance, style)
- Suggested improvements with code examples
- An overall assessment
Step 4: Results delivery
GitSniff delivers the results back to your pull request:
- Inline comments on specific lines of code
- PR summary in the pull request description
- Status check (clean, issues, or critical)
- Review comment with the full analysis
Model selection
GitSniff can automatically select the best model based on PR size:
| PR Size | Typical model tier | Use case |
|---|---|---|
| Small (< 100 lines) | Flash | Quick changes, typo fixes |
| Medium (100-500 lines) | Balanced | Feature additions, refactors |
| Large (500+ lines) | Powerful | Major features, architecture changes |
You can override this with manual model selection or configure size-based preferences in your settings.