Bash tool returns exit code 1 with no stdout/stderr on CachyOS (Arch Linux)
Resolved 💬 8 comments Opened Mar 30, 2026 by Bumblebiber Closed May 15, 2026
Description
The Bash tool in Claude Code always returns exit code 1 with no stdout or stderr output for every command, including simple builtins like echo "test", true, whoami, etc.
Commands do execute successfully — this was proven by redirecting output to a file (command > file.txt 2>&1; exit 0) and reading it with the Read tool. The issue is purely with output capture / return.
Environment
- Claude Code version: 2.1.87
- OS: CachyOS (Arch Linux based, kernel 6.19.9-2-cachyos)
- Shell: bash (used by Bash tool), fish (user default), zsh (also installed)
- Architecture: x86_64 (znver4)
Steps to reproduce
- Install Claude Code on CachyOS
- Run any Bash tool command, e.g.
echo "hello" - Result: exit code 1, no output
What was tried (none of these fixed it)
- Setting
sandbox.enabled: falsein settings.json - Adding
Bash(*)to permissions allow list - Setting
"SHELL": "/bin/bash"in env config - Adding non-interactive guard to .zshrc (
[[ $- != *i* ]] && return) - Using
dangerouslyDisableSandbox: trueparameter - Restarting Claude Code multiple times
Workaround
Redirecting output to a file works reliably:
{ command; } > /home/user/output.txt 2>&1; exit 0
Then using the Read tool to read the file.
Additional context
- The user's zsh config includes Powerlevel10k, oh-my-zsh, and CachyOS-specific zsh plugins — these may interfere with non-interactive output capture
- The Bash tool confirmed it runs under
bash(viaps -p $$ -o comm=redirected to file) exit 0is the only "command" that returns exit code 0 normally- The user reports this worked fine on Bazzite (Fedora-based) previously
This issue has 8 comments on GitHub. Read the full discussion on GitHub ↗