Hey, thanks for the report.
We’ve had reports of this on both Windows and macOS. We shipped a fix earlier, but it looks like it’s still happening on 2.6.18. I’m passing this back to the team again.
Here are a few workarounds that helped other users on macOS:
- Switch Auto-Run Mode to “Ask Every Time”
Cursor Settings > Agents > Auto-Run Mode > “Ask Every Time”
A user in the original thread confirmed this fixes the .git/index.lock issue. It looks like the sandbox in auto mode is the trigger.
- Disable terminal shell integration
SettingsCMD + ,> search forterminal.integrated.shellIntegration.enabled> set it tofalse
Another user fixed lock file issues this way.
- Quick cleanup when it happens
Fully quit Cursor (check Activity Monitor to make sure all processes are closed) > delete.git/index.lock> run your git commands > reopen Cursor.
Quick question: does this happen when the agent runs git commands, or when you manually run git add in the terminal while Cursor is open? This will help narrow it down and figure out what exactly is triggering it.