--channels plugin fails on Windows: EEXIST: file already exists, mkdir '~/.claude'

Resolved 💬 3 comments Opened Mar 21, 2026 by rjk461 Closed Mar 24, 2026

Description

Running Claude Code with --channels plugin:telegram@claude-plugins-official on Windows 11 causes every inbound message to fail with:

API Error: EEXIST: file already exists, mkdir 'C:\Users\<user>\.claude'

Environment

  • OS: Windows 11 Pro 10.0.26200
  • Claude Code: v2.1.81
  • Shell: PowerShell
  • Bun: installed (required by plugin)

Steps to reproduce

  1. Install telegram plugin: /plugin install telegram@claude-plugins-official
  2. Configure token: /telegram:configure <token>
  3. Restart with channels: claude --channels plugin:telegram@claude-plugins-official
  4. Pair account via /telegram:access pair <code>
  5. Send any message from Telegram

Expected

Claude receives and replies to the message.

Actual

Every message fails with:

API Error: EEXIST: file already exists, mkdir 'C:\Users\<user>\.claude'

Root cause hypothesis

Bun's mkdirSync on Windows throws EEXIST when any path component already exists, even with { recursive: true }. The plugin's server.ts calls mkdirSync(STATE_DIR, { recursive: true }) where STATE_DIR is ~/.claude/channels/telegram. Since ~/.claude already exists, Bun throws EEXIST referencing that component.

Patching server.ts locally to catch EEXIST did not resolve the error, suggesting the mkdir call may be occurring inside Claude Code's own channel infrastructure rather than (or in addition to) the plugin server.

View original on GitHub ↗

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