[BUG] Bun v1.3.5 crashes with 'cast causes pointer to be null' on Windows in specific project folder
Status Closed — not planned
Reported on v2.1.29
Maintainer reply None cached
Workaround ✓ Mentioned in thread ↓
Activity 8 comments · opened Feb 2, 2026 · closed Mar 3, 2026
Description
Claude Code crashes immediately on startup in a specific project folder on Windows. The crash is a Bun runtime panic with "cast causes pointer to be null" error. Claude works fine in all other folders on the same system.
Environment
- Claude Code version: 2.1.29
- Bun version: 1.3.5 (1e86cebd) Windows x64 (baseline)
- OS: Windows Server 2022 (win10_cu)
- CPU: sse42 avx avx2 avx512
Steps to Reproduce
- Navigate to the affected project folder
- Run
claude(no flags needed) - Bun crashes immediately
Error Output
Bun v1.3.5 (1e86cebd) Windows x64 (baseline)
Windows v.win10_cu
CPU: sse42 avx avx2 avx512
Args: "C:\Users\Administrator\.local\bin\claude.exe" "--dangerously-skip-permissions"
Features: Bun.stderr(2) Bun.stdin(2) Bun.stdout(2) fetch(7) jsc spawn(11) standalone_executable process_dlopen
Builtins: "bun:main" "node:assert" "node:async_hooks" ...
Elapsed: 3024ms | User: 1218ms | Sys: 1843ms
RSS: 0.64GB | Peak: 0.64GB | Commit: 0.68GB | Faults: 160715 | Machine: 34.36GB
panic(thread 18380): cast causes pointer to be null
oh no: Bun has crashed. This indicates a bug in Bun, not your code.
Additional Context
- The
sessions-index.jsonfile exists but has emptyentries: [] - There are 5
.jsonlsession files in the project folder - The crash happens before any UI appears
- Claude works correctly in all other project folders
Crash Report Link
Expected Behavior
Claude Code should start normally in the project folder.
Workaround
Currently none - the folder is unusable with Claude Code.
8 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
This is NOT a duplicate
This issue is different from the suggested duplicates:
| This Issue | Suggested Duplicates |
|------------|---------------------|
| Error: "cast causes pointer to be null" | Error: "Segmentation fault" |
| Crashes immediately on startup | Crashes during/after usage (5 min - 11 hours) |
| 100% reproducible in specific folder | Random crashes |
| Folder-specific - Claude works in all other folders | General Windows issue |
| No workaround - folder is completely unusable | Workaround: restart periodically |
The root cause appears to be different - possibly related to session data or project configuration causing a null pointer dereference during initialization, rather than memory corruption during runtime.
Update: Root Cause Found
After extensive debugging, we identified the exact cause of the crash.
Root Cause
The presence of a
settings.local.jsonfile in the project's.claudefolder causes Bun to crash with "cast causes pointer to be null".Key Findings
{}triggers itsettings.local.jsonimmediately fixes the issue.claudefolder (like a backup copy with different name) don't cause crashes/configcommand (settingoutputStyle: "Explanatory")Steps to Reproduce
.claude/settings.local.jsonwith any valid JSON content (e.g.,{}or{"outputStyle": "Explanatory"})claudein that folderWorkaround
Delete or rename the
.claude/settings.local.jsonfile in the affected project folder.Environment
Further Update: Bug is specific to settings.local.json
Tested with the same setting (
outputStyle: "Explanatory") in the global settings file:~/.claude/settings.json→ Works fine.claude/settings.local.json→ Crashes BunThe bug is specific to project-local settings files, not global settings.
Clarification: Complete Steps to Reproduce
What happened:
/configcommand in Claude Code.claude/settings.local.jsonwith{"outputStyle": "Explanatory"}Debugging steps performed:
outputStylesetting, leaving only{}→ Still crashessettings.local.json→ Works~/.claude/settings.json→ WorksConclusion:
The bug is triggered by the mere existence of a
settings.local.jsonfile in the project's.claudefolder, regardless of its content. The same settings work fine in the globalsettings.json.This appears to be a Bun parsing issue specific to project-local settings files on Windows.
Closing for now — inactive for too long. Please open a new issue if this is still relevant.
I have the same issue upgrading to the new claude code native install. Even before I installed it I had it happen, and it recrashed during a coding session. I mean it just freezes
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.