Cursor
Track the AI Code written by Cursor
Using Cursor with git-ai
git-ai fully supports both authorship and prompt tracking for Cursor (IDE and CLI agent). To use git-ai with Cursor, just run git-ai install-hooks.
If you'd like to verify that Cursor has picked up your hooks:
- Cmd+Shift+P to open Cursor command input
- In the input box, type
Output: Show Output Channels - From the dropdown, select or type
Hooks - You should see in the logs a message like
Loaded 2 user hook(s) for steps: afterFileEdit, beforeSubmitPromptindicating that Cursor has loaded the hooks.
How it works
git-ai adds hooks to your user-level Cursor Settings ~/.cursor/hooks.json. These hooks automatically call git-ai before and after file edit tool calls to ensure accurate AI authorship tracking.
{
"hooks": {
"afterFileEdit": [
{
"command": "/absolute/path/to/git-ai checkpoint cursor --hook-input stdin"
}
],
"beforeSubmitPrompt": [
{
"command": "/absolute/path/to/git-ai checkpoint cursor --hook-input stdin"
}
]
},
"version": 1
}