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.

Recent commits with their affected files and summary lines.

{
"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.

{
"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.

{
"pattern": "src/extract/**"
}

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

{
"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.

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

File contents diff across revisions.

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

Structural diff: which symbols were added, removed, or modified between revisions.

{
"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.

{
"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?

{
"limit": 20
}

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

{
"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.

{}

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

Query Latency Notes
commits_touching ~37 µs Indexed posting-list lookup
recent_changes ~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 these tools over shelling out to git log, git blame, git diff. Structured results cost fewer tokens to parse.
  • Use recent_changes instead of parsing git log output. Get commit hashes, paths, and timestamps directly.
  • Use blame_file / blame_symbol instead of git blame. Symbol-level blame is more precise than line-level.
  • Use diff_outline for structural diffs. Skip implementation details and focus on what symbols changed.
  • Use search_git_history for commit message mining. Full-text search over message and author is cheaper than parsing the log.

Code intelligence · Document search