Use case
Code archaeologyWhen and why did this code appear?
Which commit added a line of text, and how a symbol changed over time: introduced_by finds the commit that added or removed a text, and symbol_history lists the commits that changed a symbol.
Why ask ahto
One answer, not a script
Each row is a commit with its author, time and subject, so the answer to "why is it like this" is the commit message next to the change, not a hunt through git log -S and git log -L.
Then
What to do with the answer
ahto history <path> lists the commits that changed a file or folder, newest first, when the question is about a path and not a symbol.
function_call · introduced_by
Commits that added or removed a text
The commits that changed how many times an exact text occurs in a file, oldest first: the first one added it, a later one may have removed it. The text matches exactly, case and spaces included, as git log --reverse -S text -- path finds it. Every commit reachable from the commit counts, side branches too, merges not.
From your agent, over MCP
From a terminal
Parameters
| Name | Type | Meaning |
|---|---|---|
text | string | the exact text to look for |
path | path | a directory or file; empty is the whole tree |
limit | int | the most rows (default 5) |
The columns of the answer
| Column | Meaning |
|---|---|
commit | the commit's full id |
path | the first file whose count changed |
before | times the text occurs in that file before the commit |
after | times it occurs after |
author | the commit's author |
time | author time, Unix seconds |
commit_time | commit time, Unix seconds |
subject | the first line of the message |
function_call · symbol_history
Symbol history
The first-parent commits that added, removed or changed a symbol (its signature, its body or its place), newest first, with the author and the subject. changes=all lists the commits that touched its file without changing it too.
From your agent, over MCP
From a terminal
Parameters
| Name | Type | Meaning |
|---|---|---|
name | string | the symbol's name, such as Open or ServeHTTP; a method may be written Type.Method or Type::Method, a package function pkg.Func (the function in a directory named pkg, when no type pkg holds it; the tree at the commit decides, also for the history); an empty part such as T..Run is refused |
container | string | the receiver type or class of a method, or the type of a field; empty matches any |
path | path | a directory or file the definition is at or under; empty is the whole tree |
changes | choice | only the commits that changed the symbol, or every commit of its file (default changed) |
limit | int | the most rows (default 100) |
The columns of the answer
| Column | Meaning |
|---|---|
commit_oid | the commit's full id |
time | author time, Unix seconds |
author | the commit's author |
subject | the commit's subject line |
body | the commit message after the subject line, trimmed, cut at 2048 characters (a cut body ends with …); empty when there is none |
path | the file the symbol was in at the commit |
kind | the kind of symbol, such as function, method, type, constant, variable or field |
container | the receiver type or class of a method |
change | added, removed, signature, body, moved or touched; not_found when a pkg prefix matches nothing (the hint is in subject) |
signature | the symbol's signature at the commit |
line | the line the name was declared on at the commit |
lines | lines of the symbol at the commit |
matched | how the name matched when not by name: container, or directory (pkg.Func, the function in a directory named pkg); none when pkg is neither; empty for a name |
Keep going
More in the docs
Other questions
The parameters and columns above are the ones ahto reports for introduced_by and symbol_history at commit 6bcefbc, 2026-12-04.
Live on the demo