[Bug] --debug-file fails with EISDIR error when given a directory path

Resolved 💬 2 comments Opened Jan 27, 2026 by oikon48 Closed Feb 28, 2026

Bug Description
claude --debug-file doesn't work properly. When running claude --debug-file ./debug in terminal (ghostty), it shows following error message:


$ claude --debug-file .
 7 | // You are responsible for reviewing any code suggestions before use.
 8 |
 9 | // (c) Anthropic PBC. All rights reserved. Use is subject to the Legal Agreements outlined here: https://code.claude.com/docs/en/legal-and-compliance.
10 |
11 | // Version: 2.1.20
12 | `);D=C[0]||"";for(let G=C.length-1;G>=1;G--){let W=C[G];if(W)yield W}}if(D)yield D}finally{await A.close()}}var cD,ayR,Np,EV,Xh0=!1,Ih0,hh0;var sA=I(()=>{BR();ER();dR();cD=k(require("fs")),ayR=require("os"),Np=k(require("path")),EV=require("fs/promises");Ih0={cwd(){return process.cwd()},existsSync(T){return oW(`existsSync(${T})`,()=>cD.existsSync(T))},async stat(T){return EV.stat(T)},async readdir(T){return EV.readdir(T,{withFileTypes:!0})},async unlink(T){return EV.unlink(T)},async rmdir(T){return EV.rmdir(T)},async rm(T,R){return EV.rm(T,R)},statSync(T){return oW(`statSync(${T})`,()=>cD.statSync(T))},lstatSync(T){return oW(`lstatSync(${T})`,()=>cD.lstatSync(T))},readFileSync(T,R){return oW(`readFileSync(${T})`,()=>cD.readFileSync(T,{encoding:R.encoding}))},readFileBytesSync(T){return oW(`readFileBytesSync(${T})`,()=>cD.readFileSync(T))},readSync(T,R){return oW(`readSync(${T}, ${R.length} bytes)`,()=>{let A=void 0;try{A=cD.openSync(T,"r");let _=Buffer.alloc(R.length),B=cD.readSync(A,_,0,R.length,0);return{bu | ... truncated

EISDIR: illegal operation on a directory, open '.'
    path: ".",
 syscall: "open",
   errno: -21,
    code: "EISDIR"

      at <anonymous> (/$bunfs/root/claude:12:1303)
      at oW (/$bunfs/root/claude:11:35584)
      at appendFileSync (/$bunfs/root/claude:12:1109)
      at writeFn (/$bunfs/root/claude:12:5058)
      at write (/$bunfs/root/claude:12:4528)
      at b (/$bunfs/root/claude:14:36)
      at mZ9 (/$bunfs/root/claude:237:2522)
      at <anonymous> (/$bunfs/root/claude:4689:18029)
      at <anonymous> (/$bunfs/root/claude:11:1011)

Environment Info

  • Platform: darwin
  • Terminal: ghostty
  • Version: 2.1.20
  • Feedback ID: 9aa978c9-0dd9-4296-8cec-93017ded04c1

Errors

[{"error":"Error: ENOENT: no such file or directory, scandir '/Library/Application Support/ClaudeCode/.claude/skills'\n    at readdirSync (unknown)\n    at <anonymous> (/$bunfs/root/claude:12:2063)\n    at oW (/$bunfs/root/claude:11:35584)\n    at readdirSync (/$bunfs/root/claude:12:2024)\n    at MIR (/$bunfs/root/claude:1758:380)\n    at MIR (/$bunfs/root/claude:1758:1350)\n    at <anonymous> (/$bunfs/root/claude:1758:4670)\n    at <anonymous> (/$bunfs/root/claude:1758:5401)\n    at A (/$bunfs/root/claude:11:7259)\n    at fw8 (/$bunfs/root/claude:4826:4342)","timestamp":"2026-01-27T03:25:35.550Z"}]

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗