Git blame explain

From berkcangumusisik/claude-code-practices · View interactive version

Git blame explain is an AI agent skill from the GitHub repository berkcangumusisik/claude-code-practices. Explains why specific lines of code were written using git blame and commit history

How to use this skill

Skill file

Explain Code History

File: $1

Lines: $2 (or full file if not specified)

  1. Run git blame on the specified range:
git blame -L ${2:-1,50} $1 2>/dev/null || git blame $1
  1. For each distinct commit found, get the full message:
git show <hash> --stat --format="%H%n%an%n%ad%n%s%n%b"
  1. Correlate code lines with commit messages.
  1. Produce a narrative explanation:

This helps understand why code exists, not just what it does.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.