Skip to main content
Git attribution tracks AI-assisted code changes at the git level, providing accurate attribution data for commits made with AI coding tools. It works by installing a lightweight binary that wraps 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’s PATH 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

Use this approach to roll out git-ai across your entire engineering organization without requiring action from individual developers.
1

Download the MDM install script

Go to Data → Git attribution (if it’s already connected, open its Setup tab), choose Managed install, and under Download install script download the script for your platform. Weave generates an MDM-safe wrapper (not the raw upstream git-ai installer):
  • macOS / Linux: install.sh
  • Windows (incl. WSL): install.ps1
Always download the latest script before deploying. Weave pins the git-ai release version and updates the wrapper when needed.
2

Deploy via MDM

Distribute the downloaded script using your MDM solution:The script is idempotent and safe to run multiple times. It requires no user interaction. On macOS, when an MDM tool runs the script as 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.
See the important notes on MDM deployment below for edge cases.
3

Verify with a test group

Before rolling out to the full organization, deploy to a small test group of active developers first:
  1. Have a test developer generate some AI-assisted code (e.g., use Cursor, Claude Code, or Copilot to write a function)
  2. Have them run git-ai status in their terminal — this should show checkpoints indicating which AI tool generated code
  3. Have them commit and push the code
  4. 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)
4

Roll out to all developers

Once verified with the test group, expand the MDM deployment to all target machines.

MDM deployment notes

Do not substitute the upstream git-ai installer. Pasting curl | bash from the git-ai repo into an MDM tool that runs as root leaves ~/.git-ai and agent config directories root-owned, which breaks git-ai for the developer (for example, SQLite errors like “unable to open database file”). Use the signed installers or the Weave-generated wrapper under Managed install on Data → Git attribution.
macOS / Linux ~/.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).
Windows elevation: The Windows wrapper exits if launched from an elevated Administrator shell. Configure your MDM policy to run it in the signed-in user’s context.

Option B: Individual installation

For single developers or small teams, run the install script directly on each machine.
1

Download and run the install script

Go to Data → Git attribution (if it’s already connected, open its Setup tab). Choose Individual install and run the Quick install command for your platform, or choose Managed install and download the script under Download install script. To run a downloaded script:macOS / Linux:
Windows (PowerShell, not as Administrator):
The script output will confirm:
  • Whether the binary was installed successfully
  • Where the binary was placed on your PATH
  • Which AI tool hooks were detected and configured
2

Verify installation

Generate some AI-assisted code using any supported AI tool, then run:
You should see checkpoints listing which AI tool generated code. If the output is empty, see the troubleshooting section below.
3

Make a commit and push

Commit your changes and push to the remote repository. Weave will pick up the git-ai attribution data on the next repository sync (approximately every 3 hours).

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:
  1. A developer with git-ai installed generates AI-assisted code
  2. They commit, push to a repository connected to Weave, and merge the pull request
  3. Within a few hours, AI attribution data appears in the Weave dashboard under the relevant metrics
Even commits made without AI assistance will be picked up by git-ai — it records git notes for every commit. You don’t need to use an AI tool to verify the binary is working; any commit will do.

Metrics enabled

Git attribution enhances the accuracy of: Git attribution works alongside AI tool telemetry and plugins without double counting. When git attribution has data for a developer’s AI tool on a given day, it replaces that tool’s telemetry-based AI code estimate for that day instead of adding to it. See choosing a Claude Code connection.

Troubleshooting

The most common issue is the git-ai binary not being present or not being on the developer’s PATH.How to check:
If this returns nothing, the binary wasn’t installed or isn’t on the 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
Even if the binary is installed, git-ai needs hooks configured in each AI coding tool to detect AI-generated code.How to check:
  1. Generate some AI-assisted code using your AI tool of choice
  2. Run git-ai status
  3. If you see checkpoints showing the tool and generated code — hooks are working
  4. If the output is empty — hooks aren’t configured for that tool
If installed manually: Re-run the install script. It will detect AI tools on the machine and configure hooks for each one. The script output lists exactly which tools were detected and configured.If deployed via MDM: The install script configures hooks for all AI tools it detects at install time. If a developer installs a new AI tool after git-ai was deployed, its hooks may not be configured yet. Re-run the install script to configure them right away.
After pushing a commit with git-ai notes, there’s a delay before data shows up in Weave.Expected timeline: Data appears within approximately 3 hours of the pull request merging, as Weave’s repository clone job runs on this cycle and attribution metrics count commits from merged pull requests.If data still isn’t appearing after several hours:
  1. Verify the repository is connected to Weave (check Data → Repositories)
  2. Confirm the developer actually pushed the commit (not just committed locally) and that its pull request is merged
  3. Check that git-ai status shows checkpoints on the developer’s machine
  4. Contact support@workweave.ai if the issue persists
If developers report that their personal git configuration (aliases, user name, signing keys, etc.) stopped working after an MDM deployment, ~/.gitconfig may be root-owned.How to check:
If the file is owned by root instead of the developer’s username, this is the issue:
Fix for affected machines:
Prevent for future deployments: Use the Weave-generated MDM wrapper (not the upstream git-ai installer) and add a post-install ownership fix if needed. See MDM deployment notes.
The Weave Windows wrapper installs git-ai in the native Windows environment and runs the Linux installer inside each WSL distribution it finds. If a developer’s WSL distro was added after deployment, re-run the install script or have them run the macOS / Linux / Windows (WSL) Quick install command (under Individual install on Data → Git attribution) inside WSL.
When git-ai works for part of the team but not everyone, the issue is usually environment differences.Diagnostic steps:
  1. Same OS, different results? Check if the affected developers have a different shell configuration, PATH setup, or security software that might interfere
  2. 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
  3. WSL users? Developers using WSL need a separate Linux installation inside WSL (see above)
  4. 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
For persistent issues, have the affected developer run git-ai status after generating AI code and share the output with your IT team or support@workweave.ai.
If git-ai isn’t working for any developer after an MDM deployment, the install script likely failed during distribution.Steps to diagnose:
  1. Check your MDM solution’s execution logs for the install script — look for errors or non-zero exit codes
  2. Verify the script was distributed to the correct device groups
  3. Confirm the script has execution permissions
  4. 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
  5. Ensure you’re deploying the latest version of the install script from Weave
If git-ai tracks code from one AI tool (e.g., Cursor) but not another (e.g., Claude Code), the hooks for the missing tool aren’t configured.How to fix:
  1. Re-run the install script — it will detect all AI tools currently installed and configure hooks
  2. 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
  3. Run git-ai status after generating code with the missing tool to confirm whether it’s now tracked

FAQ

After a developer installs git-ai and pushes a commit, Weave picks up the data on the next repository sync cycle (approximately every 3 hours), and attribution metrics include the commit once its pull request is merged. In the meantime, you can verify locally that git-ai is working by running git-ai status.
No. Git-ai records notes on every commit, even those made without AI assistance. Any commit and push will confirm the binary is working. However, to verify that AI tool hooks are configured correctly, you should generate some AI-assisted code and check git-ai status for checkpoints.
Yes, and this is recommended. Deploy to a small test group of active developers first, verify data appears in Weave, then expand the MDM deployment to the full organization.
The install script is idempotent — running it again is safe and will update the binary and re-configure hooks without disrupting anything.
No. The git-ai binary is a transparent wrapper — it passes all commands through to the real 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)
This data is stored locally in your git repository’s notes. Weave reads this metadata during repository sync to extract tool attribution and line counts, but does not persist the conversation transcripts or source code content.
Last modified on October 17, 2026