C:/Program Files/Git/heapdump fails with EEXIST when Desktop directory already exists

Resolved 💬 3 comments Opened Mar 15, 2026 by Lylie87 Closed Mar 18, 2026

Description

Running /heapdump fails with the following error:

Failed to create heap dump: EEXIST: file already exists, mkdir 'C:\Users\alexl\Desktop'

Steps to Reproduce

  1. Have a standard Windows 11 setup where C:\Users\<username>\Desktop already exists (as it always does)
  2. Run /heapdump in Claude Code

Expected Behaviour

The heapdump should be created successfully, writing the file to the Desktop (or another output directory).

Actual Behaviour

The command fails because it attempts to create the Desktop directory using mkdir without the recursive flag (or equivalent { recursive: true } option in Node's fs.mkdir). Since the directory already exists, it throws EEXIST.

Environment

  • OS: Windows 11 Pro 10.0.26200
  • Shell: bash
  • Platform: win32

View original on GitHub ↗

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