We use only essential, cookie‑free logs by default. Turn on analytics to help us improve. Read our Privacy Policy.
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 diffsemantic-diff
WhatLines added/removedSame
WhyIntent behind the change
RiskWhat could break, edge cases
ImpactDirect and indirect effects
ReviewQuestions to ask the author

Quick Start

1

Install

pip install semantic-diff
2

Set API key

export ANTHROPIC_API_KEY=sk-ant-...
3

Analyze a commit

semantic-diff HEAD
4

Enable auto-analysis before every push

semantic-diff init

How 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 --json

Automatic Pre-Push Hook

One command to install. Every push triggers analysis automatically — reports saved to your project.

semantic-diff initgit push # analysis runs automatically

GitHub 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: high

What 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
Semantic Diff analysis example

Try it now

pip install semantic-diff

MIT License — free for any use

Need custom integration? Contact us