explain_history
Trace why a symbol or code range looks the way it does by returning authors, commit diffs, and linked pull request details; use it before rewriting odd code.
Instructions
Why code looks the way it does. Use this before removing or rewriting code that looks odd, or to answer "why is it like this?". Give a symbol, or a path with an optional line range. Returns who wrote the current lines, every commit that changed them (with the relevant diff), and the title and description of the pull request behind each commit (GitHub only).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | A file in the repo. Narrow it with start_line and end_line. | |
| repo | No | Name of an indexed repo, as list_repos shows it. Leave out when only one repo is indexed. | |
| symbol | No | A function, class or method, e.g. "unsign" or "Signer.sign". Use this or path. | |
| end_line | No | Last line of the range (with path). | |
| start_line | No | First line of the range (with path). | |
| max_commits | No | How many commits to return, newest first. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| repo | Yes | ||
| symbol | Yes | ||
| changes | Yes | Commits that changed these lines, newest first. | |
| citation | Yes | ||
| authorship | Yes | ||
| instructions | Yes | ||
| pull_requests | Yes |