Skip to content

Choose a tag to compare

@Anikketsingh Anikketsingh released this 26 Nov 20:22
· 1 commit to main since this release

git blame tells you who. whyblame tells you why.

whyblame traces any line of code past reformats, renames and moves to the change that really gave it its behaviour. It then attaches the ticket or pull request that explains that change. You get the answer in your terminal, and your AI coding agent gets it over MCP, so it can check why a guard exists before deleting it.

Install

uv tool install whyblame      # or pipx install whyblame / pip install whyblame
cd your-repo
whyblame index                # once; later runs only add new commits
whyblame init                 # agent rules + the setup line for your client

What's in 1.0

  • An MCP server for any client and model. It runs over stdio or Streamable HTTP and needs no API key. Every reply is versioned, size-capped JSON, so smaller and local models can use it too. Tools: why_line, why_range, find_discussions and check_change, plus explain_line when a Gemini key is set.

  • whyblame init adds a short rule to AGENTS.md, CLAUDE.md, GEMINI.md and Cursor's rules, telling agents to check why a guard exists before removing it. Running it again changes nothing.

  • A protective-code check for pull requests. Add the Action below and it warns on the changed line when a PR removes or weakens a guard with a recorded reason, and cites that reason. The check is deterministic, never blocks, and never runs the PR's code.

    - uses: actions/checkout@v7
      with: { fetch-depth: 0 }
    - uses: Anikketsingh/Provenance-Aware-Code-Intelligence@v1
  • Tickets and pull requests. whyblame index --github links every merged pull request to its commit. When nothing is linked, earlier discussions are found by search and labelled as such.

How well it works

  • On a held-out test set of 60 lines from Django and Redis, the trace finds the right commit 83.5% of the time, against 69.2% for git blame -w -M -C -C.
  • The PR check's threshold was set on guard removals from before 2020 only, then frozen. Measured results on later removals are published in the repository (eval/results/).