For AI agents: the complete documentation index is available at https://docs.gage.io/llms.txt, the full documentation bundle is available at https://docs.gage.io/llms-full.txt, and this page is available as Markdown at https://docs.gage.io/commands/blame.md.

gage blame

The gage blame command finds the sessions that wrote the lines of a file. For each line it reports the session, the tool call that wrote the line, and the lines of the session to read. For a walk-through, see See context for a code change.

gage blame [OPTIONS] <PATH>
OptionDescription
-l, --lines <LINES>Lines to blame (default: all)
-N, --native <SOURCE>Session source
-S, --storedUse stored sessions
-R, --stored-remote <NAME>Use sessions fetched from a remote
--jsonOutput JSON

--lines takes a line (42), a range (10-20), or a comma-separated list of them (10-20,42). Lines are numbered from 1 and a range includes both ends.

--native, --stored, and --stored-remote select the sessions to read, and each excludes the other two. With none of them, the command reads the default session source. They have the meaning they have for gage session.

How a line is attributed

The command follows git blame. The commit of each line bounds a window of time. The earliest tool call in that window whose input carries the text of the line is the call that wrote it. A line that no tool call carries is not attributed.

Output

Each line of the file is one row.

113509cd:432-1113  2026-11-20 11:16  116  ### Gage in Pi
-                  -                 117
113509cd:432-1113  2026-11-20 11:16  118  [`gage init`](/commands/init) sets Gage up in Pi, and Pi can be the
ColumnDescription
1The session and the session lines to read, as SESSION:LINES
2The time of the tool call
3The line number in the file
4The line

The session lines run from the human prompt before the tool call through the call itself. gage session view takes the first column as its argument and opens the session at those lines. A - marks a line that is not attributed.

JSON output

--json writes one object for each range of lines attributed to one tool call. It includes every candidate call for a line, where the text output shows only the first.

FieldDescription
lineFirst line of the range
line_endLast line of the range. Absent for a single line.
session_idSession that holds the tool call
session_linesSession lines to read
tool_use_idID of the tool call
tool_nameName of the tool
timestampTime of the tool call
rankRank of the candidate. The first is 1.
matchEvidence for the attribution

match is one of patch, input, command, or neighbor, from the strongest evidence to the weakest.

The same rows are available in SQL through the blame table function. See gage query.