Agent Shell Commands Timeout on Git Operations, Leaving Stale Lock Files

Hey, thanks for the report. This is a known issue in version 2.4.22. Agent terminal commands can time out or hang, especially with git operations.

Here are a few workarounds (try them in order):

  1. Change Auto-Run Mode (fastest fix)

Cursor Settings > Agents > Auto-Run Mode > switch to “Ask Every Time” instead of auto mode.

A user in a similar thread confirmed this fixes the .git/index.lock issue on macOS.

  1. Disable terminal shell integration

Settings CMD + , > search for terminal.integrated.shellIntegration.enabled > set it to false.

Another user fixed .git/index.lock and other lock file issues this way on Windows.

  1. Roll back to 2.3.34 (if the first two don’t help)

Download it from Download · Cursor and pick version 2.3.34.

Note: if you already used 2.4.x, your chats might break after rolling back due to a format mismatch.

About iCloud: if your project is in iCloud Drive, it can add latency to git operations. If you can, try moving it to a local folder outside iCloud and see if the issue still happens.

Let me know if this doesn’t help.