claude-code - 💡(How to fix) Fix [Bug] Claude Code update fails when $HOME environment variable is modified [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#46271Fetched 2026-04-11 06:24:43
View on GitHub
Comments
2
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×3commented ×2

Error Message

Error: EEXIST: file already exists, mkdir 'C:\Users[username]\OneDrive - [company].local\share\claude\versions'

RAW_BUFFERClick to expand / collapse

Bug Description My powershell profile included an alteration to my $HOME variable that changed its path. I discovered this was causing Claude Code to fail to update as well as complain about PATH issues. The original install had worked despite this, and the binary was in the right place, and if Claude Update referenced $USERPROFILE instead it would have been looking in the right place. Interestingly, Claude Doctor reported no issues, aside from informationally displaying that my current version was far behind both the stable and latest versions.

Environment Info

  • Platform: win32
  • Terminal: windows-terminal
  • Version: 2.1.100
  • Feedback ID: c35312ad-c3e0-47f0-8d8b-e5f473835459

Errors Error: EEXIST: file already exists, mkdir 'C:\Users[username]\OneDrive - [company].local\share\claude\versions'

extent analysis

TL;DR

Update the PowerShell profile to use the $USERPROFILE variable instead of altering the $HOME variable to resolve the PATH issues with Claude Code.

Guidance

  • Identify the line in the PowerShell profile that alters the $HOME variable and update it to use $USERPROFILE for consistency with the expected path.
  • Verify that the update process works correctly after making this change by attempting to update Claude Code.
  • Check the directory C:\Users\[username]\OneDrive - [company]\.local\share\claude\versions for any existing files or folders that may be causing the EEXIST error.
  • Consider resetting the PowerShell profile to its default state if the issue persists after updating the $HOME variable.

Example

No code snippet is provided as the issue does not include the specific PowerShell profile code that needs to be updated.

Notes

The solution assumes that the issue is caused by the altered $HOME variable in the PowerShell profile. If the issue persists after making this change, further investigation may be needed to identify the root cause.

Recommendation

Apply workaround: Update the PowerShell profile to use $USERPROFILE instead of altering $HOME, as this should resolve the PATH issues with Claude Code without requiring any version upgrades.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING