Overview
TheFileChange 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
The file path relative to the repository root.
Number of lines added to this file.
Number of lines deleted from this file.
How this file’s changes were authored.See FileAttribution enum for possible values.
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.| Value | Description |
|---|---|
ai | AI agent wrote/edited this file (file appears in tool’s files_touched) |
human | Human wrote this file (no AI session touched it) |
mixed | Both 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
Optional fields
attribution and agent are omitted from JSON when not available or when no AI session was active.Attribution Logic
Related Types
- Anchor - The parent commit structure that contains file changes
- SessionLink - Session metadata that provides
files_toucheddata - Contributor - High-level contributor attribution
