git on each developer’s machine, automatically recording which lines of code were authored with AI assistance.
What’s tracked
- AI authorship — Which lines of code were written with AI assistance
- Tool attribution — Which AI tool contributed to each change (e.g., Cursor, Claude Code, Copilot)
- Commit-level data — Per-commit AI vs human contribution breakdown
How it works
Git attribution uses git-ai, which installs a binary that sits on the developer’sPATH in front of git. Whenever any process calls git, the git-ai binary intercepts the call.
In addition to the binary itself, the install script configures hooks into each detected AI coding tool on the machine (e.g., updating Claude Code’s config, Cursor’s settings, etc.). These hooks notify git-ai whenever an AI tool generates code — a “post tool use” callback that records which tool was used and what code it produced.
When a developer makes a commit, git-ai reconciles all recorded AI activity against the commit’s diff to determine exactly which lines were AI-assisted and which were human-written. This data is stored as git notes (refs/notes/ai) and pushed alongside regular commits.
Weave reads this metadata during repository sync to attribute code contributions accurately.
Prerequisites
- Admin access to your Weave organization
- For organization-wide deployment: an MDM solution (Fleet, Intune, Kandji, Jamf, or similar)
- For individual setup: terminal access on the developer’s machine
Setup
Option A: Deploy via MDM (recommended for teams)
Use this approach to roll out git-ai across your entire engineering organization without requiring action from individual developers.Download the MDM install script
- macOS / Linux:
install.sh - Windows (incl. WSL):
install.ps1
Deploy via MDM
root, the wrapper installs git-ai as the logged-in console user and restores ownership of ~/.git-ai and agent config directories so git-ai works for that developer. On Windows, the script must run in the user’s context (it refuses an elevated Administrator shell) and also installs git-ai into any WSL distributions on the machine.Verify with a test group
- Have a test developer generate some AI-assisted code (e.g., use Cursor, Claude Code, or Copilot to write a function)
- Have them run
git-ai statusin their terminal — this should show checkpoints indicating which AI tool generated code - Have them commit and push the code
- Merge the pull request that contains the commit, then check Weave within a few hours. Attribution metrics only count commits from merged pull requests, and data appears after the next repository sync cycle (runs approximately every 3 hours)
Roll out to all developers
MDM deployment notes
~/.gitconfig ownership: The Weave wrapper installs as the logged-in user on macOS when MDM runs as root, but if your policy still leaves ~/.gitconfig root-owned, restore ownership after install (for example chown "$USER" ~/.gitconfig in Jamf, $3 is the logged-in username).Option B: Individual installation
For single developers or small teams, run the install script directly on each machine.Download and run the install script
- Whether the binary was installed successfully
- Where the binary was placed on your
PATH - Which AI tool hooks were detected and configured
Verify installation
Make a commit and push
Video walkthroughs
Setting up git attribution in Weave (macOS)
Setting up git attribution in Weave (Windows)
Verifying data in Weave
After git-ai is installed and a developer has pushed at least one commit, there is a short delay before data appears in Weave. The repository clone job runs approximately every 3 hours, and attribution metrics include a commit only after its pull request is merged. To confirm everything is working end-to-end:- A developer with git-ai installed generates AI-assisted code
- They commit, push to a repository connected to Weave, and merge the pull request
- Within a few hours, AI attribution data appears in the Weave dashboard under the relevant metrics
Metrics enabled
Git attribution enhances the accuracy of:- AI code LOC — Precise line-level AI attribution
- AI output percentage — Accurate AI contribution ratios
Troubleshooting
Binary not installed correctly
Binary not installed correctly
PATH.How to check:PATH.If installed manually: Re-run the install script and review its output — it will report whether installation succeeded and where the binary was placed.If deployed via MDM: Check your MDM solution’s deployment logs for errors during script execution. Common causes:- The script failed silently due to permissions issues
- The target directory wasn’t writable
- A prior version was partially installed
AI tool hooks not configured
AI tool hooks not configured
- Generate some AI-assisted code using your AI tool of choice
- Run
git-ai status - If you see checkpoints showing the tool and generated code — hooks are working
- If the output is empty — hooks aren’t configured for that tool
Data not appearing in Weave
Data not appearing in Weave
- Verify the repository is connected to Weave (check Data → Repositories)
- Confirm the developer actually pushed the commit (not just committed locally) and that its pull request is merged
- Check that
git-ai statusshows checkpoints on the developer’s machine - Contact support@workweave.ai if the issue persists
Git config broken after MDM deployment
Git config broken after MDM deployment
~/.gitconfig may be root-owned.How to check:root instead of the developer’s username, this is the issue:Windows + WSL issues
Windows + WSL issues
Works for some developers but not others
Works for some developers but not others
- Same OS, different results? Check if the affected developers have a different shell configuration,
PATHsetup, or security software that might interfere - Different OS? If it works on macOS but not Windows (or vice versa), the install script for that platform may have an issue — check MDM logs for the failing platform
- WSL users? Developers using WSL need a separate Linux installation inside WSL (see above)
- New AI tool? If git-ai was deployed before the developer installed their AI coding tool, the hooks may not be configured yet, so re-run the install script
git-ai status after generating AI code and share the output with your IT team or support@workweave.ai.MDM deployment not working for anyone
MDM deployment not working for anyone
- Check your MDM solution’s execution logs for the install script — look for errors or non-zero exit codes
- Verify the script was distributed to the correct device groups
- Confirm the script has execution permissions
- Try running the script manually on one machine to see its output — this will clearly indicate whether the binary was installed and which hooks were configured
- Ensure you’re deploying the latest version of the install script from Weave
One AI tool tracked but not another
One AI tool tracked but not another
- Re-run the install script — it will detect all AI tools currently installed and configure hooks
- If the tool was installed after git-ai, its hooks may not be configured yet, because the install script configures hooks for tools present at install time
- Run
git-ai statusafter generating code with the missing tool to confirm whether it’s now tracked
FAQ
How long until data appears in Weave after installation?
How long until data appears in Weave after installation?
git-ai status.Does the developer need to use an AI tool to test the installation?
Does the developer need to use an AI tool to test the installation?
git-ai status for checkpoints.Can we test with a small group before full rollout?
Can we test with a small group before full rollout?
What happens if a developer already has git-ai and we re-run the script?
What happens if a developer already has git-ai and we re-run the script?
Does git-ai affect normal git operations?
Does git-ai affect normal git operations?
git binary. Developers won’t notice any difference in their normal git workflow.Data privacy
Git attribution stores metadata about AI tool usage in git notes, including:- Which AI tool was used
- Number of AI-assisted lines per commit
- Schema version information
- File paths indicating which files had AI-assisted changes
- Conversation transcripts (prompts and assistant responses)
Related
- AI output attribution — How Weave calculates AI attribution
- Claude Code — CLI-based AI assistant
- Cline — VS Code extension for AI coding
