[BUG] Claude code crashes

Status Closed — not planned
Maintainer reply None cached
Activity 13 comments · opened Oct 18, 2025 · closed Jan 12, 2026

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?

every time I use refer to a directory Claude code crashes.

❯ claude --version
2.0.22 (Claude Code)
❯ claude

 ▐▛███▜▌   Claude Code v2.0.22
▝▜█████▛▘  us.anthropic.claude-sonnet-4-5-20250929-v1:0 · API Usage Billing
  ▘▘ ▝▝    /work/<redacted path>/demonstrate-full-workflow

> there is a uv environment @<redacted path> i want to create section for test-and-eval for the packages that are only installed in a test environment. 
  ⎿  Listed directory <redacted path>

✻ Inferring… (esc to interrupt)

─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
>  
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
  ? for shortcuts                                                                                                                              Thinking off (tab to toggle)
3320 | ${Object.entries(G).map(([Y,W])=>`# ${Y}
3321 | ${W}`).join(`
3322 | `)}
3323 | 
3324 |       IMPORTANT: this context may or may not be relevant to your tasks. You should not respond to this context unless it is highly relevant to your task.
3325 | `,isMeta:!0}),...Z]}async function iUY(Z,G){if(tS())return;let[{tools:Y},W,X,J]=await Promise.all([Ok0(Z),sw(G),f7(),x7()]),B=J.gitStatus?.length??0,Q=X.claudeMd?.length??0,V=B+Q,K=I9(),H=K9();setTimeout(()=>H.abort(),1000);let z=await Hq0(o1(),H.signal,K.ignorePatterns??[]),I=0,$=0,F=0,w=0,U=0,N=W.filter((E)=>!E.isMcp);I=Y.length,w=N.length;let O=new Set;for(let E of Y){let T=E.name.split("__");if(T.length>=3&&T[1])O.add(T[1])}$=O.size;try{if(Y.length>0){let{mcpToolTokens:E}=await TQ0(Y,async()=>G,null);F=E}if(N.length>0)U=await pUY(W,async()=>G,null)}catch{}G0("tengu_context_size",{git_status_size:B,claude_md_size:Q,total_context_size:V,project_file_count_rounded:z,mcp_tools_count:I,mcp_servers_count:$,mcp_tools_tokens:F,non_mcp_tools_count:w,non_mcp_tools_tokens:U})}function nUY(Z,G){switch(Z.name){case pY.name:{let Y=pY.inputSchema.parse(G),{command:W,timeout:X,description:J,run_in_background:B}=Y,Q=W.replace(`cd ${o1()} && `,"");if(Q=Q.replace(/\\\\;/g,"\\;"),/^echo\s+["']?[^|&;><]*["']?$/i.test(Q.trim() | ... truncated 

error: No assistant message found
      at gb (/$bunfs/root/claude:3325:12889)
      at async <anonymous> (/$bunfs/root/claude:3325:21638)
      at async Om1 (/$bunfs/root/claude:3325:2017)
      at async SV (/$bunfs/root/claude:3325:21495)
      at async _tG (/$bunfs/root/claude:3332:208)
      at processTicksAndRejections (7:39)

Bun v1.2.23 (Linux x64 baseline)

What Should Happen?

it should not crash.

Error Messages/Logs

Steps to Reproduce

every time I use refer to a directory Claude code crashes.

❯ claude --version
2.0.22 (Claude Code)
❯ claude

 ▐▛███▜▌   Claude Code v2.0.22
▝▜█████▛▘  us.anthropic.claude-sonnet-4-5-20250929-v1:0 · API Usage Billing
  ▘▘ ▝▝    /work/<redacted path>/demonstrate-full-workflow

> there is a uv environment @<redacted path> i want to create section for test-and-eval for the packages that are only installed in a test environment. 
  ⎿  Listed directory <redacted path>

✻ Inferring… (esc to interrupt)

─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
>  
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
  ? for shortcuts                                                                                                                              Thinking off (tab to toggle)
3320 | ${Object.entries(G).map(([Y,W])=>`# ${Y}
3321 | ${W}`).join(`
3322 | `)}
3323 | 
3324 |       IMPORTANT: this context may or may not be relevant to your tasks. You should not respond to this context unless it is highly relevant to your task.
3325 | `,isMeta:!0}),...Z]}async function iUY(Z,G){if(tS())return;let[{tools:Y},W,X,J]=await Promise.all([Ok0(Z),sw(G),f7(),x7()]),B=J.gitStatus?.length??0,Q=X.claudeMd?.length??0,V=B+Q,K=I9(),H=K9();setTimeout(()=>H.abort(),1000);let z=await Hq0(o1(),H.signal,K.ignorePatterns??[]),I=0,$=0,F=0,w=0,U=0,N=W.filter((E)=>!E.isMcp);I=Y.length,w=N.length;let O=new Set;for(let E of Y){let T=E.name.split("__");if(T.length>=3&&T[1])O.add(T[1])}$=O.size;try{if(Y.length>0){let{mcpToolTokens:E}=await TQ0(Y,async()=>G,null);F=E}if(N.length>0)U=await pUY(W,async()=>G,null)}catch{}G0("tengu_context_size",{git_status_size:B,claude_md_size:Q,total_context_size:V,project_file_count_rounded:z,mcp_tools_count:I,mcp_servers_count:$,mcp_tools_tokens:F,non_mcp_tools_count:w,non_mcp_tools_tokens:U})}function nUY(Z,G){switch(Z.name){case pY.name:{let Y=pY.inputSchema.parse(G),{command:W,timeout:X,description:J,run_in_background:B}=Y,Q=W.replace(`cd ${o1()} && `,"");if(Q=Q.replace(/\\\\;/g,"\\;"),/^echo\s+["']?[^|&;><]*["']?$/i.test(Q.trim() | ... truncated 

error: No assistant message found
      at gb (/$bunfs/root/claude:3325:12889)
      at async <anonymous> (/$bunfs/root/claude:3325:21638)
      at async Om1 (/$bunfs/root/claude:3325:2017)
      at async SV (/$bunfs/root/claude:3325:21495)
      at async _tG (/$bunfs/root/claude:3332:208)
      at processTicksAndRejections (7:39)

Bun v1.2.23 (Linux x64 baseline)

Claude Model

Sonnet (default)

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.0.22

Platform

AWS Bedrock

Operating System

Other Linux

Terminal/Shell

Xterm

Additional Information

_No response_

View original on GitHub ↗

13 Comments

longas · 10 months ago

I'm writing to bring more visibility to this issue. I'm also getting error: No assistant message found when using Bedrock and v2.0.22, and in my case, the crash only occurs when using "ANTHROPIC_DEFAULT_HAIKU_MODEL": "eu.anthropic.claude-haiku-4-5-20251001-v1:0" and asking CC to examine the contents of a directory. I experience the same crash when explicitly using the new Explore agent, which uses Haiku. With Haiku 3.5, it doesn't crash, but when the Explore agent is used, I see (0 tool uses · 0 tokens).

Hopefully this gets resolved soon, as it makes using CC very difficult for anyone accessing the models through Bedrock, as we do in our organization.

alexnederlof · 10 months ago

I had this too earlier today. Removing and re-installing worked. It had something to do with a temp directory not being there

alexnederlof · 10 months ago

Ok, I'm having the same issue again. Even after the re-install. I can't find out what's causing it.

Error: No assistant message found
    at Nm (file:///Users/anederlof/.bun/install/global/node_modules/@anthropic-ai/claude-code/cli.js:3310:12886)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async file:///Users/anederlof/.bun/install/global/node_modules/@anthropic-ai/claude-code/cli.js:3310:21634
    at async va0 (file:///Users/anederlof/.bun/install/global/node_modules/@anthropic-ai/claude-code/cli.js:3310:2011)
    at async LJ (file:///Users/anederlof/.bun/install/global/node_modules/@anthropic-ai/claude-code/cli.js:3310:21490)
    at async HBB (file:///Users/anederlof/.bun/install/global/node_modules/@anthropic-ai/claude-code/cli.js:3317:200)
Anas-Ehab · 10 months ago

I am having the same issue over here! The issue happened on the latest version, I tried downgrading to the previous version but got the same issue after some time. It also happened with both the Pro Subscription and with API keys.

schuettc · 10 months ago

This does seem to be directory related. Getting this frequently now. Removing the @ before the directory seems to "fix" it.

engineersamwell · 10 months ago

+1 happening for me too

khoatrandata · 10 months ago

Happening to me too

3321 | ${Object.entries(G).map(([Y,W])=>`# ${Y}
3322 | ${W}`).join(`
3323 | `)}
3324 | 
3325 |       IMPORTANT: this context may or may not be relevant to your tasks. You should not respond to this context unless it is highly relevant to your task.
3326 | `,isMeta:!0}),...Z]}async function tUY(Z,G){if(tS())return;let[{tools:Y},W,X,J]=await Promise.all([Ek0(Z),sw(G),f7(),x7()]),B=J.gitStatus?.length??0,Q=X.claudeMd?.length??0,V=B+Q,K=I9(),H=K9();setTimeout(()=>H.abort(),1000);let z=await Iq0(o1(),H.signal,K.ignorePatterns??[]),I=0,$=0,F=0,w=0,U=0,N=W.filter((E)=>!E.isMcp);I=Y.length,w=N.length;let O=new Set;for(let E of Y){let T=E.name.split("__");if(T.length>=3&&T[1])O.add(T[1])}$=O.size;try{if(Y.length>0){let{mcpToolTokens:E}=await TQ0(Y,async()=>G,null);F=E}if(N.length>0)U=await sUY(W,async()=>G,null)}catch{}G0("tengu_context_size",{git_status_size:B,claude_md_size:Q,total_context_size:V,project_file_count_rounded:z,mcp_tools_count:I,mcp_servers_count:$,mcp_tools_tokens:F,non_mcp_tools_count:w,non_mcp_tools_tokens:U})}function eUY(Z,G){switch(Z.name){case pY.name:{let Y=pY.inputSchema.parse(G),{command:W,timeout:X,description:J,run_in_background:B}=Y,Q=W.replace(`cd ${o1()} && `,"");if(Q=Q.replace(/\\\\;/g,"\\;"),/^echo\s+["']?[^|&;><]*["']?$/i.test(Q.trim() | ... truncated 

error: No assistant message found
      at mb (/$bunfs/root/claude:3326:12889)
      at async <anonymous> (/$bunfs/root/claude:3326:21638)
      at async Tm1 (/$bunfs/root/claude:3326:2017)
      at async SV (/$bunfs/root/claude:3326:21495)
      at async btG (/$bunfs/root/claude:3333:208)
      at processTicksAndRejections (7:39)

Bun v1.2.23 (macOS arm64)
hutchiko · 10 months ago

I am also seeing this issue with v2.0.22. In my case it seems to be triggered when the Fetch tool is used.

● I'll help you refactor the frontend Lambda configuration to use the terraform-aws-modules/lambda module. Let me first examine the module documentation to understand its capabilities and then analyze
  your current configuration.

● Fetch(https://registry.terraform.io/modules/terraform-aws-modules/lambda/aws/latest)
  ⎿  Error: No assistant message found
paulartigo-domain · 10 months ago

+1 this still happening to me as well. my workaround is by not using directory feature in CC for now. Hopefully this will gets fixed sooner.

lukyncze · 10 months ago

+1 this still happening to me as well

github-actions[bot] · 8 months ago

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

github-actions[bot] · 7 months ago

This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.

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.