Plugin startup: EEXIST error when plugin data directories already exist (non-recursive mkdir)
Bug Description
On every session start, Claude Code logs startup hook errors for plugins whose data directories already exist:
SessionStart:startup hook error
Failed to run: EEXIST: file already exists, mkdir 'C:\Users\user\.claude\plugins\data\superpowers-claude-plugins-official'
SessionStart:startup hook error
Failed to run: EEXIST: file already exists, mkdir 'C:\Users\user\.claude\plugins\data\superpowers-superpowers-marketplace'
SessionStart:startup hook error
Failed to run: EEXIST: file already exists, mkdir 'C:\Users\user\.claude\plugins\data\pw-claude-code-skills'
Steps to Reproduce
- Install any plugin (e.g.
superpowersfromclaude-plugins-officialorsuperpowers-marketplace,pwfromclaude-code-skills) - Start a Claude Code session — directories are created successfully the first time
- Start any subsequent session — EEXIST errors appear for all three directories
Root Cause
The plugin initialization code calls fs.mkdir(path) (non-recursive) to ensure each plugin's data directory exists. On the first session this succeeds; on every subsequent session the directory already exists and Node.js throws EEXIST.
The fix is a one-liner: use fs.mkdir(path, { recursive: true }) (or fs.mkdirSync(path, { recursive: true })), which is idempotent and does not error when the directory already exists.
Environment
- OS: Windows 11 Home 10.0.26200
- Shell: PowerShell
- Claude Code: latest
- Affected plugins:
superpowers@claude-plugins-official,superpowers@superpowers-marketplace,pw@claude-code-skills
Impact
Cosmetic only — the plugins load and work correctly because the directories already exist. But the startup errors appear on every session, which is confusing and noisy.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗