Terminal tool fails to process command output with ‘head/cat: No such file or directory’ errors
Issue
I routinely - but not systematically - run into this error. The model seems to silently add a | cat
/ | head
(silently because it doesn’t show it in the display when it prints the command it is running) to commands it suspects will trigger a terminal paging (which could stuck it), but it fails at doing so, causing these errors on most commands that return data:
head: |: No such file or directory
head: cat: No such file or directory
I asked Claude-4 what it thinks is happening :
The tool implementation is incorrectly trying to process command output with
head
/cat
internally, which breaks normal command execution.
Claude is pretty vague and keep talking about “the tool”, but I understand it as “Cursor”.
From what I have seen, it looks like all models are affected. I reproduced with all Claude models and GPT 4.1 (and then I stopped testing).
Reproduction
Not sure, but, any command that outputs data through the AI terminal tool:
gh pr list
→ fails with head/cat errorsgh run list
→ fails with head/cat errorsgh --version
→ works fine (no data output)echo "test" | cat
→ works fine (basic pipe)
This instruction should do:
I have the gh cli installed. Get me result of the last CI run on this branch
Environment
- macOS 15.4.1
- zsh 5.9
- Cursor 1.0.0