Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
Two related behaviors prevent the agent from verifying the results of terminal commands:
-
Command output not returned: When the agent runs a terminal command (e.g. git status, git log -1, cat file), the command executes and returns an exit code (e.g. 0), but the stdout/stderr output is not included in the tool result shown to the agent. The agent receives something like “Command output: (empty)” or no output at all. So the agent cannot use command output to verify success or make decisions.
-
Files created by terminal not visible to read_file: When the agent runs a command that writes to a file in the workspace (e.g. git log -1 --oneline > scripts/result.txt or echo test > scripts/diagnostic.txt), the command completes successfully (exit 0). When the agent then uses the read_file tool on that same path (e.g. scripts/result.txt), the tool returns “File not found.” So the agent cannot work around missing stdout by redirecting to a file and reading it. The Cursor docs (Terminal / Sandbox) state that the sandbox has “Read and write access to workspace directories”; the agent can read existing workspace files with read_file, but cannot read files that were just created by a terminal command in the same workspace.
Together, this means the agent has no reliable way to observe the outcome of terminal commands in the same session - neither via stdout nor via reading a file it wrote.
Steps to Reproduce
teps to reproduce
- In Composer/Agent, ask the agent to run a simple command that produces output, e.g. cd <workspace_root> && git log -1 --oneline.
- Observe: the command runs (exit code 0), but the agent’s tool result does not contain the git output.
- Then ask the agent to run a command that writes to a file in the workspace, e.g. cd <workspace_root> && echo “hello” > scripts/test-output.txt.
- Ask the agent to read that file (e.g. read_file on scripts/test-output.txt or the full path).
- Observe: read_file returns “File not found” even though the write command succeeded and the path is inside the workspace.
Expected Behavior
- Command output: The run_terminal_cmd (or equivalent) tool result should include the full stdout and stderr of the command so the agent can verify results and respond appropriately.
- Files created by terminal: Files created by the agent’s terminal commands in the workspace should be visible to the agent’s read_file tool (same workspace, same path). Per the docs, the sandbox has read/write access to workspace directories, so writes from the terminal and reads from read_file should see the same workspace filesystem.
Operating System
MacOS
Version Information
Version: 2.5.26
VSCode Version: 1.105.1
Commit: 7d96c2a03bb088ad367615e9da1a3fe20fbbc6a0
Date: 2026-02-26T04:57:56.825Z
Build Type: Stable
Release Track: Default
Electron: 39.4.0
Chromium: 142.0.7444.265
Node.js: 22.22.0
V8: 14.2.231.22-electron.0
OS: Darwin arm64 25.3.0
For AI issues: which model did you use?
As selected in Composer for the current conversation. Settings has multiple models enabled: Composer 1.5, GPT-5.3 Codex, Sonnet 4.6, and Opus 4.6. Unable to see which one is active in this chat.
Does this stop you from using Cursor
No - Cursor works, but with this issue