Industry
The Environmental Impact of AI-Written Code: What a Year of Data Shows
CNaught Team
May 13, 2026

AI coding agents are a fast-growing source of carbon emissions that won't show up on any cloud sustainability dashboard, run on someone else's infrastructure, and aren't yet standard in any Scope 3 inventory. They belong in yours anyway.

Daily average · last 7 days
0
AI-authored commits per day on public GitHub
In brief

The environmental impact of data centers is catching headlines. Coding agents are one growing contributor: autonomous tools that plan, create, test, and run software, often consuming millions of tokens for modest output.

Year-over-year growth
growth in AI-authored commits over the last year
AI share · last 7 days
0%
of all GitHub push events are AI-authored commits

→ Agent activity has scaled rapidly on two metrics in the last six months: agents now produce 5x as many daily commits and 50% more new branches than they did six months ago, and the curve is still steepening.

Commits are the units of code a developer or agent saves. Branches are parallel workstreams within a project.

→ We estimate AI coding agents now produce more than 15x the tCO2e they did six months ago. A conservative estimate puts current activity at 5 to 60 tCO2e per day. At the high end, that's roughly 360 economy LA-SF round trips, every day, using EPA-referenced aviation emission factors.

→ Most sustainability officers know three of the names that matter in this category: Claude Code, GitHub Copilot, Cursor. We track 30+.

To get a clearer picture of the scale, we built an open-source tool grounded in academic research that identifies AI-authored code on public GitHub. The data is the basis for everything that follows.

The International Energy Agency (IEA) and cloud providers tell us how much electricity AI infrastructure consumes at the macro level. What they don't tell us is which downstream workloads are driving that growth, or how those workloads should be accounted for in the Scope 3 inventories of the companies using them. AI coding agents are a useful place to start: the activity is measurable, the growth is documented, and the emissions belong somewhere in your Scope 3 inventory whether or not you've found a home for them yet.

Three reasons the category deserves sustainability attention now:
1
Scale

Coding agents now produce upwards of 5% of all code as measured by share of new GitHub branches. This is a conservative estimation as it excludes AI coding assistants and agents that don't leave explicit signatures in code.

2
Growth

Agent commit volume is up 5x in the last six months. New branches authored by agents are up 50% in the same window. Both metrics are still accelerating.

3
Missing Measurement

Most agents have an invisible footprint because they're running on third-party infrastructure, so they won't show up in your AWS Sustainability Console, your Azure dashboard, or your Google Cloud equivalent. If you want to account for this in your Scope 3 emissions, you'll need to track your token usage from agent providers and make estimates from there.

How AI is Affecting the Environment: The Broader Context

Global data center electricity consumption is projected to roughly double, from 415 TWh in 2024 to around 945 TWh by 2030 — slightly more than Japan's current total electricity consumption. Data center electricity demand grew 17% in 2025, with AI-focused data centers growing 50% — well outpacing the 3% growth in global electricity demand overall. 

The hyperscalers are seeing emissions climb in step: Microsoft's emissions are up 23.4% since 2020 against a 168% increase in energy use, with the company attributing the increase to AI and cloud expansion. Google's data center electricity demand is up 27% year-over-year, even as the company reduced its data center energy emissions by 12% through efficiency gains and clean energy procurement. 

Training emissions for individual frontier models keep rising too: the Stanford AI Index 2026 estimates training emissions for xAI's Grok 4 alone at 72,816 tCO2e, equivalent to driving roughly 17,000 cars for a year.

What AI Coding Agents Are

Unlike chat agents like ChatGPT, Copilot, or Gemini, which output code in a browser window for a human to copy and paste, agents make actual changes to your company's code base just like a developer would. Examples include Claude Code from Anthropic, Copilot SWE Agent from GitHub, and Codex from OpenAI. We track 30+ others in our dataset.

Agents are also only the tip of the iceberg. AI autocomplete tools, such as the original GitHub Copilot, Tabnine, and Cursor's editor mode, are much more pervasive and have their own significant environmental footprint. We focus on agents specifically because their activity is more measurable: many agents sign their own commits, while autocomplete leaves no unique trace because the human is still the one saving the change. Agent usage is also predicted to eclipse autocomplete in the years ahead.

For scale, GitHub reported more than 20 million all-time Copilot users by mid-2025 (a figure that includes both autocomplete and agent users), with adoption at 90% of Fortune 100 companies. Our own pipeline data on agent-attributed commits gives a more focused view of agent activity specifically.

Definition What are tokens?

A token is the basic unit AI models use to process and generate text. It can be a whole word, part of a word, a punctuation mark, or a special character — roughly four characters on average. As a rough rule of thumb, 1,000 tokens equals about 750 words.

Individual lines of code typically use fewer tokens than equivalent natural language, but coding sessions consume far more total tokens than chat sessions: agents read large codebases, make multiple back-and-forth iterations to test and debug, and re-process context across tool calls. Token counts drive API costs, context limits, and energy use.

The Landscape is Wider Than the Headlines

Top AI coding tools by commit volume

Claude Code 1.1M
Copilot SWE Agent 542k
Jules (Google) 105k
Cursor 43k
OpenAI Codex 12k
Daily commits · last 30 days. Hover a row for share of total.

If you've encountered AI coding agents through the tech news cycle, you're likely already familiar with a few of the big ones: Claude Code, GitHub Copilot, and Cursor. These are the ones that get frequent coverage. They're not the whole category.

The distribution is top-heavy: Copilot SWE Agent and Claude Code together account for roughly 85% of the commit volume in our analysis. The remaining 15% is split across 30+ tools, each with their own users, enterprise contracts, and growth trajectories.

AI coding tool adoption also follows a different pattern than most SaaS. Where a company will typically standardize on a single CRM or HR system, AI coding tools get picked up at the team level, and often at the individual developer level. We see this consistently in conversations with customers and engineering peers: a single company's backend team defaults to one tool, the platform team uses another, and individual developers pick whatever fits their workflow.

!

Important: If you're building a Scope 3 view of your company's AI coding tool usage, you'll likely need to aggregate across multiple tools.

A Note on Category Growth: Vendor Switching is Not Your Lever

When tracking AI coding emissions in your inventory, it's tempting to assume that consolidating around a single vendor will reduce your footprint. The public commit data suggests otherwise. 

Anthropic's October 2025 web launch of Claude Code grew the total AI coding agent market sharply above its prior trajectory, with Claude Code capturing nearly all of the new demand and competing agents holding steady. A vendor switch within your developer pool doesn't reduce your AI code emissions if the launches grow the category, and they have, repeatedly, over the past year.

For the full analysis of what the launch revealed about market dynamics, see our companion piece Distribution, Not Capability: What Claude Code's Web Launch Revealed About AI Coding Adoption.

How Big is the Per-Developer Footprint?

Precise per-developer numbers would require granular data — model choice, session length, codebase size, task complexity — and would still vary widely. We worked through an estimate step-by-step in our companion piece, How to Estimate the Carbon Footprint of AI-Written Code: A Methodology Walkthrough. The headline numbers are below.

Applying the Jegham et al. (2025) LLM inference energy methodology to a heavy Claude Code user generating roughly 50 agent-attributed commits per month, we estimate:

Per developer · per year
~252 kg
CO2e per developer per year
That's equivalent to ~1.5 economy round-trip flights between Los Angeles and San Francisco
200-developer org · per year
~50 tCO2e
per year for a 200-developer organization
That's equivalent to ~11 average US passenger vehicles driven for a year

This is a conservative measure. We only estimate output token usage, not the input tokens used to create the tasks, and we don't include the very compute-intensive model training. 

For a 200-developer organization, this is a small but real new line item today. And the trajectory is what matters. At 5x growth every six months, this is the kind of category sustainability teams will wish they'd started measuring early.

What This Means for Your Scope 3 Inventory

Total estimated footprint · AI-authored code on public GitHub
Estimated annual energy · trailing 365 days
0M
kWh/year — equivalent to about 1,057 US homes' annual electricity
Estimated annual emissions · trailing 365 days
0
tCO2e/year from AI-written code on public GitHub

The data covered so far is precise enough to demonstrate that AI coding agent emissions are real, growing, and measurable. The same data is not precise enough to support a per-engineer benchmark in your annual report.

What works instead is a measurement system that captures raw inputs today and applies the best-available estimation methodology at reporting time. Four practical steps:

  1. Track tools at the team, not company, level.
    In conversations with companies, we have heard that adoption has been more bottom-up than top down. Survey engineering leads on which tools their teams actually use, expect the answer to change every quarter, and plan to re-survey.
  2. Capture raw inputs (tokens, model, provider, time).
    Raw inputs stay valid even when carbon estimation methods change. When a more refined framework releases, you re-derive carbon from the same raw inputs rather than rebuilding your data collection from scratch.
  3. Apply current-best estimation methodology.
    Today, we believe that’s the Jegham et al.'s framework. But this field is rapidly evolving. Point your reporting at "current-best methodology as of [date]" and build for flexibility. We advise against  over investing in a specific framework.
  4. Get ahead on carbon accounting.
    Identify how you want to account for AI code emissions. Typically, they fall under Category 1 (Purchased Goods and Services) if procured as a vendor service. But it ultimately depends on how your company is deploying them. For example, if you decide to host your own tool, it could become a Scope 2 emission instead. For companies with Science-Based Targets initiative (SBTi) commitments, this line item needs a home in your inventory and a plan for handling its growth trajectory.

Want the full methodology? We worked through the math step-by-step in our methodology walkthrough, with all assumptions and source citations.

How CNaught Helps

For engineering teams that want to start measuring AI coding emissions today, Carbonlog is our open-source Claude Code plugin that tracks CO2 and energy consumption per AI coding session. It's based on the same Jegham et al. methodology referenced throughout this piece, and it's the most direct path to producing the raw inputs your sustainability team will need for Scope 3 reporting.

For sustainability teams ready to offset what they measure, CNaught's verified carbon credit portfolios are designed for fast-moving Scope 3 line items like AI code emissions. The full detection pipeline, methodology, and historical data behind this analysis are also open source.

Get Started

Track CO2 and energy consumption per Claude Code session, free and open source.

Try Carbonlog

If you're building Scope 3 measurement for AI-driven code at your organization, we can help.

Talk to us about your AI emissions

What We Can't Tell You

Public Repositories Only

Per GitHub's Octoverse reporting, roughly 80% of developer contribution volume happens in private repos, which this analysis doesn't see. The volume and emission numbers should be read as the observable trajectory; the full-category footprint is plausibly four to five times larger. Autocomplete tools, water use, hardware manufacturing emissions, and model training are also outside the scope of these numbers. The published numbers are a floor, not a ceiling.

A Two-Week Clean Window, Not a Six-Month Verdict

Nine days after Claude Code's web launch, Cursor shipped version 2.0. Nine days after that, OpenAI released GPT-5.1. Within the same four-week stretch: Gemini 3 Pro, GPT-5.1-Codex-Max, Claude Opus 4.5. The post-launch period is the single most event-dense stretch in the year of data we have. Our "no cannibalization" finding is about the first two weeks, not the next six months. Full caveats are in the methodology walkthrough.

Methodology

Commit counts in this analysis come from CNaught's open-source pipeline, which queries the GitHub Search API and attributes commits to AI agents that sign their own author identity. The dataset covers public repositories only and inherits roughly 5% sampling error on large result sets. Energy and carbon estimates apply the Jegham et al. (2025) inference framework. Full methodology, source code, and historical data are available in our open-source repository. For the step-by-step walkthrough, see our companion piece, How to Estimate the Carbon Footprint of AI-Written Code.