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
-
Create a regular directory named workspace. Do not initialize Git in this directory.
-
Create two independent Git repositories:
repos/project-a/
repos/project-b/ -
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 -
Open workspace/ in Cursor, instead of opening repos/project-a/ directly.
-
Start a Cursor Agent conversation and ask the Agent to modify files under:
workspace/project-a/… -
Commit the Agent-generated changes to the project-a Git repository.
-
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