Semantic Code Analysis for Pull Request Review
CLI tool that explains why code changed, not just what changed, with risk assessment and review questions.
Key Results
The Problem
git diff tells you *what* changed. But as a developer or reviewer, you need to understand:
- Why was this change made?
- What could break?
- What questions should I ask the author?
Traditional diffs show lines added and removed. They don't show intent, risk, or impact.
The Solution
CLI tool that analyzes git commits using LLMs to provide semantic understanding of code changes.
Intent detection — what the developer was trying to accomplish (not what changed, but *why*).
Impact mapping — direct and indirect effects on the system.
Risk assessment — what could break, edge cases, breaking changes with suggested mitigations.
Review questions — smart questions a reviewer should ask the author, prioritized by risk level.
How It Works
The pipeline extracts commit info, file changes, project context, and diff content from git. This feeds into an LLM analyzer that produces structured output: intent with confidence score, impact map, risk assessment, and review questions.
Output formats include rich terminal display with progress bars and visual hierarchy, markdown reports for archiving, and JSON for CI/CD integration.
Technical Architecture
Clean separation following SOLID principles:
- Parsers — Git data extraction via GitPython
- Analyzers — LLM-based semantic analysis with Claude
- Formatters — Rich terminal output and markdown generation
- Models — Pydantic for type safety and validation
What Makes It Different
| Traditional Diff | Semantic Diff |
|---|---|
| Shows lines changed | Shows *why* they changed |
| No risk assessment | Identifies edge cases and breaking changes |
| Reader interprets impact | Maps direct and indirect impacts |
| No review guidance | Generates prioritized review questions |
Use Cases
Code Review — understand commits before reviewing, focus on what matters.
PR Analysis — assess risk before merging, flag high-risk commits automatically.
Onboarding — help new developers understand commit history and codebase evolution.
Documentation — generate semantic changelogs that explain changes, not just list them.
CI/CD Integration — automatic risk flagging in pull request pipelines.
Results
- Review time reduction — reviewers focus on actual risks, not parsing diffs
- Better questions — AI-generated review questions surface issues humans miss
- Institutional knowledge — reports document *why* changes were made, not just what
Used internally for all code review and available as part of our DevOps consulting practice.
