Git AI

Cursor

Track Cursor generated AI-code all the way to production.

Supported since: 2025-10-15

Capabilities

FeatureSupported
Agent Mode
Tab Completion✓ (beta)
Cursor CLI✗ waiting for pre-edit hook
Prompt Saving

How this integration works

Cursor IDE has native support for Hooks. When you install Git AI it will automatically installs the neccesary hooks beforeSubmitPrompt and afterFileEdit.

~/.cursor/hooks.json

{
  "hooks": {
    "afterFileEdit": [
      {
        "command": "/Users/aidancunniffe/Desktop/git-ai/target/debug/git-ai checkpoint cursor --hook-input stdin"
      }
    ],
    "beforeSubmitPrompt": [
      {
        "command": "echo 'them'"
      },
      {
        "command": "/Users/aidancunniffe/Desktop/git-ai/target/debug/git-ai checkpoint cursor --hook-input stdin"
      }
    ]
  },
  "version": 1
}

Troubleshooting

Not seeing any AI attributions when you run git commit? Here are some common issues to check for:

Verify that the git-ai binary is properly installed and on your path

# macOS/Linuxwhich git# Windows (PowerShell or CMD)where git

Expected Output: ~/.git-ai/bin/git (or C:\Users\...\.git-ai\bin\git on Windows)

If it's not showing up, first try restarting all your shells.

If it's still not working, re-run the installation script and verify you're not doing anything unusual with your PATH in your shell config.

If the problem persists, open an issue on the GitHub repository.

Verify that your Coding Agent is properly calling Git AI after it generates code

git-ai status
you  ██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ ai   4%                                   96%   100% AI code accepted | waited 33s for ai29 secs ago     +103      0  Cursor claude-4.5-opus-high-thinking46 secs ago       +2     -1  Cursor claude-4.5-opus-high-thinking57 secs ago      +12     -2  Cursor claude-4.5-opus-high-thinking1 mins ago        +1     -2  Aidan Cunniffe2 mins ago       +53      0  Cursor claude-4.5-opus-high-thinking2 mins ago         0     -3  Cursor claude-4.5-opus-high-thinking2 mins ago        +4     -6  Cursor claude-4.5-opus-high-thinking3 mins ago        +2     -1  Cursor claude-4.5-opus-high-thinking5 mins ago        +6    -16  Claude claude-opus-4-5-202511015 mins ago         0     -2  Aidan Cunniffe

You should see several AI checkpoints linked to the current HEAD sha. If there are not any, the hooks for your agent are not installed properly.

Re-run:

git-ai install-hooks

Generate more code and run git-ai status again. If you're still not getting AI attributions, restart all your shells, every Agent Session, and your IDE.

If you're still not getting any AI attributions, open an issue on the GitHub repository.

Are you using a Git Client to stage your changes?

Sometimes tools like Sublime Merge, Sourcetree, GitButler, etc. package their own vendored version of git which won't be wrapped by Git AI.

To test if that's the issue, try using the terminal to run git commit after generating some AI code. If that works but using the Git Client doesn't, this is the problem.

Solution: Configure your Git Client to use the git symlink in the .git-ai/bin directory.

For example, in Sublime Merge: Settings → Advanced → Git Binary needs to be set to ~/.git-ai/bin/git

Sublime Merge Settings

If you run into any issues connecting the git symlink to your Git Client, open an issue on the GitHub repository.

Make sure there are no Cursor Hook Errors.

Got to CTRL + SHIFT + P and search for "Output: Show Output Channels". Then select "Hooks".

This will show you a log of any errors encountered calling the Cursor Hooks.

If you see anything, please open an issue on the GitHub repository.

If you're not seeing Cursor Hook invocations when the agent is working your hooks.json file is likely corrupted or otherwise not being read correctly.