[BUG] Claude Code long running 30+ agents for 18h crashes bash
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Summary: After running Claude Code for 18+ hours with 30+ parallel agents, the Bash tool becomes permanently broken. All
commands return exit code 1 with zero stdout/stderr output. Even echo test fails. Only exit 0 "succeeds" (by
immediately terminating). Starting a new Claude Code session does not fix it — a full machine reboot was required last
time.
Reproduction:
- Run Claude Code with many parallel agents (30+) for an extended period (18+ hours)
- At some point, Bash tool stops returning output
- New Claude Code sessions inherit the broken state
- File-based tools (Read, Glob, Grep, Write) continue working normally
Observed behavior:
- echo hello → Exit code 1, no output
- true → Exit code 1, no output
- /bin/true → Exit code 1, no output
- env -i /bin/bash --noprofile --norc -c 'echo test' → Exit code 1, no output
- exit 0 → Success, no output (only command that "works")
- Write tool → ENOSPC: no space left on device (initially, disk was 100% full at 3.3T/3.6T)
- After freeing disk space (106 GB free, 97%), Bash still broken
Environment:
- Linux 6.14.0-37-generic
- Claude Code CLI Version: 2.1.84
- 30+ concurrent agents spawned over 18 hours
- Disk filled to 100% during session (3.6T drive)
Likely root cause: The Bash tool's underlying shell process or PTY gets corrupted — possibly due to resource exhaustion
(file descriptors, PIDs, PTY allocation) from running many parallel agents. Freeing disk space alone does not recover
it. Previous occurrence required a full system reboot.
Workaround: Reboot the machine, then start a new Claude Code session.
What Should Happen?
It should continue to work even over 18+ hours running claude agent teams.
Error Messages/Logs
See bug
Steps to Reproduce
Reproduction:
- Run Claude Code with many parallel agents (30+) for an extended period (18+ hours)
- At some point, Bash tool stops returning output
- New Claude Code sessions inherit the broken state
- File-based tools (Read, Glob, Grep, Write) continue working normally
Observed behavior:
- echo hello → Exit code 1, no output
- true → Exit code 1, no output
- /bin/true → Exit code 1, no output
- env -i /bin/bash --noprofile --norc -c 'echo test' → Exit code 1, no output
- exit 0 → Success, no output (only command that "works")
- Write tool → ENOSPC: no space left on device (initially, disk was 100% full at 3.3T/3.6T)
- After freeing disk space (106 GB free, 97%), Bash still broken
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.84
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
Xterm
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗