ahto

Use case

Code archaeology

When 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.

> when and why did this code appear? ⏺ ahto · function_call introduced_by text=leadingTabs limit=5 ⏺ ahto · function_call symbol_history name=cleanListing changes=changed limit=10

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

{ "name": "function_call", "arguments": { "name": "introduced_by", "repository": "<id>", "args": { "text": "leadingTabs", "limit": 5 } } }

From a terminal

$ ahto function call introduced_by text=leadingTabs limit=5

Parameters

NameTypeMeaning
textstringthe exact text to look for
pathpatha directory or file; empty is the whole tree
limitintthe most rows (default 5)

The columns of the answer

ColumnMeaning
committhe commit's full id
paththe first file whose count changed
beforetimes the text occurs in that file before the commit
aftertimes it occurs after
authorthe commit's author
timeauthor time, Unix seconds
commit_timecommit time, Unix seconds
subjectthe 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

{ "name": "function_call", "arguments": { "name": "symbol_history", "repository": "<id>", "args": { "name": "cleanListing", "changes": "changed", "limit": 10 } } }

From a terminal

$ ahto function call symbol_history name=cleanListing changes=changed limit=10

Parameters

NameTypeMeaning
namestringthe 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
containerstringthe receiver type or class of a method, or the type of a field; empty matches any
pathpatha directory or file the definition is at or under; empty is the whole tree
changeschoiceonly the commits that changed the symbol, or every commit of its file (default changed)
limitintthe most rows (default 100)

The columns of the answer

ColumnMeaning
commit_oidthe commit's full id
timeauthor time, Unix seconds
authorthe commit's author
subjectthe commit's subject line
bodythe commit message after the subject line, trimmed, cut at 2048 characters (a cut body ends with …); empty when there is none
paththe file the symbol was in at the commit
kindthe kind of symbol, such as function, method, type, constant, variable or field
containerthe receiver type or class of a method
changeadded, removed, signature, body, moved or touched; not_found when a pkg prefix matches nothing (the hint is in subject)
signaturethe symbol's signature at the commit
linethe line the name was declared on at the commit
lineslines of the symbol at the commit
matchedhow 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

Live on the demo

Ask it about your own code. On the live demo, or on your own machine.