agentleFS
GoldziherGoldziher/basemind/skills/basemind-git-history/SKILL.md

basemind-git-history

Skill125 starsChanged 48 days agoMITView on GitHub

Explore git history without shelling out to git — recent commits, commits touching a path, per-line and per-symbol blame, structural diffs across revisions, churn ranking, and a symbol's history over time. Reach for it whenever the user asks "what changed recently", "who last touched this", "when did this symbol change", "what's the diff between these revs", or "where's the churn".

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    When older commits remain the page returns next_cursor, and says truncated_reason: "span_limit" when it is short or empty: follow the …

    line 89
  2. Very specific:

    All paths are repository-relative with forward-slash separators.

    line 127
  3. Very specific:

    When several definitions in the file share the name, symbol is an error listing each with its lines: add line (any line inside the one you …

    line 139

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md
<!-- AI-RULEZ :: GENERATED FILE — DO NOT EDIT Content-Hash: blake3:b0950be911f013ca357e4427590c291b08d620ffc3e80c32ffd0a834df433b7c Source-Hash: blake3:607e3840e47d250c023513008342b4e723eff1841b0530d2a109acaf0dc5dbc6 Schema-Version: v1 -->

basemind-git-history — git history over the index

basemind indexes git history and resolves blame and diffs at symbol resolution, backed by a gix history index. Three tools cover it: git_log, git_blame and git_diff. They return commits, authors, paths, and line/symbol attributions, structured and capped, for a fraction of the cost of parsing git log / git blame output.

The tools are always loaded: call them directly, no tool search needed. Prefer them over shelling out to git log, git blame, git status or git diff. Drop to raw git only when no tool covers the question (staging, rebasing, anything that mutates history).

Tool routing

QuestionMCP callCLI
"What changed recently?"git_log {}basemind git log
"Which commits touched file F?"git_log {"path":"src/store.rs","limit":5}basemind git log --path src/store.rs --limit 5
"Which commits touched a directory?"git_log {"path":"src/mcp/"}basemind git log --path src/mcp/
"Which commit mentions X?"git_log {"query":"fix race"}basemind git log --query "fix race"
"What did this author commit?"git_log {"author":"ada"}basemind git log --author ada
"When did symbol X change?"git_log {"path":"src/store.rs","symbol":"open"}basemind git log --path src/store.rs --symbol open
"Show one commit in full"git_log {"rev":"HEAD~1"}basemind git log --rev HEAD~1
"Who wrote this file's lines?"git_blame {"path":"src/store.rs"}basemind git blame src/store.rs
"Who wrote these lines?"git_blame {"path":"src/store.rs","line":120,"end_line":160}basemind git blame src/store.rs --line 120 --end-line 160
"Who wrote this symbol?"git_blame {"path":"src/store.rs","symbol":"open"}basemind git blame src/store.rs --symbol open
"What's dirty in the working tree?"git_diff {}basemind git diff
"What did I change in file F?"git_diff {"path":"src/store.rs"}basemind git diff src/store.rs
"Diff a file between revisions?"git_diff {"path":"src/store.rs","from":"HEAD~1","to":"HEAD"}basemind git diff src/store.rs --from HEAD~1 --to HEAD
"What symbols were added or removed?"git_diff {"path":"src/store.rs","from":"HEAD~5","structural":true}basemind git diff src/store.rs --from HEAD~5 --structural
"What's HEAD / branch?"index_status {}basemind status
"Where's the churn?"CLI onlybasemind git churn
"Commits whose changed paths match a regex?"CLI onlybasemind git by-path <regex>

The CLI also keeps shorthands: git recent, git touching <path>, git search <query>, git show <rev>, git symbol-history <path> <name>, git blame-symbol <path> <name>, git status, git diff-outline <path>.

Examples

git_log {"limit":5}
→ {"commits":["612df7e3a1c4 chore(release): v0.15.0",
              "1779b9902d5e fix(git-history,serve): address code-review findings", …],
   "files":{"612df7e3a1c4":{"Cargo.toml":"modified",…},…}, …}

git_blame {"path":"src/scanner.rs","symbol":"process_file"}
→ per-line authorship of that function's span

git_diff {"path":"src/mcp/tools.rs","from":"HEAD~5","structural":true}
→ the symbols in `added` and `removed`, and the count of `common` ones

Notes

  • The git tools require basemind serve to be running inside a git repository. Outside one they answer with an error result saying so.
  • History queries are indexed: commits touching a path resolve in tens of microseconds vs a live walk. The index auto-builds on first use and is a fraction of the size of .git.
  • A git_log list commit is the string "<sha12> <summary>" (the sha's first 12 hex digits, which every tool taking a revision resolves), with no author or time. A search by author writes "<sha12> <author>: <summary>", since author matches part of a name or email and may select several people. A symbol's history writes [introduced] or [removed] after the sha, and [modified] only when a changed commit's summary itself starts with [. A list carries no date: rev gives a commit's time. The recent list (no arguments) and a directory list put the files in a top-level files: {"<sha>": {"<path>": "<change>"}}, where a merge lists only what it changed against every parent. rev shows one commit with its full sha, author, author_email, time, message body and files.
  • git_log with no arguments is a recency window; use query or author to find a commit arbitrarily far back. symbol needs path. limit defaults to 20 and caps at 100, and limit: 0 is refused. A path that no commit reachable from HEAD touches and that is not on disk is an error, for a file and for a directory.
  • git_log with path + symbol reads one window of the commits touching the file per page. When older commits remain the page returns next_cursor, and says truncated_reason: "span_limit" when it is short or empty: follow the cursor until it is absent to reach every change back to the introduction. A symbol the working tree no longer defines still has its history read. A name no commit inspected so far defines either is named in unmatched (with the names the file does define) on each empty page, and is an error on the last page.
  • git_log with a directory path (one ending in /) pages the same way, 200 commits per page: an empty page with truncated_reason: "span_limit" and a next_cursor is not the end of the history, and unmatched says when nothing has touched the directory so far and it is not on disk.
  • A git_log cursor is refused when the git-history index came up (or stopped answering) since it was issued: the two order commits differently. Restart without cursor.
  • git_log with rev holds the commit's file list to max_tokens and then sets budgeted, with omitted counting the files left out.
  • git_blame: line and end_line are 1-based and inclusive, and end_line defaults to line. rev blames at a revision other than HEAD. A symbol is located in the file as it is at rev, not in the working tree, so its lines (and a line passed to pick one of several) are that revision's; a symbol that exists only uncommitted is "no symbol ... at HEAD". limit defaults to 100 hunks, counted after merging, and the list is trimmed to max_tokens (default 6000), then sets budgeted. hunks is ["<line>[-<end_line>] <sha12>[ <source_path>]", ...], adjacent hunks of one commit merged; source_path, the rest of the row (it may hold spaces), names the file the lines came from when they moved there from another; the line they had there is not given (git_log {rev} and code_read at that path read the old code). commits maps each sha to {author, time, summary} once (time is unix seconds). A symbol blame also carries the symbol's line / end_line.
  • git_diff: path alone is that file's working-tree diff against HEAD; from defaults to HEAD and to to the working tree. The response has from, to (a sha, or "working tree") and hunks, plus present_at_from: false for a file added since from or present_at_to: false for one deleted by to. A diff is cut at 200 hunks or 128 KiB of hunk text and then sets truncated, truncated_reason (hunk_cap or byte_cap) and omitted (the hunks left out); it has no cursor, so narrow it with a closer from / to. A structural diff compares from against the indexed working tree, takes no to, and returns added, removed and common, the count of unchanged symbols.
  • git_diff {} lists at most 200 paths per status list, in path order, and leaves an empty list out. A cut status sets truncated, truncated_reason: "path_cap" and omitted; pass a directory path (one ending in /) for the status under that directory. That narrowed status lists every untracked file on its own and its is_clean is about the directory only. A directory that is not on disk and has no changed path under it is an error; so is a directory given without the trailing slash.
  • All paths are repository-relative with forward-slash separators. Page with next_cursor -> cursor. A cursor continues only the call that returned it (same arguments apart from limit and max_tokens); on another query, or after HEAD moved, the call is an error: repeat it without cursor. A shallow clone sets truncated with truncated_reason: "shallow_clone": absence is then inconclusive. Every cut uses the same words: next_cursor alone when a page ended at limit, budgeted when the token budget trimmed it, and truncated + truncated_reason for a cut the caller did not ask for, with omitted counting the items left out where known.
  • query is matched against the commit message and author against the author name and email, each on its own field: {"query":"review","author":"alice"} is commits by alice that mention a review. A search answered before the git-history index is ready covers only the subjects and authors of the newest 10,000 commits and says so: truncated with truncated_reason: "unindexed_scan"; retry shortly.
  • When several definitions in the file share the name, symbol is an error listing each with its lines: add line (any line inside the one you mean).
  • A binary file reports binary: true and no hunks, a file over 4 MiB too_large: true. A path that leaves the repository is refused.
  • An argument a tool does not take is rejected with a did-you-mean and the accepted list.

For code structure see basemind-code-search; for document search see basemind-documents; for agent coordination see basemind-comms.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.