Bun segfault (SIGSEGV at 0x0) on exit - macOS Apple Silicon
Description
Claude Code crashes with a Bun segmentation fault consistently on exit (on clean exit command). The session saves and the resume ID is printed correctly before the crash, so no data is lost — but the panic is disruptive.
Steps to Reproduce
- Run
claude --dangerously-skip-permissions(or normal mode) - Use the session normally
- Type
exitto quit - Observe Bun crash output
Crash Output
\\\`
Resume this session with:
claude --resume ffea0273-83b7-4173-b9e6-c99be49fb307
============================================================
Bun v1.3.11 (759ce802) macOS Silicon
macOS v26.3.1
CPU: fp aes crc32 atomics
Args: "claude" "--dangerously-skip-permissions"
Features: Bun.stderr(2) Bun.stdin(2) Bun.stdout(2) WebSocket(4) abort_signal(154) fetch(88) jsc spawn(276) standalone_executable process_dlopen yaml_parse(98)
Elapsed: 4259658ms | User: 128720ms | Sys: 14892ms
RSS: 0.48GB | Peak: 0.62GB | Commit: 0.02ZB | Faults: 72 | Machine: 51.54GB
panic: Segmentation fault at address 0x0
oh no: Bun has crashed. This indicates a bug in Bun, not your code.
To send a redacted crash report to Bun's team,
please file a GitHub issue using the link below:
https://bun.report/1.3.11/M_1759ce80mgkgE+hogC_uxkvQuxkvQmmp2lB215qgB__A2AA
zsh: trace trap claude --dangerously-skip-permissions
\\\`
Bun Crash Report
https://bun.report/1.3.11/M_1759ce80mgkgE+hogC_uxkvQuxkvQmmp2lB215qgB__A2AA
Environment
- Claude Code version: 2.1.84
- Bun version: 1.3.11 (bundled)
- OS: macOS 26.3.1 (Darwin 25.3.0)
- Architecture: Apple Silicon (ARM64)
- Frequency: Happens most of the time on exit
Notes
- The session resume ID is printed correctly before the crash — no data loss
- Crash is in Bun's process teardown after Claude Code has finished its work
- Related Bun issues: oven-sh/bun#28415, oven-sh/bun#28203 (similar exit-time segfaults)
- Likely fixed by bundling a newer Bun version
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗