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
- The AI tool reports exactly how many lines it generated or modified and which commits were involved in the modification
- Weave attributes those specific lines to the AI tool
- Remaining lines are attributed to human developers
- Multiple AI tools can be tracked simultaneously
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:
- git-ai records which lines in each file were authored by an AI session
- Weave reads these attestations during repository sync
- Per-tool line counts are extracted from the session metadata
- Attribution is calculated as the ratio of AI-attested lines to total lines added
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
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:
- Weave collects daily AI lines of code (LOC) per tool for each developer
- These AI LOC entries are matched chronologically against commits in the developer’s pull requests
Special cases
Claude Code attribution
Claude Code has special handling due to multiple possible data sources: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
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
- 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:- Tool Integration: Connect AI tools that provide API data for most accurate attribution
- Git Configuration: Ensure AI tools are properly configured as co-authors
Best practices
To ensure accurate AI attribution:- Use enterprise AI tools when possible for API-level accuracy
- Configure Git co-authorship for AI tools in your workflow
- Review attribution data regularly to understand AI impact
- Communicate the approach to your team - using AI is encouraged, not penalized
