[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
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

  1. Navigate to the affected project folder
  2. Run claude (no flags needed)
  3. 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.json file exists but has empty entries: []
  • There are 5 .jsonl session files in the project folder
  • The crash happens before any UI appears
  • Claude works correctly in all other project folders

Crash Report Link

https://bun.report/1.3.5/e_11e86cebmgEugogCgxrtLs/zoJg+yoJgqpmMCYKERNEL32.DLLgrmFCSntdll.dll282fA0eNpLTiwuUUhOLC1OLVYoyM/MK0ktUijJV0hKVcgrzckBAK96CzY

Expected Behavior

Claude Code should start normally in the project folder.

Workaround

Currently none - the folder is unusable with Claude Code.

View original on GitHub ↗

8 Comments

github-actions[bot] · 8 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/21875
  2. https://github.com/anthropics/claude-code/issues/22250
  3. https://github.com/anthropics/claude-code/issues/21469

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

IOT-IOT · 8 months ago

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.

IOT-IOT · 8 months ago

Update: Root Cause Found

After extensive debugging, we identified the exact cause of the crash.

Root Cause

The presence of a settings.local.json file in the project's .claude folder causes Bun to crash with "cast causes pointer to be null".

Key Findings

  1. The crash occurs regardless of the file content - even an empty {} triggers it
  2. Renaming/removing settings.local.json immediately fixes the issue
  3. Other files in the same .claude folder (like a backup copy with different name) don't cause crashes
  4. The file was created by Claude Code itself via the /config command (setting outputStyle: "Explanatory")

Steps to Reproduce

  1. In any project folder, create .claude/settings.local.json with any valid JSON content (e.g., {} or {"outputStyle": "Explanatory"})
  2. Run claude in that folder
  3. Bun crashes with "cast causes pointer to be null"

Workaround

Delete or rename the .claude/settings.local.json file in the affected project folder.

Environment

  • Claude Code: 2.1.29
  • Bun: 1.3.5
  • OS: Windows Server 2022
IOT-IOT · 8 months ago

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 Bun

The bug is specific to project-local settings files, not global settings.

IOT-IOT · 8 months ago

Clarification: Complete Steps to Reproduce

What happened:

  1. User ran /config command in Claude Code
  2. Claude Code created .claude/settings.local.json with {"outputStyle": "Explanatory"}
  3. From that point, Claude Code crashed on every launch in that project folder

Debugging steps performed:

  1. Removed the outputStyle setting, leaving only {} → Still crashes
  2. Emptied the file completely → Still crashes
  3. Renamed/deleted settings.local.json → Works
  4. Added the same setting to global ~/.claude/settings.json → Works

Conclusion:

The bug is triggered by the mere existence of a settings.local.json file in the project's .claude folder, regardless of its content. The same settings work fine in the global settings.json.

This appears to be a Bun parsing issue specific to project-local settings files on Windows.

github-actions[bot] · 7 months ago

Closing for now — inactive for too long. Please open a new issue if this is still relevant.

dreamy32 · 7 months ago

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

github-actions[bot] · 7 months ago

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.