Skip to main content
Weave splits the code in each pull request (PR) between the developer and the AI tools that helped write it, such as Claude Code, Cursor, GitHub Copilot, or Codex, and reports the AI share as AI output percentage. It prefers precise signals, such as AI tool data and line-level git notes, falls back to co-author trailers and activity matching, and tracks each AI tool separately. AI tools are also labeled foreground or background AI, so work from autonomous agents can be told apart from work developers do with an assistant.

Overview

When developers use AI coding tools like Cursor, GitHub Copilot, or Windsurf, Weave automatically tracks and attributes the code contributions. The system ensures that:
  • Human developers receive full credit for driving the work
  • AI contributions are accurately measured
  • Attribution adapts based on available data quality
  • Teams get clear visibility into AI tool effectiveness

Attribution strategies

Weave employs multiple attribution strategies, automatically selecting the most accurate method based on available data. When multiple data sources are available for the same contribution, Weave uses a priority system to avoid double-counting — the highest-priority source wins.

1. API data (highest priority)

Used with: Cursor Enterprise
When AI tools provide detailed API data about their contributions, Weave uses this as the primary source of truth. This includes:
  • Cursor’s AI Code Tracking API: Available with Cursor Team/Business plans, this API provides exact line-by-line attribution for every commit
How it works:
  1. The AI tool reports exactly how many lines it generated or modified and which commits were involved in the modification
  2. Weave attributes those specific lines to the AI tool
  3. Remaining lines are attributed to human developers
  4. Multiple AI tools can be tracked simultaneously
Example calculation:

2. Git attribution

Used with: Any AI tool when git-ai is deployed
When git-ai is installed, it stores line-level AI authorship data in git notes (refs/notes/ai). This provides precise, per-file attribution for each commit. How it works:
  1. git-ai records which lines in each file were authored by an AI session
  2. Weave reads these attestations during repository sync
  3. Per-tool line counts are extracted from the session metadata
  4. Attribution is calculated as the ratio of AI-attested lines to total lines added
This is the most accurate attribution method after direct API data, as it tracks exactly which lines were AI-authored at the git level.

3. Co-authorship metadata

Used with: Any AI tool that appears as a Git co-author
Many AI tools are configured to appear as co-authors in Git commits. When this metadata is available, Weave attributes the commit’s code to the AI tool. Default split:
  • When an AI tool is listed as a co-author, the commit is attributed fully to AI
  • The developer retains full output credit for driving the work
Multiple contributors example:

4. Bucket attribution (lowest priority)

Used with: All AI tools when direct attribution isn’t available
For AI tools without API data, git attribution, or co-authorship information, Weave uses a time-series algorithm that matches AI coding activity to human commits. How it works:
  1. Weave collects daily AI lines of code (LOC) per tool for each developer
  2. These AI LOC entries are matched chronologically against commits in the developer’s pull requests
Example:
This approach ensures that AI contributions are attributed based on actual coding activity patterns. But it’s not as accurate as the other approaches. We find this will give directionally accurate numbers but some PRs may be over or under-attributed.

Special cases

Claude Code attribution

Claude Code has special handling due to multiple possible data sources:
If your team customizes Claude Code’s attribution.commit footer in .claude/settings.json (or via the plugin’s SessionStart sync), Weave learns that suffix per repository or plugin account and treats commits whose messages end with it as Claude Code output. Standard Claude co-author trailers are still handled through the co-authorship path above.

Multiple AI tools

When multiple AI tools contribute to the same code:
  • Each tool’s contribution is tracked independently
  • Contributions are never double-counted
  • The human developer receives credit for orchestrating all AI tools

No AI detection

When no AI assistance is detected in a commit:
  • Multiple human authors receive equal attribution
  • Each co-author gets an equal share of the output value
  • No AI attribution is applied

Work from before an AI tool was connected

When you connect a code platform, Weave imports your past pull requests. AI tool activity (telemetry, API data, plugins) only starts arriving once that AI tool is connected. Pull requests merged before then can only be attributed to AI through signals stored in git itself, such as co-author trailers or git attribution notes. If your developers used an AI tool heavily before you connected it, and their commits don’t carry those trailers (for example, because the AI tool’s co-author line is turned off), their older output shows as mostly human. AI attribution for new pull requests starts once the tool is connected and each developer’s AI tool account is linked on the Members page.

LOC type breakdown (human, AI, codegen)

The Lines of code chart (grouped by LOC type) uses the same human vs AI attribution strategies described above, applied to merged PR diffs rather than output estimates.
  • Human and AI — split from filtered LOC (meaningful source files only)
  • Codegen — lines in auto-generated files (protobuf, GraphQL/SQLC outputs, lock files, etc.) that Weave excludes before attribution
See PR lines of code for the full calculation.

Output credit vs. AI attribution

It’s important to understand the distinction:
  • Output Credit: The human developer always receives full credit for output when using AI tools, as they are driving the work
  • AI Attribution: Tracks what percentage of the actual code was AI-generated
This dual tracking ensures:
  • Developers aren’t penalized for using AI tools efficiently
  • Teams can measure AI tool adoption and effectiveness
  • Individual productivity metrics remain fair

Configuration

Organizations can configure AI attribution through:
  1. Tool Integration: Connect AI tools that provide API data for most accurate attribution
  2. Git Configuration: Ensure AI tools are properly configured as co-authors

Best practices

To ensure accurate AI attribution:
  1. Use enterprise AI tools when possible for API-level accuracy
  2. Configure Git co-authorship for AI tools in your workflow
  3. Review attribution data regularly to understand AI impact
  4. Communicate the approach to your team - using AI is encouraged, not penalized

Common questions

Can Weave tell autonomous agent work apart from developer-assisted AI work?

Yes. Weave labels AI tools as foreground AI, which engineers interact with directly (for example Claude Code, Cursor IDE, and GitHub Copilot), or background AI, which works automatically in the background (for example Devin, Cursor Agent, and Jules). The Background vs. foreground AI chart, which you can add to a custom dashboard, splits AI lines of code between the two, and you can register internal bots as custom AI agents in either category.

Does using AI lower a developer’s output?

No. The developer keeps full output credit for work they drive with AI tools, and attribution only records how much of the code came from AI. See output credit vs. AI attribution.

Which attribution method is most accurate?

AI tool data, such as Cursor’s AI Code Tracking API, comes first, followed by line-level notes from git-ai. Co-author trailers attribute a whole commit to AI, and bucket attribution, which matches daily AI activity to commits, is directional and can over- or under-attribute individual PRs.

Why do older pull requests show mostly human work?

AI tool data only starts arriving once a tool is connected, so earlier PRs can only be attributed through signals stored in git, such as co-author trailers or git-ai notes. See work from before an AI tool was connected.
Last modified on October 17, 2026