Skip to content

Git Intelligence

basemind precomputes a per-repo git-history index backed by gix, resolving blame and diffs at symbol resolution. History queries return commits, authors, and paths as structured data in tens of microseconds — a pure accelerator that rebuilds automatically when history changes.

All of the following are modes of the git MCP tool (basemind git <mode> on the CLI).

Recent commits with their affected files and summary lines.

{
"mode": "recent",
"limit": 10
}

Returns the newest commits first, paths modified in each, and author/message. Useful for “what happened in the last few hours?”

All commits that modified a given path, newest-first.

{
"mode": "touching",
"path": "src/scanner.rs"
}

Backed by a posting-list index, resolves in ~37 microseconds on a warm repo with thousands of commits.

Commits matching a path pattern, like glob or prefix matching. The MCP mode is by_path; the CLI subcommand is by-path.

{
"mode": "by_path",
"pattern": "src/extract/**"
}

Per-line blame: who last changed each line and in which commit.

{
"mode": "blame",
"path": "src/scanner.rs"
}

Returns author, commit hash, and timestamp for every line.

Blame at symbol resolution: who last changed a specific function, type, or definition, and when its body last changed structurally. The MCP mode is blame_symbol; the CLI subcommand is blame-symbol.

{
"mode": "blame_symbol",
"path": "src/scanner.rs",
"name": "process_file"
}

File contents diff across revisions.

{
"mode": "diff",
"path": "src/scanner.rs",
"old": "HEAD~5",
"new": "HEAD"
}

Structural diff: which symbols were added, removed, or modified between revisions. The MCP mode is diff_outline; the CLI subcommand is diff-outline.

{
"mode": "diff_outline",
"path": "src/scanner.rs",
"old": "HEAD~10",
"new": "HEAD"
}

Shows + function_name, - removed_type, etc., without diffing implementation details.

When a symbol’s body changed over time. Uses structural hashing to track modifications across commits. The MCP mode is symbol_history; the CLI subcommand is symbol-history.

{
"mode": "symbol_history",
"path": "src/scanner.rs",
"name": "process_file"
}

Returns commits where this symbol’s implementation changed, useful for “when was this function last refactored?”

Files ranked by churn frequency. What changes the most?

{
"mode": "churn",
"limit": 20
}

Full-text search over commit authors and messages across all branches.

{
"mode": "search",
"pattern": "fix.*index",
"field": "message"
}

Search "author", "message", or "all" (default). Useful for “find commits mentioning the schema bump” or “what did Alice commit?”

What’s staged and unstaged right now — the structured equivalent of git status.

{
"mode": "status"
}

On a typical repo with 2,000–4,000 commits:

Query Latency Notes
git touching ~37 µs Indexed posting-list lookup
git recent ~13 µs Newest-first list scan
Index build 0.5–3.2 s Depends on commit depth
Index size 6–22 % of .git Space–time trade-off

The index is a pure accelerator: it rebuilds automatically when history is rewritten (rebase, force-push, filter-repo) and the tools fall back to live history walks if the index is stale.

  • Prefer git modes over shelling out to git log, git blame, git diff. Structured results cost fewer tokens to parse.
  • Use git recent instead of parsing git log output. Get commit hashes, paths, and timestamps directly.
  • Use git blame / git blame-symbol instead of shelling out to git blame. Symbol-level blame is more precise than line-level.
  • Use git diff-outline for structural diffs. Skip implementation details and focus on what symbols changed.
  • Use git search for commit message mining. Full-text search over message and author is cheaper than parsing the log.

Code intelligence · Document search