/smart-diff:smart-difffrom smart-diff
Use when the user asks to "summarize this diff", "summarize my branch changes", "write a PR description from the diff", "what changed between these refs", or "draft release notes from git history". Runs the smart-diff CLI (@mcarvin/smart-diff) to produce a Markdown summary of a git range using the user's own LLM provider, with built-in handling for large diffs (map-reduce, token reduction), commit-message filtering, and secret redaction. Requires Node.js 22.22.1+ and an LLM provider credential in environment variables. Works in any agent that can run shell commands.
Ships in smart-diff. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Summarize the changes in a git range as Markdown with the smart-diff CLI.
The CLI reads the repository directly (no git binary needed), sends the diff
to the LLM provider configured in the user's environment, and prints the
summary to stdout.
--map-reduce instead of losing the tail.For a small diff with no such needs, reading git diff yourself is fine.
node --version is 22.22.1 or newer.OPENAI_API_KEY, ANTHROPIC_API_KEY, GOOGLE_GENERATIVE_AI_API_KEY,
LLM_BASE_URL, AWS_ACCESS_KEY_ID / AWS_PROFILE.
The full list is in references/options.md.smart-diff-claude skill if it is
available. It runs the same pipeline with --emit-context and you write
the summary, so no key is needed. Otherwise, stop and tell the user which
variables they can set. Never ask the user to paste a key into the chat,
and never write a key to a file.| User intent | Command arguments |
|---|---|
| "my branch" / "this PR" vs main | main HEAD --merge-base |
| Since a tag or release | v1.2.0 HEAD |
| Between two specific refs | <from> <to> |
| Only part of the repo | add --include <path> (repeatable) |
| Only feature/fix commits | add --commit-include "^(feat|fix)" |
If the default branch is not main, use the repository's actual default
branch (for example origin/main, master, or develop).
Use the locally installed CLI if the project has it, otherwise npx:
npx @mcarvin/smart-diff <from> [to] --redact-secrets --exclude-default-noise
--redact-secrets. It masks likely credentials in the diff
before it is sent to the provider.--exclude-default-noise skips lockfiles, dist/, build/, coverage/,
and node_modules/.--map-reduce --max-diff-chars 20000, and optionally
--context-lines 1 --ignore-whitespace to cut tokens.--provider <id> or --model <id> only if the user asks for a
specific provider or model.--prompt-file <path>. It is appended to the built-in prompts, including
every map-reduce batch. Prefer it over --system-prompt, which replaces
the built-in prompt.--map-reduce.git fetch or a different ref.--max-retries 4.references/options.md lists every CLI flag and provider environment
variable.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub mcarvin8/smart-diff --plugin smart-diff2 skills in this plugin