Read-only. Code ownership for a file via `git blame`, aggregated by author. Returns each author's line count, commit count, and most recent commit date, plus the `primary_owner` (most lines). Pass `line_start`/`line_end` to scope to one region (e.g. a single function). Errors if `cwd` is not a git repo or `file` is untracked. Cost scales with file size; instant for typical files.
Read-only. Find the pull request that introduced a line or a commit. First resolves the line to a commit via `git blame`, then reads the local merge-commit message; if that has no PR reference and `GH_TOKEN`/`GITHUB_TOKEN` is set, falls back to the GitHub REST API. Without a token the local path still works; `pr` is `null` when nothing can be resolved (e.g. rebase-merged with no PR ref). Provide either `commit`, or both `file` and `line`. May make one outbound GitHub API call (subject to the 5000/h authed rate limit).
Read-only. Files that historically change together with the input file — answers "if I edit X, what else should I check?". Mines up to `window` recent commits that touch `file`, counts how often each other file appears alongside it, and returns those above `threshold`, with the co-occurrence count and ratio (count / commits-touching-file), capped at `limit`. Pure local log mining; no network. Cost is O(window × files-per-commit) — keep `window` ≤ a few thousand on large repos.
Read-only. Inventory of branches with ahead/behind counts versus the default branch, last commit date and author, merged status, and a `stale` flag (no commits in `stale_days` days). Use it to find unmerged, abandoned branches. The default branch itself is excluded from the list. Pure local git; no network. Returns `{ count, branches, default_branch_excluded }`.
Read-only. Standup / changelog helper: one author's commits in a time window with files touched and insertion/deletion totals. Defaults to the repo's `user.name` and the last 7 days. Pure local git; no network. Returns `{ author, since, commit_count, commits[] }` where each commit has subject, date, files, insertions, deletions.
Read-only. Everything about one commit in a single call: subject, body, changed files with per-file insertions/deletions, totals, the linked PR (parsed from the merge message, or via the GitHub API when `GH_TOKEN`/`GITHUB_TOKEN` is set), and issue numbers referenced in the message (`Fixes #N`, `Closes #N`). Errors if the SHA does not resolve in `cwd`. May make one outbound GitHub API call for PR enrichment.