Shippashippa
Blog6 min read

How much of your code is actually AI-written?

You have seen the claims: 'AI writes 90% of my code now.' Some of that is real, a lot of it is vibes. If you want to know how much of your code is actually AI-written, you need a measurement, not a feeling. Here is what can and cannot be measured, the two methods that work, and why the true number is fuzzier than the confident posts suggest.

The honest answer first

There is no single clean percentage, because 'AI-written' is not a binary. An agent might generate a 40-line function, you keep 30 lines, rewrite 10, and rename three variables. Is that 75% AI-written? By line count, maybe. By the thinking that shaped it, who knows. Any tool that hands you a precise-looking figure like '87.3% AI-written' is smoothing over that ambiguity. The useful goal is a defensible estimate and a trend, not a decimal.

Why git blame cannot answer this

The instinct is to reach for git blame or line-count diffs. They do not work here. Git records that a line changed and who committed it. It has no idea whether you typed that line, an agent generated it, or you accepted an AI suggestion and edited it. If you commit AI output under your own name, and almost everyone does, git attributes 100% of it to you. Version control tracks authorship of commits, not authorship of ideas.

To measure AI contribution you need a source that actually knows the agent did the work. That source is your coding-tool session logs.

Method 1: read the session logs

Tools like Claude Code, Codex, and Cursor log every edit they apply: the file, the diff, whether it was accepted. That is the ground truth for AI-written code. Summing accepted agent edits and comparing them against your total changes gives a real, evidence-based ratio.

This is exactly what Shippa reads. It parses those local logs and reports lines the agent shipped for you, across all three tools, so 'lines shipped by AI' stops being a guess.

$ npx shippa
Reads your local Claude Code, Codex, and Cursor logs.

Because it reads the logs rather than your repository, it captures work that never even reached a commit: the exploratory diffs, the throwaway prototypes, the code you generated and then deleted. That is a truer picture of how much you are leaning on AI than any repo scan. For the money side of the same logs, see tracking your Claude Code cost.

Method 2: git plus honest heuristics

If you cannot read logs, you can approximate. Compare lines added in AI-assisted sessions against lines added in hand-written ones, or tag commits made during agent sessions. It is coarse, it misses edited-after-generation nuance, and it flatters whichever side you were paying more attention to. Treat it as a rough band ('somewhere between half and three-quarters'), never a point estimate.

Why the number stays fuzzy

  • Accepted then edited. A generated block you reshape is part AI, part you, and no counter splits that cleanly.
  • Reverts and rewrites. Code the agent wrote that you later delete still happened, but it is not in your final codebase.
  • Boilerplate weighting. 200 lines of generated config is not the same contribution as 20 lines of tricky logic you wrote by hand, yet line counts treat them equally.
  • Reformatting churn. A formatter or rename can rewrite lines that neither you nor the AI meaningfully authored.

What a healthy ratio looks like

There is no correct number, but there are healthy patterns. Developers who ship well with AI tend to generate a large share of raw lines while staying the person who decides architecture, reviews every diff, and can explain any line under pressure. A high AI-written percentage paired with high review effort is a productivity story. The same percentage with rubber-stamped diffs is a debt story. This is the same tension at the heart of vibecoding: speed is only a win if you keep judgment in the loop.

Should you report this number?

There is growing pressure, especially in teams and job interviews, to state an AI-written percentage as if it were a badge. Be careful. A high number is not automatically good, and a low number is not automatically diligent. Two engineers with identical 70% figures can be worlds apart: one generated boilerplate and reviewed the hard logic by hand, the other let an agent write the tricky parts and skimmed. The percentage alone hides the thing that matters, which is where you spent your judgment.

If you do share the number, share the context with it: what you generated, what you wrote by hand, and how you reviewed. A measurement is a starting point for an honest conversation about how you work, not a score to win. Used that way, tracking your AI-written share is genuinely useful. Used as a bragging metric, it invites exactly the rubber-stamping it should discourage.

Measure yours

Stop guessing at the number. Run npx shippa, read the lines-shipped figure straight from your logs, and watch the trend over a few weeks. Then compare notes: the AI coding leaderboard shows what other developers are actually shipping, not what they claim on social media.

Try it yourself

See your own stats in one line.

Shippa reads your local Claude Code, Codex, and Cursor logs and turns them into lines shipped, tokens, spend, and a streak. 100% local, no account.