blame-why

Joins git blame output with the coding-agent session that produced each blamed line.

Updated Jul 28, 2026
One-click install
npx skills add https://github.com/vinzenz/workflows --skill blame-why-vinzenz
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: blame-why
Source: https://github.com/vinzenz/workflows/tree/main/.agents/skills/blame-why
Command: npx skills add https://github.com/vinzenz/workflows --skill blame-why-vinzenz

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? In an agent-written codebase, git blame tells you which commit touched a line but not why — the real reasoning lives in coding-agent transcripts that are hard to find. blame-why closes that gap by joining blame output against the local agent-log session index, surfacing the request and reasoning behind a line in one deterministic command instead of a multi-turn transcript hunt. ## Core Features & Use Cases - Line and range explanation: Blame a single line (blame-why path:line) or a block (--range start-end, grouped by commit) joined with the best-matching agent session. - Reverse lookup and transcript access: Find which session produced a commit (blame-why commit <sha>) and read full session transcripts (blame-why session <id>) with filtering flags like --grep, --role, and --full. - Honest confidence reporting: Every match prints confidence and matched_on evidence tags (e.g. path+window+file-edit), so a medium match is treated as a lead to verify, not a citation. - Use Case: You inherit a strange line in src/server/serve.ts with a thin commit message. Run blame-why src/server/serve.ts:1202 to see the blamed commit alongside the agent's original request and reasoning that produced it. ## Quick Start Ask the agent to run blame-why on a specific file and line number, such as src/server/serve.ts:1202, to explain why that line exists.

Frequently Asked Questions about blame-why

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find out why a line of code was written by an AI agent?▼

Run blame-why with the file path and line number, for example blame-why src/server/serve.ts:1202. It runs a bounded git blame and joins the result against the local agent-log session index, printing the matched session's request and reasoning alongside the blame.

How do I find which agent session produced a specific git commit?▼

Use the reverse lookup: blame-why commit <sha>. It scores indexed sessions against that commit and returns the best match. Add --all to see every scored candidate session instead of only the top pick.

What does confidence medium mean in blame-why output?▼

A medium confidence means only the repo path or remote and the time window line up, with no file-edit or commit-sha text evidence. Treat it as a lead to verify with blame-why session <id>, not as a proven citation.

Why does blame-why report no indexed agent session overlaps this commit?▼

That message is a clean no-match, not an error, and is common for human-authored commits. If you expected a match, the repository may have moved; try agent-log sessions --all-projects --repo <owner/name> to check the index under an old path.

Does blame-why modify my git repository or session data?▼

No. blame-why is strictly read-only: it never writes to git or the session store and opens the session index read-only. It also blames only the requested lines via git blame -L, never the whole file.

What are the limitations of blame-why on shallow clones?▼

On a shallow clone or grafted history, a boundary commit may not be the true origin of the line, and blame-why flags this with a note or shallow marker. Run git fetch --unshallow to get the complete history and the real answer.