Skip to main content

Overview

The FileChange struct provides detailed attribution for individual files modified in a commit. It tracks how many lines were added/deleted and whether those changes were made by AI, human, or both.

FileChange Fields

path
string
required
The file path relative to the repository root.
lines_added
integer
required
Number of lines added to this file.
lines_deleted
integer
required
Number of lines deleted from this file.
attribution
FileAttribution
How this file’s changes were authored.See FileAttribution enum for possible values.
agent
string
Which agent touched this file (if attribution is ai or mixed).Examples: "cursor", "claude", "windsurf"

FileAttribution Enum

Describes how a file’s changes were authored.
ValueDescription
aiAI agent wrote/edited this file (file appears in tool’s files_touched)
humanHuman wrote this file (no AI session touched it)
mixedBoth AI and human contributed (AI session active but file not in files_touched)
The mixed attribution occurs when an AI session was active during the commit, but the specific file wasn’t explicitly tracked in the session’s files_touched list. This often happens with:
  • Manual edits during an AI session
  • Files the AI suggested changes for but the human implemented
  • Configuration or metadata files modified by the developer

Example JSON

{
  "path": "src/main.rs",
  "lines_added": 10,
  "lines_deleted": 3,
  "attribution": "ai",
  "agent": "cursor"
}
Optional fields attribution and agent are omitted from JSON when not available or when no AI session was active.

Attribution Logic

  • Anchor - The parent commit structure that contains file changes
  • SessionLink - Session metadata that provides files_touched data
  • Contributor - High-level contributor attribution

Build docs developers (and LLMs) love