[BUG] --channels: plugin process exits before Bun.serve starts when launched by Claude Code (fakechat / stdio transport)
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
--channels with fakechat plugin: port 8787 never opens — plugin process appears to exit before Bun.--channels with fakechat plugin: port 8787 never opens — plugin process appears to exit before Bun.serve starts
When launching Claude Code with --channels plugin:fakechat@claude-plugins-official, the session starts and shows Listening for channel messages from: plugin:fakechat@claude-plugins-official, but the fakechat UI at http://localhost:8787 is unreachable. netstat confirms the port is never opened. When running server.ts manually with stdin open, the port opens immediately and the UI works correctly. This suggests Claude Code is not keeping the plugin process alive long enough for Bun.serve to execute after await mcp.connect(new StdioServerTransport()).****
What Should Happen?
After launching claude --channels plugin:fakechat@claude-plugins-official, the fakechat plugin should start its HTTP server on http://localhost:8787 and the UI should be accessible in the browser, allowing messages to be exchanged between the browser and the Claude Code session.
Error Messages/Logs
No error messages or logs are shown.No error messages or logs are shown. Claude Code starts normally and displays:
Listening for channel messages from: plugin:fakechat@claude-plugins-official
but no error or warning is produced. ~/.claude/logs/ does not exist. Running netstat -na | grep 8787 returns no output, confirming the port is never opened
Steps to Reproduce
- Install Claude Code v2.1.143 and Bun v1.2.14 on Ubuntu 26.04
- Install the fakechat plugin inside a Claude Code session:
/plugin install fakechat@claude-plugins-official - Run
/reload-pluginsto activate the plugin - Exit Claude Code and launch it with the channel flag:
claude --channels plugin:fakechat@claude-plugins-official - Observe that the session starts and shows
Listening for channel messages from: plugin:fakechat@claude-plugins-official - Open a browser and navigate to
http://localhost:8787— connection is refused - Run
netstat -na | grep 8787— no output, port is not open
To confirm the plugin itself works correctly:
- Run the plugin manually:
bun run ~/.claude/plugins/cache/claude-plugins-official/fakechat/0.0.1/server.ts & - Run
netstat -na | grep 8787— port opens immediately and the UI is accessible athttp://localhost:8787
Claude Model
None
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.143
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
Xterm
Additional Information
- The plugin's
server.tsusesawait mcp.connect(new StdioServerTransport())beforeBun.serve(...). When Claude Code launches the process, it appears to close stdin or not keep it open, causing the process to exit before reachingBun.serve. When run manually with stdin open, the process stays alive and the HTTP server starts correctly. ~/.claude/plugins/data/fakechat-claude-plugins-official/exists but is empty, which may indicate the plugin installation is incomplete.- Running
bun install --no-summaryinside~/.claude/plugins/cache/claude-plugins-official/fakechat/0.0.1/did not resolve the issue. - Authentication: claude.ai account (Pro), not API key.
- No proxy, no custom firewall rules blocking localhost.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗