How to Connect Claude Code to Discord: Step-by-Step Guide
By Braincuber Team
Published on April 22, 2026
Claude Code Channels lets you connect a live Claude Code session to messaging platforms such as Discord or Telegram, so you can send prompts through a bot and receive responses directly in chat. Instead of staying in the terminal the entire time, you can interact with your running Claude Code workflow from a familiar messaging interface.
What You'll Learn:
- Installing Claude Code and logging in with your Claude.ai account
- Installing Bun and adding the official Discord plugin marketplace
- Creating and configuring a Discord bot in the Developer Portal
- Inviting the bot to your Discord server with proper permissions
- Configuring the bot token and starting Claude Code with Channels enabled
- Pairing your Discord account and testing the full setup
What Are Claude Code Channels?
Claude Code Channels let outside apps send messages into a live Claude Code session. In simple terms, they act as a bridge between Claude Code and tools like Discord, Telegram, alerts, or webhooks. Claude receives the message inside the running session, works on it, and can send a reply back through the same channel.
Channels are still in research preview. They require Claude Code v2.1.80 or later, a Claude.ai login, and they do not work with console or API key authentication. For Team and Enterprise accounts, the feature must also be enabled by the organization.
Important Note
Channels only work while your Claude Code session is open and running. If you close Claude Code, incoming Discord or Telegram messages will not be handled. If you want the setup to stay available all the time, you need to keep Claude Code running in a persistent terminal or background environment.
Claude Code Channels Prerequisites
Before you start, make sure you have these requirements ready:
| Prerequisite | Description |
|---|---|
| Claude Code v2.1.80+ | Latest version of Claude Code CLI |
| Claude.ai Account | Signed in through Claude Code |
| Pro or Max Plan | Required for Channels feature |
| Bun | Runtime for channel plugins |
| Discord Account | With access to a server |
Step 1: Install Claude Code
Go to the official Claude Code website and open the installation guide. Anthropic provides install commands for different platforms, including Windows, macOS, Linux, and WSL.
irm https://claude.ai/install.ps1 | iex
After the installation finishes, create a new folder for your project, move into it, and start Claude Code:
mkdir cc-channels
cd cc-channels
claude
Claude Code will open in your terminal and start a local session. This is the base for the rest of the setup, because Channels only work inside an active Claude Code session.
Step 2: Log In With Your Claude.ai Account
Next, sign in to Claude Code with your Claude.ai account. In most cases, Claude Code will ask you to log in when you first open it. If it does not, run this command inside Claude Code:
Log in to Claude Code
Run /login inside Claude Code to authenticate with your Claude.ai account.
Important
Channels only work with a Claude.ai login. They do not support console login or API key authentication, so even if Claude Code works in another billing mode, Channels may still be unavailable until you sign in with your Claude.ai account.
Step 3: Install Bun for the Discord Plugin
Claude Code's official channel plugins use Bun, so you need to install it before setting up Discord. If you have not installed Bun yet, you can do it on Windows with this PowerShell command:
irm bun.sh/install.ps1 | iex
After the installation finishes, check that Bun is working by running:
bun --version
Step 4: Add the Official Discord Plugin
Before you install the Discord plugin, make sure the official Claude Code plugin marketplace is added and up to date. Run these commands inside Claude Code:
Add Plugin Marketplace
Run /plugin marketplace add anthropics/claude-plugins-official to add the marketplace.
Update Marketplace
Run /plugin marketplace update claude-plugins-official to ensure it's up to date.
This step is important because Claude Code may not find the Discord plugin if the marketplace is missing or outdated.
Install Discord Plugin
Run /plugin install discord@claude-plugins-official to install the Discord plugin.
Reload Plugins
Run /reload-plugins to activate the new plugin commands in your current session.
Step 5: Create a Discord Bot
Open the Discord Developer Portal and click New Application. Give your app a name such as CC-Bot, then create it. You can also add a description and profile image from the General Information page if you want.
Open Bot Section
Navigate to the Bot section in the Discord Developer Portal.
Reset Token
Click Reset Token and copy the new bot token. Save it somewhere safe for the next step.
Enable Message Content Intent
In the Bot settings, enable Message Content Intent. Claude Code's Discord setup needs the bot to read incoming message text.
Step 6: Invite the Bot to Your Discord Server
Next, add the bot to your Discord server. In the Discord Developer Portal, open the OAuth2 tab and scroll to OAuth2 URL Generator. Check bot under scopes.
| Permission | Purpose |
|---|---|
| View Channels | Read server messages |
| Send Messages | Reply to users |
| Send Messages in Threads | Respond in threads |
| Read Message History | View past messages |
| Attach Files | Share files |
| Add Reactions | React to messages |
| Send Voice Messages | Send audio messages |
After selecting the permissions, Discord will generate an invite URL for the bot. Copy this URL and paste it into your browser. It will open either the Discord desktop app or the Discord website, depending on your setup. From there, choose the server where you want to add the bot and click Authorize.
Step 7: Configure the Bot Token in Claude Code
Now go back to Claude Code and connect it to your Discord bot by running this command:
/discord:configure YOUR_DISCORD_BOT_TOKEN
Replace YOUR_DISCORD_BOT_TOKEN with the bot token you copied from the Discord Developer Portal. Claude Code will save it for you automatically.
Troubleshooting Tip
If this command does not work the first time, close your terminal and open it again. Then go back to your Claude Code project folder and launch Claude Code again.
Step 8: Start Claude Code With Channels Enabled
At this point, your Discord bot is set up, but it will not work until Claude Code is started with the Discord channel enabled. Exit your current Claude Code session, then start it again with:
claude --channels plugin:discord@claude-plugins-official
This command launches Claude Code and loads the Discord channel plugin at the same time. Once it starts, your bot can come online and begin receiving messages from Discord in that live Claude Code session.
Remember
Channels only work while the session is open, so if you close Claude Code, the bot will stop responding until you launch it again.
Step 9: Pair Your Discord Account
Once Claude Code is running with the Discord channel enabled, open Discord and send a direct message to your bot. The bot should reply with a pairing code.
Send DM to Bot
Open Discord and send a direct message to your bot to receive a pairing code.
Pair Your Account
Run /discord:access pair YOUR_PAIRING_CODE to approve your Discord account.
Lock Down Access
Run /discord:access policy allowlist to ensure only approved users can interact.
Allowlist Security
Claude Code Channels use an allowlist model. Only approved Discord users can send messages into your running session.
Permission Prompts
Claude Code asks for permission before running commands. Use /permissions to manage these rules.
Step 10: Test Claude Code Channels in Discord
Now you can start using the bot in Discord much like you would use Claude Code in the terminal. Send it a message, ask it to do something, and it will reply back in chat while using your live Claude Code session in the background.
| Example Task | Description |
|---|---|
| Check Weather | Ask about current weather conditions |
| Create Reminder | Set up a reminder for a future task |
| Build Website | Generate a simple portfolio website |
| Voice Notes | Send voice messages and get voice responses |
For testing, some people start Claude Code with this command to skip permission prompts:
claude --dangerously-skip-permissions --channels plugin:discord@claude-plugins-official
Security Warning
Only use --dangerously-skip-permissions in environments you fully trust, because it removes an important safety check.
Troubleshooting Common Issues
Plugin Not Found
Add or update the claude-plugins-official marketplace again, then reinstall the Discord plugin.
Configure Command Fails
Run /reload-plugins, or close and reopen Claude Code.
Bot Offline
Check the bot token is correct, Claude Code was started with the --channels flag, and the session is open.
Message Content Empty
Confirm Message Content Intent is enabled in the Discord Developer Portal.
Frequently Asked Questions
Do Claude Code Channels stay active after I close my terminal?
No. Channels act as a bridge to a live local session. If you close Claude Code, your Discord bot will stop responding to incoming messages.
Can I set up Channels using just an API key?
No. Claude Code Channels do not support API-key or console-only authentication. You must be signed into a Claude.ai account on a Pro or Max plan.
How do I stop random people from running commands on my machine?
Claude Code Channels use an allowlist model. Send the bot a DM to receive a pairing code, then run /discord:access pair YOUR_CODE followed by /discord:access policy allowlist.
Why is my Discord bot online but ignoring my messages?
The most common cause is missing intents. You must enable Message Content Intent in the Discord Developer Portal. Also verify Claude Code was started with the --channels flag.
What if pairing fails?
Send the bot a DM again and confirm that Claude Code is still running with Channels enabled. The pairing flow depends on the live local plugin replying with a pairing code.
Need Help with Claude Code?
Our experts can help you configure Claude Code, set up Channels, and integrate AI assistants into your workflow.
