diffscope

Classifies git diff files and ranks hunks by deterministic rule-based risk scores.

Updated Jul 28, 2026
One-click install
npx skills add https://github.com/vinzenz/workflows --skill diffscope-vinzenz
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: diffscope
Source: https://github.com/vinzenz/workflows/tree/main/.agents/skills/diffscope
Command: npx skills add https://github.com/vinzenz/workflows --skill diffscope-vinzenz

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Raw git diff output mixes hand-written source changes with regenerated lockfiles, rebuilt bundles, and snapshot churn, forcing reviewers to read every hunk in file order with no signal about which ones are dangerous. diffscope classifies files by category, excludes generated noise by default, and ranks hunks by a deterministic, local, rule-based risk score so the hunks that matter surface first. ## Core Features & Use Cases - File classification: Categorizes files as source, lockfile, generated, snapshot, manifest, ci, test, docs, binary, conflict, or submodule, excluding generated noise by default. - Risk-ranked hunks: Scores every hunk with documented integer rule weights (path keywords, deletion-heavy, large hunk, CI file, manifest file, deleted test) and lists them highest-risk first with concrete reasons. - Auditable and offline: The scorer never calls an LLM or network; scores are reproducible byte-for-byte, and diffscope categories exposes the glob table for auditing. - Use Case: Before reviewing a pull request that touches source code plus a regenerated package-lock.json, run diffscope hunks --limit 5 to read only the five highest-risk hunks instead of all 40. ## Quick Start Ask the agent to run diffscope on the current working tree and show the highest-risk hunks before reviewing the change.

Frequently Asked Questions about diffscope

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find the risky parts of a large git diff?▼

Run `diffscope hunks` to list hunks ranked by a rule-based risk score, highest first, with `--limit N` to bound how much you read. Each row includes the score and the concrete reasons that produced it.

How to exclude lockfiles and generated files from git diff review?▼

diffscope excludes generated noise such as package-lock.json, dist/**, *.min.js, and *.snap by default in its `files` and `hunks` views. Use `--include-generated` when you specifically need to inspect that churn, and `.gitattributes` linguist-generated markers are honoured automatically.

Does diffscope use an LLM or network calls to score risk?▼

No. Every score is the sum of six documented integer rule weights computed locally, so results are instant, offline, and reproducible byte-for-byte from the same diff. Each row carries the reasons behind its score.

Can I diff against a branch or staged changes instead of HEAD?▼

Yes. Every read command accepts `--base <ref>` to compare against that ref, or `--staged` to compare the index against HEAD. The two flags are mutually exclusive.

What happens to merge conflicts and submodules in diffscope?▼

Unmerged conflict paths are never dropped; they get category `conflict` and always appear in files and hunks output. Submodule pointer bumps get category `submodule` and are not recursed into.

How do I customize which files diffscope treats as generated?▼

Run `diffscope categories` to see the glob patterns currently in effect, then add a `.diffscope.json` at the repo root to declare additional generated paths the built-in table does not catch.