Plugin startup: EEXIST error when plugin data directories already exist (non-recursive mkdir)

Resolved 💬 3 comments Opened May 9, 2026 by wli-cloud Closed May 13, 2026

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

  1. Install any plugin (e.g. superpowers from claude-plugins-official or superpowers-marketplace, pw from claude-code-skills)
  2. Start a Claude Code session — directories are created successfully the first time
  3. 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.

View original on GitHub ↗

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