A Claude Code slash command for explaining changes between commits, branches, or files.
# Clone to your preferred location
git clone git@github.com:claude-commands/command-explain-diff.git <clone-path>/command-explain-diff
# Symlink (use full path to cloned repo)
ln -s <clone-path>/command-explain-diff/explain-diff.md ~/.claude/commands/explain-diff.md/explain-diff # Explain uncommitted changes
/explain-diff HEAD~3..HEAD # Explain last 3 commits
/explain-diff main..feature # Explain branch differences
/explain-diff src/api/users.ts # Explain changes to specific file
- Gets diff between specified references
- Categorizes changes (feature, bugfix, refactor, etc.)
- Explains the purpose of each change
- Summarizes overall impact
- Highlights potential issues
# Diff Explanation: main..feature-auth
## Summary
This branch adds user authentication with JWT tokens.
## Statistics
- Files changed: 12
- Insertions: +450
- Commits: 5
## Changes by Category
### New Features
**src/auth/login.ts** (+120 lines)
Added login endpoint that validates credentials and generates JWT.
### Potential Issues
1. JWT secret should be at least 256 bits
2. No refresh token rotation implemented
| Category | Description |
|---|---|
| Feature | New functions, classes, files |
| Bug fix | Error handling, edge cases |
| Refactor | Renamed, restructured code |
| Test | Test files, assertions |
| Config | Package.json, configs |
- Git
- Claude Code with Opus 4.5 model access
cd <clone-path>/command-explain-diff && git pull