ANI

How to set up Claude code channels locally

# Introduction

Claude Code Channels it quickly becomes a viable alternative OpenClaw for people who want to connect Claude to chat forums without setting up a heavy agent framework. It's easy to get started, works with Claude subscriptions out of the box, and gives you a direct way to connect to local Claude code sessions through Discord.

In this article, you will learn how to set up Claude code channels locally and connect it to your Discord server. The main thing to understand from the start is that this setup depends on the local code session of Claude. The bot only works while that session is running on your machine.

# What You Need Before You Begin

Before setting everything up, make sure you have:

You should also know that Channels require a Claude.ai login and does not work with API-key-only authentication.

Note: This guide uses Windows 11 as the operating system for the setup steps and instructions, but the same overall process can be followed on Linux and macOS.

# Includes Claude's Code and Login

First, enter the Claude Code in PowerShell:

irm  | iex

Then create a working folder, go into it, and start Claude Code:

mkdir my-channels
cd my-channels
claude

When Claude's Code opens, log in with your Claude.ai account:

This step is required before Channels will work.

How to set up Claude code channels locally

# Installing Bun and adding the Discord Plugin

Claude Code's official channel plugins are used The Bunso install it as follows:

irm bun.sh/install.ps1 | iex

You can confirm the installation by:

After that, within Code Claude, run the following commands one by one in the same order. Each command prepares the next step, so it's important not to skip a command.

First, add the official plugin marketplace:

/plugin marketplace add anthropics/claude-plugins-official

Next, update the market so Claude Code can download the latest available plugins:

/plugin marketplace update claude-plugins-official

Then install the official Discord plugin:

/plugin install discord@claude-plugins-official

Finally, reload the plugins so that the newly installed Discord integration is available in your current Claude Code session:

How to set up Claude code channels locally

At this point, Claude's Code is ready to use the Discord channel integration.

# Creating and Configuring Your Discord Bot

Now go to Discord Developer Portal and create a new application. Within that application, open the file Bot part, reset the token, and copy it somewhere safe.

You also need to empower Purpose of Message Contentbecause without it the bot will not be able to read the text that people send.

Next, create a bot invite link using the OAuth2 URL Generator. Grant the necessary permissions, such as:

  • Watch channels
  • Send Messages
  • Send Messages in Threads
  • Read Message History
  • Attach Files
  • Add Reactions
  • Send Voice Messages

Then use the generated link to add the bot to your Discord server.

How to set up Claude code channels locally

# Linking Claude Code to Discord

Go back to Claude Code and configure the Discord plugin using your bot token:

/discord:configure YOUR_DISCORD_BOT_TOKEN

Claude code usually stores this token by default in its Channel configuration directory.

After setting the token, restart Claude Code with channels enabled:

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

This starts Code Claude with the Discord Channels plugin enabled.

If you don't want Code Claude to ask for permission every time it needs to use a tool or take a new action, you can start it with the auto-authorize flag instead:

claude --dangerously-skip-permissions --channels plugin:discord@claude-plugins-official

How to set up Claude code channels locally

This makes the session more automated, which can be helpful for a smoother Discord experience. However, you should only use this if you trust the environment and understand that Claude Code will be allowed to do something without asking for confirmation each time.

# Linking Your Discord Account and Getting Started

If Claude's Code works and channels are open, send your bot a direct message on Discord. It should respond with a pairing code.

Take that code and paste it inside Claude's Code:

/discord:access pair YOUR_PAIRING_CODE

Then restrict access to only authorized users:

/discord:access policy allowlist

After that, you can message the bot in Discord and Claude Code will reply in your local session.

How to set up Claude code channels locally

# Final Notes and Troubleshooting

If something doesn't work as expected, the points below cover the most common Claude Code Channels issues and quick ways to fix them.

  • Bot is online but not saying anything: Empower Purpose of Message Content in your Discord bot settings. Without it, the bot receives empty message content.
  • Claude never connects to Discord: Restart the Claude Code with --channels plugin:discord@claude-plugins-official the flag. The Discord plugin will not work unless Channels are enabled first.
  • Bot not responding after setting: Complete the pairing step by sending the bot a DM, copying the pairing code, and running the pairing command within Claude's Code.
  • DMs don't work at all: Make sure your Discord account and the bot are on the same server, as Discord needs that for direct messages to work.
  • The plugin instructions do not appear: Run /reload-plugins after installing or updating a plugin so that the current session takes it.
  • Responses stop after session restart: Avoid leaning --resume for now, because a recent Claude code issue reports that channel plugins may not restart correctly after a reboot.
  • Claude says listen, but nothing comes: Check it out /mcp to verify that the Discord plugin is indeed connected. Recent reports show cases where the plugin fails at startup even though Claude's code appears to be ready.
  • Messages arrive but Claude remains inactive: This may be a fault of the current channel notification. Resuming a session is a simple task at this point.
  • Responses stop after the Allow or Deny prompt: This is a recently reported Discord permission issue. Restart the session if possible.

If the bot stops working when you close the terminal, that's normal. Claude Code Channels only work while your local Claude Code session is active.

Abid Ali Awan (@1abidiawan) is a data science expert with a passion for building machine learning models. Currently, he specializes in content creation and technical blogging on machine learning and data science technologies. Abid holds a Master's degree in technology management and a bachelor's degree in telecommunication engineering. His idea is to create an AI product using a graph neural network for students with mental illness.

Source link

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button