AI code attribution is missing when Git repositories are accessed through symlinks inside a non-Git workspace

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

AI code attribution is missing when Git repositories are accessed through symlinks inside a non-Git workspace.
The workspace itself is not a Git repository. It is only a regular directory that groups multiple projects together.
For example:
workspace/ ← NOT a Git repository
├── project-a → repos/project-a
└── project-b → repos/project-b

The actual Git repositories are:
repos/project-a/ ← Git repository A
repos/project-b/ ← Git repository B

When Cursor Agent edits files through a symlinked path such as:
workspace/project-a/…

and those changes are committed to the actual repository at:
repos/project-a/…

the commit succeeds normally, but the Agent-generated lines are not attributed as AI-generated code.
In the AI code statistics, the AI line count for the commit is 0, even though the diff was generated entirely by Cursor Agent.

Steps to Reproduce

  1. Create a regular directory named workspace. Do not initialize Git in this directory.

  2. Create two independent Git repositories:
    repos/project-a/
    repos/project-b/

  3. Add them into the workspace using symlinks:
    ln -s /path/to/repos/project-a workspace/project-a
    ln -s /path/to/repos/project-b workspace/project-b

  4. Open workspace/ in Cursor, instead of opening repos/project-a/ directly.

  5. Start a Cursor Agent conversation and ask the Agent to modify files under:
    workspace/project-a/…

  6. Commit the Agent-generated changes to the project-a Git repository.

  7. Check the AI code attribution / AI code statistics for that commit.
    The commit is created successfully, but the AI-generated lines are not attributed to the commit.

Expected Behavior

Cursor should correctly associate Agent-generated changes made through a symlinked path with the underlying Git repository.
For example:
workspace/project-a
↓ symlink
repos/project-a
↓
Git repository A

The lines generated by Cursor Agent and included in the commit should be counted as AI-generated code in the AI code statistics.

Operating System

MacOS

Version Information

Cursor Version: 3.22.7
Operating System: macOS 27.0
Build: 26A428

For AI issues: which model did you use?

Grok 4.7 High Fast

For AI issues: add Request ID with privacy disabled

N/A — there was no visible AI request error or UI error, so I do not have a related Request ID.

Additional Information

This may be related to how Cursor maps the symlink path used during Agent edits to the canonical/real filesystem path of the underlying Git repository when associating AI attribution with commits.

For example:

workspace/project-a/…

and:

repos/project-a/…

refer to the same files through the symlink, but they are different filesystem paths.

The workspace itself does not contain a .git directory and is not a Git repository. Only the symlink targets are Git repositories.

There is no visible UI error. If needed, I can provide Developer Tools Console logs.

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey @LiuChao,

Confirmed on our side. When the folder you open isn’t itself a Git repo and the repos inside it are symlinks, AI code tracking doesn’t tie the Agent’s edits to those repos, so commits show 0 AI lines. Nothing you misconfigured. We’ve let the team know and it’s an issue we’re tracking.

Workaround: open the real repo folder directly (e.g. repos/project-a), or add each repo as its own folder in a multi-root workspace (File > Add Folder to Workspace…, then File > Save Workspace As…). Edits after switching should count on your new commits; commits already made through the symlinked path won’t be counted retroactively.

I’ll post here if there’s an update.

Hi @mohitjain

Thanks for confirming this.

It’s helpful to know the issue has been reproduced on your side and that our setup is not misconfigured.

The workaround is usable, but it doesn’t fit our current workflow very well, since we intentionally use a non-Git parent workspace to organize multiple repositories through symlinks.

Do you have any plan or ETA to support AI Code Tracking correctly in this setup?

Please keep me posted if there’s any update.

Thanks again for looking into this.