[BUG] DISCORD_STATE_DIR not passed to Discord plugin subprocess (regression from 2.1.88)

Resolved 💬 2 comments Opened Apr 1, 2026 by kiskysd Closed Jun 2, 2026

Bug Description

The Discord plugin's server.ts relies on DISCORD_STATE_DIR to locate
per-instance token and access config. Since upgrading from 2.1.88 to 2.1.89,
the environment variable is no longer passed to the plugin subprocess.
When running multiple Claude Code sessions with different Discord bots,
only the first session connects successfully — all others fall back to
the default ~/.claude/channels/discord path.

Steps to Reproduce

  1. Set DISCORD_STATE_DIR to a custom directory before launching

claude --channels plugin:discord@claude-plugins-official

  1. Verify the env var is set in the parent shell (echo $env:DISCORD_STATE_DIR)
  2. Observe that the plugin subprocess does not receive the variable

and falls back to the default path

Expected Behavior

DISCORD_STATE_DIR should be inherited by the plugin subprocess,
as documented in the plugin README:

"To run multiple bots on one machine, point DISCORD_STATE_DIR at a different directory per instance."

This worked correctly in version 2.1.88.

Actual Behavior

All plugin instances use the fallback ~/.claude/channels/discord,
causing all sessions to read the same .env and access.json.
Only the first Gateway connection succeeds.

Environment

  • Claude Code: 2.1.89 (worked in 2.1.88)
  • Discord plugin: 0.0.4
  • OS: Windows 11
  • Plugin source: server.ts line 37 confirms fallback logic

Related Issues

  • #11927 (env vars from settings.json not passed to plugins)
  • #9447 (env var not propagated in plugin hooks)

View original on GitHub ↗

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