Skip to main content

diffsplainer

Diff explanations for GitHub pull requests, powered by Claude Code.

Open a PR and the app shows its diff split into logical chunks on the right. On the left, next to each chunk, is Claude's explanation of what the change does, why it's made, and anything worth checking.

Run

Requirements: Python 3.11+, uv, and the Claude Code CLI (claude), logged in.

uvx diffsplainer

Then open http://localhost:3000.

Private repos need you to be logged in with the GitHub CLI (gh auth login), or to set GITHUB_TOKEN. If you log in with gh after starting the app, restart it.

Open a PR in either of these ways:

  • paste the PR URL into the address field, or
  • swap github.com for the app's host in the browser address bar: http://localhost:3000/owner/repo/pull/123

To open any GitHub PR with one click, drag the Diffsplain link from the start page to your bookmarks bar, then click it on a PR page.

The address bar always shows the PR you're reviewing, so links can be shared. To change how many related PRs Claude reads, add ?prs=N (0–10, default 3) to the address.

How it works

The app fetches the PR from GitHub and splits each file's diff into chunks. Claude Code explains each chunk, and the explanation appears next to the chunk as soon as it is ready.

Claude also gets the PR description, the project's instruction files (such as CLAUDE.md and AGENTS.md) and a few earlier merged PRs that touched the same files. The "Context given to Claude" panel lists the ones it used.

The app runs Claude Code without your own MCP servers, hooks, slash commands and CLAUDE.md, so each call stays small. Closing or reloading the page stops the Claude calls it started.

To look up a word or phrase in an explanation, select it and click Explain. A popup shows what it means in general and what it does in this PR.

Opening the same PR again reuses the explanations while its commits stay the same. The app drops them when it restarts, or when it makes room for newer PRs (it keeps 50). Editing the PR title or description does not refresh them.

Code in the diff is syntax-highlighted for common languages, chosen by file extension.

PRs over 1,000 changed lines show the diff without explanations. Set MAX_CHANGED_LINES to change the limit.

Configuration

Env var Default Purpose
PORT 3000 HTTP port. The app listens on 127.0.0.1 only.
GITHUB_TOKEN / GH_TOKEN GitHub CLI token GitHub API auth
GITHUB_API https://api.github.com API base URL (for GitHub Enterprise)
CLAUDE_BIN claude Path to the Claude Code CLI
CLAUDE_MODEL sonnet Model passed to --model. The app ignores the model set in your Claude Code settings.
CLAUDE_CONCURRENCY 6 Parallel Claude calls
CLAUDE_TIMEOUT_MS 240000 Timeout for each Claude call
MAX_CHANGED_LINES 1000 Largest PR (additions plus deletions) that gets explanations

The app uses only the Python standard library. The browser UI is plain HTML/CSS/JS in src/diffsplainer/static/.

Development

To run the app from a clone of the repository:

git clone https://github.com/svandragt/diffsplainer
cd diffsplainer
uv run diffsplainer            # http://localhost:3000

Without uv: PYTHONPATH=src python -m diffsplainer.

Metadata

Release files for diffsplainer 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for diffsplainer 0.1.0
File Size Uploaded Provenance Actions
diffsplainer-0.1.0.tar.gz 55.7 kB With provenance Details for diffsplainer-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for diffsplainer 0.1.0
File Interpreter ABI Platform Actions
diffsplainer-0.1.0-py3-none-any.whl Python 3 none any Details for diffsplainer-0.1.0-py3-none-any.whl

Total release size: 115.1 kB

Release files / diffsplainer-0.1.0.tar.gz

Download URL diffsplainer-0.1.0.tar.gz
Size 55.7 kB
Tags Source
SHA-256 checksum
How to use checksums
4ab8134d180d24a226b5f5126e97e10d1b1da402c84e9d14a0a0af27f3289f3c
BLAKE2b-256 checksum
How to use checksums
90a350a376a6110f0e73bcb013ef2e44e5ac43ba8f7d06fd9a28e0b96134b2a4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.

Transparency log

Release files / diffsplainer-0.1.0-py3-none-any.whl

Download URL diffsplainer-0.1.0-py3-none-any.whl
Size 59.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d0ca6a93e36f78168984c7bbea3de3e6c69e6146c8a1eb586c74b62770acc7a7
BLAKE2b-256 checksum
How to use checksums
cefc18553caa804b20ade67a7a8aca8aacaeab40373dd55359c3dc1aa5af6841
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.

Transparency log

Security for diffsplainer 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for diffsplainer-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page