Skip to content

Native binary leaks ~7MB .node files to temp directory on each session (Windows) #23095

@SlothKing16

Description

@SlothKing16

Description

The native Windows binary (claude.exe) extracts native Node.js addon files to the system temp directory on each session/invocation but never cleans them up. Over time this accumulates significant disk usage.

Environment

  • OS: Windows 11
  • Claude Code version: Native binary (.local/bin/claude.exe, ~232 MB)
  • Installation method: Native binary (not npm)
  • Auto-update: Disabled

Evidence

After ~4 days of regular usage:

  • 2,813 files matching pattern .789*.node
  • 18 GB total disk usage
  • Each file is exactly 6,965,760 bytes (~6.7 MB)
  • Files are created in C:\Users\<user>\AppData\Local\Temp\
  • Naming pattern: .789127d3????????-00000000.node (hash varies per session)
$ find /c/Users/slono/AppData/Local/Temp -name ".789*.node" -type f | wc -l
2813

$ du -ch /c/Users/slono/AppData/Local/Temp/.789*.node | tail -1
18G     total

$ ls -la /c/Users/slono/AppData/Local/Temp/.789*.node | head -5
-rwxr-xr-x 1 slono 197609 6965760 Jan 31 22:34 .789127d317febb4e-00000000.node
-rwxr-xr-x 1 slono 197609 6965760 Jan 31 22:52 .789127d31aef7f3e-00000000.node
-rwxr-xr-x 1 slono 197609 6965760 Jan 31 22:39 .789127d31eeffeae-00000000.node
...

The files are Windows PE64 DLLs (native Node.js addons) - identical content, just different filenames per session.

Expected Behavior

The application should either:

  1. Reuse existing extracted native modules instead of creating new copies each session
  2. Clean up extracted temp files on exit
  3. Use a deterministic filename so subsequent runs reuse the same file

Workaround

Manual cleanup:

Remove-Item "C:\Users\<user>\AppData\Local\Temp\.789*.node" -Force

Files can be safely deleted when Claude Code is not running.

Impact

At ~7 MB per session, heavy users can accumulate tens of GB within days. This is especially problematic on systems with smaller SSDs or limited C: drive space.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions