aiblame is a code attribution statistics tool for the era of AI coding agents, positioned similarly to a "git blame for agents." It answers the question: of the code still in use in the current repository, what proportion was written by AI coding agents in assisted commits?
Purpose and core metric The tool does not merely count "how many commits mention Claude"; instead, it traverses every text file at HEAD via git blame, counts which commits the surviving lines belong to, and then uses self-declared signals in the commits to determine whether an AI agent participated in that commit. It therefore reports the AI percentage at the level of current code lines, not the proportion of commits.
Main capabilities
- Overall AI percentage: computes the proportion of lines in the current code written by AI-assisted commits, based on per-file parallel git blame.
- Breakdown by agent: shows each agent's percentage, surviving line count, commit count, and active date range.
- Trend line: displays the change in the AI commit percentage over the last 12 months as a sparkline.
- File and people views: lists the files most written by AI, as well as the top human operators (top pilots) driving the agents.
- Output formats: can generate shareable cards and README badges (SVG), and supports --json and --markdown for scripts and PR comments.
- CI policy gate: sets a threshold via --fail-above, exiting with a non-zero status when the repository's AI percentage exceeds the limit.
Identification method and design principles The tool classifies only on the basis of self-declared signals in commits, including co-author trailers (such as Co-Authored-By: Claude, Co-authored-by: Cursor Agent, aider email addresses), agent bot accounts (such as copilot-swe-agent[bot], chatgpt-codex-connector[bot], devin-ai-integration[bot], google-labs-jules[bot]), and footers written by the tools themselves (such as "🤖 Generated with Claude Code", the aider: prefix). It does not make "AI detection" guesses based on code style. Ordinary automation (dependabot, renovate, github-actions, etc.) is reported separately and not counted as AI. Noise files areExcluded, including lockfiles, node_modules/, vendor/, dist/, compressed files, .gen., files over 20,000 lines, and content marked as linguist-generated or linguist-vendored in .gitattributes. If a commit is signed by multiple agents, it is attributed only to the first signature (author, then first trailer), so that the shares of all agents sum to the total share.
Usage According to the documentation, it can be tried out in 10 seconds: no installation, no API Key, no network calls other than git clone of the remote repository, and requires Node 20+ and git. If you want it permanently on PATH, you can install the prebuilt release tarball. The specific installation commands and full CLI parameters are not fully provided in the documentation and are not yet available.
Supported agents (v0.1.0) Claude Code, Cursor, GitHub Copilot, OpenAI Codex, Aider, Devin, Google Jules, Gemini, Amp, opencode, Factory Droid, Windsurf, JetBrains Junie, Lovable, v0. The matching patterns are deliberately strict and will not mistakenly match humans named Claude, Devin, or Jules (covered by tests).
Use cases Suitable for open source maintainers and team engineering managers to show AI participation in the README, set an upper limit on the AI code share in CI, attach a Markdown report in a PR, or make horizontal observations of trending repositories.
Limitations Agents that do not sign commits (such as tab completion, copying and pasting from a chat window, or agents with trailers disabled) will be counted as human, so the results should be regarded as a lower bound. Lines written by humans and later modified by AI are counted as AI, consistent with git blame attributing them to the last author. squash merge is only effective when the platform retains trailers (GitHub retains them by default). For large repositories, --max-files can be used to limit the number of files (2000 in the example).
Roadmap and license The follow-up directions listed in the documentation include --by-dir directory breakdown, --html single-file interactive report, view by author, blame caching for very large monorepos, publishing to npm (npx aiblame), and PRs are welcome to add agent signatures such as Cline, Roo Code, Kiro, Qwen Code, and Grok. The project is under the MIT license, and the author is Celalettin Durğaç.