Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
In Agent Mode, when the AI executes sequential terminal commands, there is a ~27 second delay between the completion of one command and the execution of the next command. This delay occurs regardless of command complexity - even trivially simple commands that execute in ~10 milliseconds experience this overhead.
Steps to Reproduce
-
Create a simple test file:
@" Line 1: Test content Line 2: Test content Line 3: Test content Line 4: Test content Line 5: Test content "@ | Set-Content "test_timing.txt" -
Open Cursor IDE and start Agent Mode (Ctrl+I or Cmd+I)
-
Ask the agent to run this command with timestamps:
Run this command: Write-Host "START: $(Get-Date -Format 'HH:mm:ss.fff')"; Get-Content "test_timing.txt" | Select-Object -First 5; Write-Host "END: $(Get-Date -Format 'HH:mm:ss.fff')" -
Immediately after completion, ask the agent to run the same command again (repeat 4 more times for a total of 5 executions)
-
Record the timestamps from each execution and calculate the gaps between END of one run and START of the next
-
Observe: Each transition takes ~26-30 seconds despite the command itself executing in ~10ms
Expected Behavior
- Sequential terminal commands should execute with minimal overhead between calls
- For simple, non-blocking commands, the gap between executions should be < 5 seconds
- The agent should be able to chain rapid terminal operations efficiently
- Terminal-heavy workflows (build scripts, file operations, git commands) should not be bottlenecked by agent orchestration
- Ideal: Near-instant transitions (~1-2 seconds) for trivial commands where no complex reasoning is required between executions
Operating System
Windows 10/11
MacOS
Linux
Current Cursor Version (Menu → About Cursor → Copy)
Version: 2.2.20 (user setup)
VSCode Version: 1.105.1
Commit: b3573281c4775bfc6bba466bf6563d3d498d1070
Date: 2025-12-12T06:29:26.017Z
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Windows_NT x64 10.0.26200
For AI issues: which model did you use?
Claude 4.5 Opus High Max Mode
Additional Information
Bug Report: Significant Delay (~27 seconds) Between Sequential Agent Mode Terminal Executions
Describe the Bug
In Agent Mode, when the AI executes sequential terminal commands, there is a ~27 second delay between the completion of one command and the execution of the next command. This delay occurs regardless of command complexity - even trivially simple commands that execute in ~10 milliseconds experience this overhead.
The bottleneck is not the terminal or shell - commands execute in milliseconds. The delay is entirely in the Cursor/Agent orchestration layer between tool calls.
Measured impact: 5 simple Get-Content commands that took a combined 52 milliseconds of actual execution time required ~2 minutes of total elapsed time due to the ~27 second gap between each agentic call. This represents a 99.95% efficiency loss for sequential terminal workflows.
Environment
| Component | Version/Details |
|---|---|
| Cursor Version | 2.2.20 (build b3573281c4775bfc6bba466bf6563d3d498d1070, x64) |
| OS | Windows 10 (win32 10.0.26200) |
| Shell | PowerShell 7 (C:\Program Files\PowerShell\7\pwsh.exe) |
| AI Model | Claude (Agent Mode) |
Summary
When running sequential terminal commands in Agent Mode, there is a consistent ~27 second delay between the completion of one command and the start of the next, even for trivially simple commands that execute in milliseconds.
Steps to Reproduce
-
Create a simple test file:
@" Line 1: Test content Line 2: Test content Line 3: Test content Line 4: Test content Line 5: Test content "@ | Set-Content "test_timing.txt" -
Open Cursor IDE and start Agent Mode (Ctrl+I or Cmd+I)
-
Ask the agent to run this command with timestamps:
Run this command: Write-Host "START: $(Get-Date -Format 'HH:mm:ss.fff')"; Get-Content "test_timing.txt" | Select-Object -First 5; Write-Host "END: $(Get-Date -Format 'HH:mm:ss.fff')" -
Immediately after completion, ask the agent to run the same command again (repeat 4 more times for a total of 5 executions)
-
Record the timestamps from each execution and calculate the gaps between END of one run and START of the next
-
Observe: Each transition takes ~26-30 seconds despite the command itself executing in ~10ms
Expected Behavior
- Sequential terminal commands should execute with minimal overhead between calls
- For simple, non-blocking commands, the gap between executions should be < 5 seconds
- The agent should be able to chain rapid terminal operations efficiently
- Terminal-heavy workflows (build scripts, file operations, git commands) should not be bottlenecked by agent orchestration
- Ideal: Near-instant transitions (~1-2 seconds) for trivial commands where no complex reasoning is required between executions
Actual Behavior
Each transition between terminal commands takes 26-30 seconds regardless of command complexity.
Measured Data (Fact-Based)
Test Setup
- Simple text file with 21 lines
- Command:
Get-Content "file.txt" | Select-Object -First 20 - 5 sequential executions
Raw Timestamps
| Run | START | END | Execution Time |
|---|---|---|---|
| 1 | 16:37:54.501 | 16:37:54.516 | 15 ms |
| 2 | 16:38:24.190 | 16:38:24.199 | 9 ms |
| 3 | 16:38:51.600 | 16:38:51.610 | 10 ms |
| 4 | 16:39:17.904 | 16:39:17.913 | 9 ms |
| 5 | 16:39:44.428 | 16:39:44.437 | 9 ms |
Agent Overhead Between Calls
| Transition | Gap (seconds) |
|---|---|
| Run 1 → Run 2 | 29.674 s |
| Run 2 → Run 3 | 27.401 s |
| Run 3 → Run 4 | 26.294 s |
| Run 4 → Run 5 | 26.515 s |
Summary Statistics
| Metric | Value |
|---|---|
| Average Command Execution | ~10.4 ms |
| Average Agent Overhead | ~27.5 seconds |
| Min Agent Overhead | 26.294 s |
| Max Agent Overhead | 29.674 s |
| Total Test Duration | ~1 min 50 sec |
| Actual Work Time | ~52 ms |
Impact
- 5 trivial commands that took 52 milliseconds of actual execution required ~2 minutes of total time
- Efficiency loss: 99.95% of time spent waiting for agent transitions
- Makes iterative terminal-based workflows extremely slow
- Significantly impacts developer productivity for tasks requiring multiple sequential commands
Reproduction Script
# Create test file
@"
Line 1: Test content
Line 2: Test content
Line 3: Test content
Line 4: Test content
Line 5: Test content
"@ | Set-Content "test_timing.txt"
# Command to run (with timestamps)
Write-Host "START: $(Get-Date -Format 'HH:mm:ss.fff')"; Get-Content "test_timing.txt" | Select-Object -First 5; Write-Host "END: $(Get-Date -Format 'HH:mm:ss.fff')"
Ask the agent to run the above command 5 times sequentially and record timestamps.
Potential Causes (Speculation)
- Round-trip to AI API - Each command result may require full API round-trip
- Token processing overhead - Terminal output being tokenized and processed
- No command batching - Sequential commands not being optimized
- Safety/confirmation delays - Built-in delays for user review (even when not needed)
Suggested Improvements
- Command Batching - Allow agents to queue multiple independent commands
- Streaming Execution - Start next command while previous result is being processed
- Fast-Path for Simple Commands - Reduce overhead for trivially simple operations
- Parallel Tool Calls for Terminal - If commands are independent, execute in parallel
Workaround
Currently, the only workaround is to chain multiple commands into a single terminal call:
# Instead of 5 separate calls, use one call with loop
1..5 | ForEach-Object {
Write-Host "Run $_: $(Get-Date -Format 'HH:mm:ss.fff')"
Get-Content "file.txt" | Select-Object -First 20
}
However, this defeats the purpose of agentic workflows where the AI needs to observe each result before deciding the next action.
Additional Context
- This delay is consistent across different command types
- Delay appears similar for both simple and complex commands
- The shell itself responds instantly (as shown by ~10ms execution times)
- The overhead is entirely in the Cursor/Agent orchestration layer
Severity: Medium-High (significant productivity impact for terminal-heavy workflows)
Category: Performance / Agent Mode
Reproducibility: 100% reproducible
Does this stop you from using Cursor
Yes - Cursor is unusable





