AI engineering

How Much Code Is Written by AI? Depends What You Count

Anthropic, Google, GitHub and Microsoft each give a number for AI-written code. Each counts something different. Here are the claims, units, and a repo test.

In this post
  1. How much code is written by AI?
  2. How much of Anthropic’s code does Claude write?
  3. What does GitHub’s number measure?
  4. Where do Google and Microsoft land?
  5. What do independent estimates say?
  6. I ran it on this site’s repo
  7. Four questions before you repeat a number
  8. FAQ

TL;DR: Public answers run from about 20% to over 90%, and they aren’t measuring the same thing. One counts lines merged to production, one counts pull requests an agent started, one counts functions, one counts what developers believe. I ran three different units on this site’s own repo and got 0%, 75% and 78%. Before you repeat any of these numbers, ask four questions: what is the unit, what is the denominator, who detected it, and what happened to the code after it was written.

How much code is written by AI?

Somewhere between about 20% and over 90%, depending on who is answering and what they counted. The highest figure I found in a primary source is Anthropic’s, in the S-1 it filed with the SEC on October 26, 2026. It says “over 90% of the contributions to our codebase in September 2026 were written by Claude.” (source: the filing). The lowest 2026 figure I found is 27.4%, from a DX survey of developers.

I have no reason to think any of them is false. They are different measurements under the same headline.

Who Number When What it counts
Anthropic S-1 over 90% Sept 2026 “Contributions” (undefined)
Anthropic report over 80% May 2026 Lines merged to production
GitHub Octoverse over 40% Sept 2026 PRs an agent started
Google over 25% Oct 2024 New code, AI-generated
Google 75% Apr 2026 New code, AI-generated
Microsoft 20 to 30% Apr 2025 Code in repos, some projects
Science paper 29% End of 2024 US Python functions
DX survey 27.4% Q1 2026 Developers’ own belief

How much of Anthropic’s code does Claude write?

Anthropic has given two answers in 2026, and they use different words.

The first is in an Anthropic report earlier in 2026, “When AI builds itself.” It says: “As of May 2026, more than 80% of the code we merge into Anthropic’s codebase was authored by Claude.” The footnote defines the unit: “Our >80% figure measures the share of lines merged to production that can be attributed to Claude.” (source: Anthropic). That’s a unit you can reason about.

The same footnote adds that leadership had publicly estimated 90% or more once you include scripts and experimental code. It calls the 80% figure the more conservative one, because the attribution pipeline has gaps and the unattributed lines include auto-generated code. I like that footnote. It says what the number leaves out.

The second answer is the S-1 sentence above. The filing also says the average daily volume of code contributed per engineer in the three months ended September 30, 2026 was over 45 times the average daily volume in the year ended December 31, 2024. It also describes engineers increasingly directing and reviewing Claude’s work instead of writing code line by line.

I searched the filing text for a definition of “contributions” in this sense and found none. The other uses of the word are mostly about money: charitable and public-benefit giving, 401(k) matching and the employee stock purchase plan. The filing doesn’t say lines, commits or merged changes. The risk factor on operating metrics gives Run-Rate Revenue, Net Revenue Retention, customer counts and Claude’s success rate as examples of metrics based on internal systems and not independently verified. The code figure is not among the ones it names.

The 90% may well be right. The two numbers are four months apart and may use different units, and from the outside I can’t tell. The same company defined its unit in a report and then used an undefined word in a securities filing. I’d put more weight on the 80%, because I can see what it counts.

What does GitHub’s number measure?

GitHub’s Octoverse 2026, published October 28 and updated November 6, says: “As of September, developers start more than 40% of pull requests with an agent.” (source: GitHub). The share was 17% in March. In September there were 110 million agent-started pull requests, about 6x March.

The glossary defines the term this way: “Agent-started pull request: A pull request whose first draft came from a coding agent that we can detect.” Two things in there. “First draft” means a human may have rewritten most of it. “That we can detect” means GitHub only counts what it can see, and the glossary says so in its entry on the agent signal: “It is a floor, since not all agent use may be detected.”

So this is a count of pull requests, not lines. It says nothing about how much of the merged change the agent wrote after human edits. The report also compares merge speed. In February 83% of agent-involved PRs merged within two weeks, against roughly 86% for PRs without detected agent involvement. By September it was 90% against about 86%. Those figures are about merge speed, and I wouldn’t read quality into them.

The Octoverse glossary also defines “Contributions” as activity events: comments, creating issues, PRs, pushing code, reviewing. A push counts once however many commits it holds. That’s GitHub’s definition for GitHub’s report. Nothing says Anthropic uses it. So the word has more than one meaning in use, and the filing doesn’t say which one it means.

Where do Google and Microsoft land?

Google has given this number more than once. On the Q3 2024 earnings call, on October 29, 2024, Sundar Pichai said more than a quarter of new code at Google was generated by AI and then reviewed and accepted by engineers (transcript). On April 22, 2026, in his Cloud Next post, he wrote: “Today, 75% of all new code at Google is now AI-generated and approved by engineers, up from 50% last fall.” (source: Google).

Google says “new code” and “approved by engineers.” Neither phrase says whether that means lines, characters or commits.

Google Research did publish a definition once. In June 2024 it described an IDE-completion metric: accepted characters from AI suggestions, divided by manually typed characters plus accepted AI characters, with copy-pastes excluded (source: Google Research). Google hasn’t said the earnings-call or Cloud Next figures use that definition, so I wouldn’t assume they do. It shows what a precise version of this number looks like.

Microsoft is the loosest. Satya Nadella said at LlamaCon on April 29, 2025 that maybe 20 to 30% of the code in Microsoft’s repos, in some projects, was probably written by software (video). That is code sitting in repos, in some projects, and a guess by his own wording. I didn’t find a later Microsoft figure.

What do independent estimates say?

Two estimates from outside the big companies come in under 30%, and each uses a different unit again.

A team of researchers (Daniotti, Wachs, Feng and Neffke) published a paper in Science in 2026. Their abstract says “AI writes an estimated 29% of Python functions in the US” (abstract on arXiv). The unit is Python functions in GitHub contributions, and the estimate comes from a classifier. The figure is for the end of 2024. A classifier is a detector, so it has the same “who detected it” question as GitHub’s floor.

DX, a developer-productivity company, reported 27.4% on average for Q1 2026. It got that by asking developers at more than 500 organizations how much of their merged code they believe AI wrote (source: DX). It is self-reported.

Then there is the prediction. Dario Amodei told the Council on Foreign Relations on March 10, 2025 that AI would be writing 90 percent of the code within three to six months, and that within twelve it might be writing essentially all of it (transcript, labelled uncorrected). He was talking about code in general, not Anthropic’s codebase.

I ran it on this site’s repo

I did the same exercise on the repo behind this site, on November 12, 2026. There are 609 commits since the first one on April 24, 2026. Three different units give three different answers.

  • By git author field: 608 are Jared Smith and 1 is Fly.io. By author, AI wrote 0%.
  • By Co-Authored-By trailer naming a Claude model: 477 of 609 commits, 78%. Since September 1, 2026, it is 239 of 242, 99%.
  • By lines added: 83,114 of 110,835 lines were added in commits with the trailer, 75%.

The author field says none of it is AI because the commits go out under my name. April 2026 has 25 commits and none carry the trailer. That tells you what the trailer recorded. It doesn’t tell you who typed.

The trailer only shows what the tool recorded, so the 78% is a floor in the same sense GitHub uses the word. Commit counts also move with merge strategy: 92 of the 609 are squash merges, so one commit there can hold many agent commits. The lines figure counts everything git tracks, and 36,447 of those 110,835 lines are post drafts in content/posts, which is prose. If you want to run it on your own repo, this is the one-liner:

git log --format='%(trailers:key=Co-Authored-By)' \
  | grep -c 'Claude'
git rev-list --count HEAD

The first command counts trailer lines, which can exceed commits. My numbers count commits.

I’ve written about these units before. On a different repo I made 4,154 commits in six months of 2026 and wrote almost none of the code by hand, and that post calls commit count and lines of code terrible metrics. Once agents could produce them, commit volume, PR count and lines shipped stopped working as proxies for an engineer’s contribution in performance reviews. As output proxies, commits and PRs were bad before agents and worse after.

Four questions before you repeat a number

What is the unit? Lines, commits, pull requests, functions, characters, or “contributions.” Table row one and row two above are the same company with different answers to this question.

What is the denominator? All code, new code, merged code, code in some projects, code in one language. Google says “new code.” The Science paper says Python functions in the US. Nadella said some projects.

Who detected it? A classifier, a trailer, a platform signal, a survey, or a person’s memory. A trailer or a platform signal misses whatever wasn’t labeled. A classifier or a survey can be wrong in either direction.

What happened after it was written? Review, merge, production. Google’s wording includes “reviewed and accepted” and “approved by engineers.” Anthropic’s report says “merged to production.” A pull request an agent started and nobody merged still counts in a “started” figure.

The same habit applies outside code. Nobody Got Replaced. Agents Got Added. is about the viral claim that McKinsey replaced 25,000 people with agents. It was wrong, and the 60,000 figure was 40,000 humans plus agents. What a 96% Security Benchmark Actually Measures reads a vendor number the same way.

If a board or an investor asks your team for this number, someone has to decide what to measure before anyone reports it. That’s work I do in consulting.

FAQ

Which number is the most reliable? The ones with a stated unit and a stated gate: Anthropic’s lines merged to production, and GitHub’s agent-started pull requests with its published glossary. GitHub calls its own signal a floor, and Anthropic calls its figure conservative because its attribution has gaps.

What should I report to my own board? Pick one unit, write down the denominator, say how the code was detected, and say what review it went through. Then report the same unit every quarter so the trend means something.