Open SourcePyPI
semantic-diff
AI-powered semantic analysis of git commits. Goes beyond git diff to show intent, impact, risk, and review questions.
pip install semantic-diffView on GitHub →What it does
Regular git diff shows what changed. semantic-diff shows why it matters.
| git diff | semantic-diff | |
|---|---|---|
| What | Lines added/removed | Same |
| Why | — | Intent behind the change |
| Risk | — | What could break, edge cases |
| Impact | — | Direct and indirect effects |
| Review | — | Questions to ask the author |
Quick Start
1
Install
pip install semantic-diff2
Set API key
export ANTHROPIC_API_KEY=sk-ant-...3
Analyze a commit
semantic-diff HEAD4
Enable auto-analysis before every push
semantic-diff initHow it works
Manual Analysis
Analyze any commit on demand. Output as Markdown or JSON. Save reports to your project.
semantic-diff HEADsemantic-diff abc123 --savesemantic-diff HEAD --jsonAutomatic Pre-Push Hook
One command to install. Every push triggers analysis automatically — reports saved to your project.
semantic-diff initgit push # analysis runs automaticallyGitHub Action
Add to your CI/CD. Analyze every PR automatically, post comments, block merge on high risk.
GitHub Action
Add to your workflow to analyze PRs automatically:
# .github/workflows/semantic-diff.yml
name: Semantic Diff
on: [pull_request]
jobs:
analyze:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: tkenaz/[email protected]
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
comment_on_pr: true
fail_on_risk: highWhat you get
Each analysis generates a structured report:
- Commit metadata and change summary
- Intent analysis with confidence score
- Impact map — direct and indirect effects
- Risk assessment with mitigations
- Review questions prioritized by importance

Try it now
pip install semantic-diffMIT License — free for any use
Need custom integration? Contact us
