diff-explainer

diff-explainer is a skill for Claude Code from thoughtbot/rails-consultant. It costs 27 tokens per session (2,386 once invoked), scanned A, original, MIT.

A change-explanation tool that turns a Git difference into a shareable HTML walkthrough. A Git difference, or diff, is the record of which lines were added, removed, or changed.

In plain words
What is it for?
Use it to explain the current branch against its base, including design choices, risks, trade-offs, and untracked files that a normal diff may omit.
Why use it?
A diff shows what changed but usually not why it changed, what alternatives were considered, or where the risks are. This adds that missing context for readers who did not make the change.

Skill for Claude Code

Written for Claude Code: argument-hint in frontmatter.

Part of the rails-consultant plugin — 15 skills shipped together

Good fit Use it to explain the current branch against its base, including design choices, risks, trade-offs, and untracked files that a normal diff may omit.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/thoughtbot/rails-consultant/diff-explainer
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add thoughtbot/rails-consultant --skill diff-explainer
Clone the repo
git clone --depth 1 https://github.com/thoughtbot/rails-consultant

Made for: Claude Code.

Or install rails-consultant, the plugin that ships this one along with the rest of its 15 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for diff-explainer

README.md
[![agentmods](https://agentmods.dev/badge/skills/thoughtbot/rails-consultant/diff-explainer/github.svg)](https://agentmods.dev/skills/thoughtbot/rails-consultant/diff-explainer)
Your own site
<a href="https://agentmods.dev/skills/thoughtbot/rails-consultant/diff-explainer"><img src="https://agentmods.dev/badge/skills/thoughtbot/rails-consultant/diff-explainer/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for diff-explainer

Your own site · 80×15
<a href="https://agentmods.dev/skills/thoughtbot/rails-consultant/diff-explainer"><img src="https://agentmods.dev/badge/skills/thoughtbot/rails-consultant/diff-explainer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 27 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,386 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00027 $0.02386
Opus 5.5 $0.00011 $0.00954
Sonnet 5.5 $0.00005 $0.00477
Haiku 4.5 $0.00003 $0.00239

Measured today against content hash c3a9c6f69b03, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

diff-explainer scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/diff-explainer/SKILL.md · 161 lines

How it starts

The opening of the file, as written. The whole thing — 161 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Diff explainer

The diff already shows what changed. What it can't show is why — why this approach and not the obvious one, what broke when you tried that, what you're nervous about, what you decided not to do. Supply that. Your reader is a sharp, time-poor developer who may not know this stack.

1. Work out what you're explaining

No argument means the current branch against its base, diffed from the merge base so other people's commits don't leak in.

BASE=$(git rev-parse --verify --quiet @{upstream} \
    || git rev-parse --verify --quiet refs/remotes/origin/HEAD \
    || git rev-parse --verify --quiet refs/heads/main \
    || git rev-parse --verify --quiet refs/heads/master)
MB=$(git merge-base "$BASE" HEAD)
test -n "$MB" || echo "No base found — ask which branch to diff against."
git diff --stat "$MB" && git log --oneline "$MB"..HEAD
git status --porcelain -uall   # untracked files the diff won't show

Size up the change from the stat before reading git diff "$MB" — a diff you pull into context whole is one you can no longer decide to skip. Upstream first, and refs/heads/ not bare main, or you diff against the wrong base: a fork of develop drags in everyone's develop commits, a trunk named anything else finds no base at all, and a tag called main beats the branch of the same name. Empty $MB also means an unborn HEAD — no commits yet, nothing to explain.

git diff "$MB" covers committed and uncommitted work both, so a branch with no commits of its own still works. An argument overrides. Resolve it as a rev first (git rev-parse --verify --quiet <arg>); anything else is a path, and goes after -- so a docs branch and a docs/ directory can't collide. A bare number is a PR (gh pr diff <n>, plus gh pr view <n> for the body and linked issue) unless a branch by that name exists; with no working gh, say so and take the branch. If the change is obvious — a version bump, a typo — say so and skip the artifact.

2. Who's reading

Read the full file on GitHub · 161 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. today First seen · 161 lines · 27 tokens per session scan A c3a9c6f69b03

Subscribe to this mod's changes

diff-explainer is a skill published in the GitHub repository thoughtbot/rails-consultant (29 stars, last pushed yesterday), licensed MIT. It adds 27 tokens to every session and 2,386 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-07.

Related

diff-explainer compared with skills from other repositories

diff-explainer next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
diff-explainerthoughtbot/rails-consultantSkill29yesterdayMITA27Claude Code
elixir-wayoliver-kriska/claude-elixir-phoenixSkill573yesterdayMITA55Claude Code
auditoliver-kriska/claude-elixir-phoenixSkill573yesterdayMITA35Claude Code
reviewoliver-kriska/claude-elixir-phoenixSkill573yesterdayMITA51Claude Code
pr-reviewoliver-kriska/claude-elixir-phoenixSkill573yesterdayMITA59Claude Code
phx-pr-reviewoliver-kriska/claude-elixir-phoenixSkill573yesterdayMITA61Claude Code, Codex
startoliver-kriska/claude-elixir-phoenixSkill573yesterdayMITA57Claude Code