[Bug] Discord channel plugin process not terminated on session end — orphan processes accumulate

Resolved 💬 3 comments Opened Mar 21, 2026 by gongpyung Closed Mar 25, 2026

Bug Description

When a Claude Code session ends (/exit or Ctrl+C), the Discord channel plugin server process (bun run --cwd .../discord/0.0.1 --shell=bun --silent start) is not terminated and remains as an orphan process.

Starting a new session with --channels plugin:discord@claude-plugins-official spawns a new process without killing the previous one, causing duplicate processes to compete for the same Discord bot token.

Steps to Reproduce

  1. Start Claude Code with Discord channel: claude --channels plugin:discord@claude-plugins-official
  2. Verify Discord plugin process is running: ps aux | grep "discord.*start"
  3. Exit Claude Code session (/exit or Ctrl+C)
  4. Start a new session with the same command
  5. Check processes again: ps aux | grep "discord.*start"

Result: Two Discord plugin processes are running simultaneously.

Expected Behavior

The previous session's Discord channel server process should be terminated when the session ends, before spawning a new one.

Impact

  • Duplicate processes cause state contention on the Discord bot token
  • reply calls intermittently fail with "channel is not allowlisted" even though access.json correctly has the channel allowlisted
  • Users need to manually pkill -f "discord.*start" to resolve

Environment

  • Claude Code version: 2.1.81
  • OS: macOS (Darwin 25.3.0)
  • Discord plugin: claude-plugins-official/discord/0.0.1
  • Runtime: Bun

Workaround

Manually kill orphan processes before starting a new session:

pkill -f "discord.*start"

View original on GitHub ↗

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