Agents edit files through their file-edit tools (Claude Code's Edit and Write) and through their shell tool (echo >> file, sed -i, a formatter, a code generator). A shell tool call names no file paths, so autter finds what it changed by comparing file metadata before and after the call.
- Before the call (PreToolUse). autter scans the working tree and records size, mtime and inode for every non-ignored file that changed since the last checkpoint, plus every file modified in the last couple of seconds. The snapshot goes to the background service and is also written to
.git/ai/bash_snapshots/. Files that already had uncheckpointed changes get an untracked checkpoint, so someone else's edit is not credited to the agent. - After the call (PostToolUse). autter loads the snapshot from the background service, or from disk if the service was not running or restarted. It scans again and gives the agent every file that was created or whose metadata changed. Only the lines that changed are attributed: the AI checkpoint diffs each file against its last checkpointed content. The snapshot file is then deleted.
- The agent's hooks must fire on its shell tool. For Claude Code,
autter install-hooksuses the catch-all matcher"*". Installs from older autter versions matched onlyWrite|Edit|MultiEdit, which skips theBashtool, so shell edits were committed as untracked.autter doctorandautter debugnow report this as "Claude Code shell edits: NOT captured"; runautter install-hooksto fix it. - The background service is optional for this: if it isn't running, the snapshot on disk is used.
- Gitignored files, and files matched by
.autter-ignoreor the default ignore patterns (lock files,node_modules, ...). - Calls where the scan takes longer than 1.5s, or where more than 50,000 files changed recently. The whole call is skipped and its edits are committed as untracked.
- Deletions. Deleted lines need no attribution.
A file edited by something else while the shell command runs (for example, you save it in your editor during a long build) cannot be told apart from the agent's change, and is attributed to the agent.