[BUG] macOS: bundled Bun fd-limit hint (sudo launchctl limit maxfiles 2147483646) makes every new Terminal/Ghostty window hang ~3 min until reboot

Status Open
Reported on v2.1.281
Maintainer reply None cached
Activity 0 comments · opened Sep 24, 2026

When Claude Code hits a file-descriptor error on macOS it prints Bun's built-in hint to run ulimit -n 2147483646 and sudo launchctl limit maxfiles 2147483646. Following it sets the system limit to ~2.1 billion. macOS's /usr/bin/login closes every possible descriptor before starting the shell, so every new Terminal.app/Ghostty window sits blank for ~3 minutes at 100% CPU. SIP blocks lowering the limit again, so only a reboot undoes it, and nothing links the symptom back to the command.

  • Claude Code 2.1.281 (native): the hint text is still in the binary
  • macOS 26.5.1, Mac mini M4, Ghostty 1.3.1, Terminal.app
  • Before reboot: launchctl limit maxfiles / kern.maxfiles / kern.maxfilesperproc = 2147483646. After reboot: 256/unlimited, 122880, 61440, and terminals are instant again.

Root cause and a fix (bounded values) are upstream: oven-sh/bun#37337, PR oven-sh/bun#37339 (still open). Please pick up that fix, or override the hint in Claude Code's bundled Bun, since Claude Code is how many users see this message.

View original on GitHub ↗