Cursor v1.0.0 – Loop-based edits and executions fail intermittently; Claude 4 (Sonnet) stalls or times out

When using loops in scripts that interact with Cursor (e.g., edit_file, execute_command, or CLI equivalents), actions sometimes silently fail. This includes edits not being applied, executions doing nothing, or Claude taking an extremely long time to respond. This behavior is present regardless of prompt mode, agent type, or Claude 4 settings.

Reproduction Steps:

  1. Create a Python script that loops over several files/functions.
  2. In each loop:
  • Call cursor.edit_file() with targeted edits.
  • Call cursor.execute_command() (or CLI cursor exec).
  1. Observe logs and system behavior during the loop.

Observed Issues:

  • Edits sometimes don’t apply, despite the logs saying β€œApplied.”
  • Executions sometimes do nothing β€” no output, no error, no trace.
  • Claude (Sonnet) can hang for minutes or fail to return completely.
  • Issue persists even with no system prompt, no chain-of-thought, and using Sonnet 100% (not switching to Haiku).

Expected Behavior:

  • Every edit_file() should apply changes or raise an error.
  • Every execute_command() should run the command or fail explicitly.
  • Claude 4 Sonnet should respond consistently within expected time bounds.

Impact:

  • Scripted workflows become unreliable.
  • Batch tasks randomly fail or hang.
  • Debugging is difficult due to silent failures and inconsistent behavior.

Example Log:

scss

CopyEdit

βœ“ edit_file(): hame.py updated (line 257)
βœ“ execute_command(): python hame.py
β€” no output β€”
βœ“ edit_file(): hame.py updated
βœ— Claude response stalled for 2m 14s, then failed

Additional Notes:

  • Behavior is the same across multiple OS environments.
  • Disabling chain-of-thought, memory, or instructions has no effect.
  • Even with simple edits (like print("test")), the bug persists.

1 Like