[BUG] No way to trigger /compact or /clear from Claude Code channels (by Discord)
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?
When using Claude Code via channels (Discord), there is no way to trigger built-in CLI commands like /compact or /clear from the remote side.
Since /compact and /clear are CLI-only built-in commands, messages sent from a channel (e.g. "/compact") are treated as plain text chat messages — they do not invoke the actual CLI command.
This means that during long channel-based sessions, the context window will inevitably fill up, and Claude stops responding entirely with no feedback to the remote user. From the channel user's perspective, Claude simply goes silent — there is no error message, no warning, and no way to recover the session without terminal access.
What Should Happen?
Remote chat users (via channels) should have a mechanism to trigger context management commands (/compact, /clear) without requiring direct terminal access. At minimum, when context is full, the remote user should receive a notification explaining why Claude has stopped responding.
Error Messages/Logs
Steps to Reproduce
- Start Claude Code with any channel plugin (Discord, Slack, etc.)
- Have a long conversation via the channel until context is nearly full
- Send "/compact" or "/clear" from the channel
- Observe: message is treated as chat text, context is not compacted
- Eventually context fills up and Claude stops responding — no error or notification is sent to the channel
- The remote user has no way to know why Claude went silent or how to recover
Claude Model
Opus
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
2.1.85
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
iTerm2
Additional Information
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗