Generate a visual diff of the current git repository's changes.
Arguments passed through to git diff: $ARGUMENTS
Steps
Run the diff script:
bash "${CLAUDE_PLUGIN_ROOT}/skills/diff/scripts/generate-diff.sh" $ARGUMENTSIf URLs are printed (HTML mode succeeded):
- Report the URLs clearly so the user can open them on their phone or browser.
- Note the server PID.
- Do not print the full diff in the conversation — the HTML viewer is sufficient.
If
MARKDOWN_FALLBACK_STARTappears in the output (diff2html-cli not installed, or--markdownflag was passed):- Extract the raw diff between
MARKDOWN_FALLBACK_STARTandMARKDOWN_FALLBACK_END. - Format it as a readable diff with:
- A header showing changed files and total stats (lines added/removed per file)
- Each file's changes in a fenced
```diffblock with the filename as a subheading - Files sorted by change size (most changed first)
- If
--markdownwas NOT passed, suggest installing diff2html-cli:npm install -g diff2html-cli
- Extract the raw diff between
Common argument examples
| Command | What it diffs |
|---|---|
/diff |
All uncommitted changes (staged + unstaged + untracked) vs HEAD |
/diff --markdown |
Same, but output as formatted markdown (no HTML viewer) |
/diff --staged |
Only staged changes |
/diff HEAD~3 |
Last 3 commits |
/diff main |
Current branch vs main |
/diff -- src/foo.ts |
Single file only |
/diff --markdown -- src/foo.ts |
Single file, markdown output |
Configuration
No config-file keys. The HTML is written to $TMPDIR (else /tmp) as diff-review.html and served on port 9876; set the DIFF_REVIEW_PORT env var to use another port.
To change this skill, do not edit this copy: use /dev-tools:update-skill, or see docs/updating-skills.md in mzvonar/claude-skills-public.