Discord channel plugin: bot stays offline in certain project directories

Resolved 💬 2 comments Opened Apr 7, 2026 by Korea-Maker Closed May 19, 2026

Summary

Discord channel plugin (plugin:discord@claude-plugins-official) bot connects to Gateway but stays offline when Claude Code is launched from certain project directories, while working perfectly from others.

Reproduction

  1. Run claude --channels plugin:discord@claude-plugins-official from directory A → bot goes online, DM works
  2. Run the same command from directory B (different project under the same parent) → bot stays offline, DMs don't work
  3. Order doesn't matter — even starting from directory B first, bot stays offline

Environment

  • macOS Darwin 24.6.0
  • Claude Code (latest CLI)
  • Discord plugin v0.0.4 (claude-plugins-official)
  • Bun runtime

Investigation findings

  • Same bot token — shared via ~/.claude/channels/discord/.env
  • Same plugin code — identical server.ts (33340 bytes)
  • Token is validGET /users/@me and /guilds both return correct data via REST API
  • All Privileged Gateway Intents enabled (Presence, Server Members, Message Content)
  • TCP connections appear establishedlsof shows ESTABLISHED connections to Discord Gateway IPs (162.159.x.x)
  • But MCP fetch_messages returns "Missing Access" — suggesting Gateway READY event never fires, so client.channels.fetch() fails
  • Standalone test works — running client.login() + listening for ready event directly with bun -e succeeds from the same directory
  • Directory B had no .claude/settings.local.json initially (directory A did), but creating one didn't fix the issue

Hypothesis

Something in how Claude Code spawns/manages the MCP channel subprocess differs based on project context (working directory, project settings presence, or session state), causing the Discord.js Gateway handshake to not complete properly — even though the underlying TCP connection is established.

Additional note

During debugging, multiple zombie bun server.ts processes (CPU 85-95% each) were discovered running in the background, possibly from previous sessions that didn't clean up properly. These may have contributed to Gateway connection contention, but the issue persists even after killing all zombies and restarting cleanly.

View original on GitHub ↗

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