What Are AI Code Share?
The proportion of a team's shipped work (pull requests, commits, or lines) that was written by AI coding agents such as Claude Code, GitHub Copilot, Cursor, or OpenAI Codex, usually measured from Git metadata.
2-minute setup • No credit card required
What it means
AI code share answers a simple question: of the work that actually shipped, how much did an AI agent write? It can be counted at different levels: the share of merged pull requests opened by or substantially written by an agent, the share of commits with an AI attribution signal, or the share of changed lines in those commits. PR-level share is the easiest to explain to non-engineers; line-level share is the most detailed but the noisiest. The metric is measured from evidence the tools leave in Git. Common signals include Co-authored-by trailers added by agents (Claude Code, for example, adds a Co-Authored-By line naming Claude), footers such as 'Generated with Claude Code' in commit messages or PR descriptions, commits and PRs authored by an agent's bot account (cloud agents like GitHub Copilot's coding agent or Devin open PRs under their own identity), and branch-name prefixes that agents use by default, such as copilot/ or codex/. Because many tools, especially inline autocomplete, leave no trace at all, any Git-based measurement is a floor rather than an exact count: it tells you the minimum share that was AI-written, not the true share. Some teams publish an estimate on top of the floor using editor telemetry or surveys, and it is important to label which number is which. AI code share is also different from AI usage. Usage metrics (seats, suggestions accepted, prompts sent) describe how much developers interact with AI tools. AI code share is an outcome metric: it only counts work that was merged and shipped.
Why AI Code Share matter
Most engineering teams now use several AI coding tools, and leaders are asked by boards, clients, and their own engineers how much of the product those tools actually build. Usage dashboards from each vendor cannot answer that, because they measure activity in the editor, not what reached production, and each vendor counts differently. AI code share gives one vendor-neutral number based on shipped work. It also matters for review and quality: agent-written PRs often need a different review approach, and knowing which PRs came from an agent lets teams check whether those PRs wait longer for review, get reverted more often, or merge without a human reviewer. For agencies and contractors, it is increasingly part of what clients want disclosed. And for compliance or licensing questions, an attribution trail in Git is more defensible than a vendor's usage report.
How to measure
1) Pick the unit: merged PRs is the most readable; commits or lines give more detail. 2) Define the time window and only count merged or default-branch work, so abandoned experiments do not inflate the number. 3) Scan commit messages for Co-authored-by trailers naming known agents (git log --format='%H %(trailers:key=Co-authored-by)' lists them), and for agent footers such as 'Generated with Claude Code'. 4) Check PR and commit authors against known agent bot accounts. 5) Check head branch names for default agent prefixes. 6) Treat anything with no signal as human-written. This keeps the measurement conservative and avoids false positives, but means the result is a floor. 7) Report the floor separately from any estimate, and show the trend over time rather than a single snapshot. Gitmore's AI agent ledger applies this kind of conservative detection across GitHub, GitLab, and Bitbucket for agents including Claude Code, Copilot, Cursor, Codex, Devin, Jules, Aider, and Windsurf.
Real-world example
A 12-person product team merges 180 PRs in a month. Scanning Git metadata finds 41 PRs with an AI signal: 22 contain a Co-authored-by trailer for Claude, 11 were opened by a cloud agent's bot account, and 8 came from branches with an agent prefix. The team reports an AI code share floor of 23% (41 of 180 PRs). Developers say they also use inline completion heavily, which leaves no trace, so the team notes that the real figure is higher than the floor. Comparing groups, they find agent PRs wait on average a day longer for first review than human PRs, and three agent PRs merged without any reviewer. They add an agent-PR review rotation, which matters more to them than the headline percentage.
Common questions
How do you measure the percentage of code written by AI?
From Git metadata: count merged PRs or commits that carry an AI signal (an agent's Co-authored-by trailer, a 'Generated with' footer, an agent bot author, or a default agent branch prefix) and divide by the total. Anything without a signal counts as human. The result is a conservative floor, because some tools leave no trace.
Why is Git-based AI code share a floor and not an exact number?
Only some tools leave evidence in commits or PRs. Inline autocomplete, copy-pasting from a chat window, or a developer removing an agent's trailer all produce commits that look human-written. A conservative method never guesses, so the true share is at least the measured number and usually higher.
Is AI code share the same as AI tool adoption?
No. Adoption and usage metrics measure how many developers use AI tools and how often. AI code share measures how much of the merged, shipped work came from AI agents. A team can have high usage and a low share if most AI output is discarded or heavily rewritten.
Should line-level or PR-level AI share be reported?
PR-level share is easier to explain and less distorted by generated files, lockfiles, or formatting changes. Line-level share adds detail but needs filtering. Many teams report PR-level share to stakeholders and use line-level data internally.
Is a high AI code share good or bad?
Neither on its own. It is context. Pair it with quality and review signals (revert rate, review time, PRs merged without a reviewer) to see whether AI-written work is being shipped safely.
Track AI Code Share Automatically
Gitmore turns your git activity into automated reports with real metrics — delivered to Slack and email.
Get Started FreeNo credit card • No sales call • Reports in 2 minutes