claude-code - 💡(How to fix) Fix [BUG] SessionStart hook fails with EEXIST when plugin data dir is a Windows symlink/junction

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…

Error Message

SessionStart:startup hook error

Error Messages/Logs

SessionStart:startup hook error 3. Start Claude Code → the EEXIST error appears at startup.

Code Example

SessionStart:startup hook error
Failed to run: EEXIST: file already exists,
    mkdir 'C:\Users<user>.claude\plugins\data\superpowers-claude-plugins-official'
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

On Windows, if ~/.claude/plugins/data/<plugin-id> is a symbolic link (ReparsePoint) — e.g. redirected to OneDrive for sync — Claude Code's SessionStart routine fails with:

SessionStart:startup hook error └ Failed to run: EEXIST: file already exists, mkdir 'C:\Users<user>.claude\plugins\data\superpowers-claude-plugins-official'

The plugin itself loads and works correctly; this is purely a startup warning.

What Should Happen?

fs.mkdir(path, { recursive: true }) should be idempotent. On Windows, Node treats reparse points as already-existing non-directory entries, so the recursive flag does not silently succeed. The startup code should either: - check lstat and follow the link before mkdir, or - swallow EEXIST when the path resolves to an existing directory.

Error Messages/Logs

SessionStart:startup hook error
  └ Failed to run: EEXIST: file already exists,
    mkdir 'C:\Users<user>.claude\plugins\data\superpowers-claude-plugins-official'

Steps to Reproduce

  1. Install any plugin (e.g. superpowers@claude-plugins-official).
  2. Replace ~/.claude/plugins/data/<plugin-id> with a directory symlink (PowerShell: New-Item -ItemType SymbolicLink ... or mklink /D) pointing to a valid existing directory.
  3. Start Claude Code → the EEXIST error appears at startup.

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.1.133

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

VS Code integrated terminal

Additional Information

Environment

  • Claude Code: v2.1.133
  • OS: Windows 11 Pro 10.0.26200
  • Shell: PowerShell

Notes

  • Symlink target is accessible and the plugin functions normally.
  • Same issue likely affects junctions (mklink /J) created by users who redirect plugin data to OneDrive / Dropbox / external drives.

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