From discord-threads
Set up the Discord channel — save the bot token, configure session threads, and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks about session threads, asks "how do I set this up" or "who can reach me," or wants to check channel status.
npx claudepluginhub axiumfoundry/claude-discord-threads-plugin --plugin discord-threadsThis skill is limited to using the following tools:
Writes the bot token and session thread settings to
Configures Discord bot channel: saves token to .env, checks status/access policy (DM pairing, allowlists), and guides secure lockdown.
Interact with Discord servers using bot tokens: send/read messages, list/manage channels, handle reactions, switch servers. Useful for AI agents, CI/CD pipelines, and bot automation.
Adds Discord bot channel to ClaudeClaw: merges code from qwibitai/claudeclaw-discord repo, validates with npm build and vitest, guides interactive bot token setup and .env config.
Share bugs, ideas, or general feedback.
Writes the bot token and session thread settings to
~/.claude/channels/discord/.env and orients the user on access policy.
The server reads the .env file at boot.
Arguments passed: $ARGUMENTS
Read both state files and give the user a complete picture:
Token — check ~/.claude/channels/discord/.env for
DISCORD_BOT_TOKEN. Show set/not-set; if set, show first 6 chars masked.
Session threads — check .env for DISCORD_THREAD_CHANNEL_ID.
Show:
DISCORD_SESSION_NAME: custom name override, if set.DISCORD_SESSION_ARCHIVE: whether threads archive on session end.Access — read ~/.claude/channels/discord/access.json (missing file
= defaults: dmPolicy: "pairing", empty allowlist). Show:
What next — end with a concrete next step based on state:
/discord-threads:configure <token> with your bot token from
the Developer Portal → Bot → Reset Token."/discord-threads:access pair <code>."/discord-threads:configure threads <channel_id>."Push toward lockdown — always. The goal for every setup is allowlist
with a defined list. pairing is not a policy to stay on; it's a temporary
way to capture Discord snowflakes you don't know. Once the IDs are in,
pairing has done its job and should be turned off.
Drive the conversation this way:
pairing → "Good. Let's lock it down so
nobody else can trigger pairing codes:" and offer to run
/discord-threads:access policy allowlist. Do this proactively — don't wait to
be asked./discord-threads:access pair <code>. Run this skill again once
everyone's in and we'll lock it." Or, if they can get snowflakes
directly: "Enable Developer Mode in Discord (User Settings → Advanced),
right-click them → Copy User ID, then /discord-threads:access allow <id>."allowlist → confirm this is the locked state.
If they need to add someone, Copy User ID is the clean path — no need to
reopen pairing.Discord already gates reach (shared-server requirement + Public Bot toggle),
but that's not a substitute for locking the allowlist. Never frame pairing
as the correct long-term choice. Don't skip the lockdown offer.
<token> — save bot token$ARGUMENTS as the token (trim whitespace). Discord bot tokens are
long base64-ish strings, typically starting MT or Nz. Generated from
Developer Portal → Bot → Reset Token; only shown once.mkdir -p ~/.claude/channels/discord.env if present; update/add the DISCORD_BOT_TOKEN= line,
preserve other keys. Write back, no quotes around the value.chmod 600 ~/.claude/channels/discord/.env — the token is a credential.threads <channel_id> — configure session threads$ARGUMENTS — expect threads followed by a Discord channel
snowflake (numeric ID, typically 17-20 digits). If the ID looks wrong,
tell the user: "Enable Developer Mode in Discord (User Settings →
Advanced), right-click the text channel → Copy Channel ID."mkdir -p ~/.claude/channels/discord.env if present; update/add DISCORD_THREAD_CHANNEL_ID=
line, preserve other keys. Write back, no quotes.chmod 600 ~/.claude/channels/discord/.env<id>. Each Claude
Code session gets its own private thread on startup."DISCORD_SESSION_NAME=custom-name — override the auto-generated
thread name (max 100 chars).DISCORD_SESSION_ARCHIVE=true — archive the thread when the session
ends.threads off — disable session threads.env, remove the DISCORD_THREAD_CHANNEL_ID= line (and
DISCORD_SESSION_NAME= and DISCORD_SESSION_ARCHIVE= if present).clear — remove the tokenDelete the DISCORD_BOT_TOKEN= line (or the file if that's the only line).
Without auto-allow rules, every Discord reply/react/edit triggers a
permission prompt. This check ensures the Discord MCP tools are in the
user's ~/.claude/settings.json allow list.
Required tool names:
mcp__plugin_discord-threads_discord__reply
mcp__plugin_discord-threads_discord__react
mcp__plugin_discord-threads_discord__edit_message
mcp__plugin_discord-threads_discord__fetch_messages
mcp__plugin_discord-threads_discord__download_attachment
Check:
~/.claude/settings.json (missing file = not configured).permissions.allow array.Fix (if any are missing):
permissions.allow exists as an array (create if missing). Add any
missing tool names (dedupe). Write back with 2-space indent.{
"permissions": {
"allow": [
"mcp__plugin_discord-threads_discord__reply",
"mcp__plugin_discord-threads_discord__react",
"mcp__plugin_discord-threads_discord__edit_message",
"mcp__plugin_discord-threads_discord__fetch_messages",
"mcp__plugin_discord-threads_discord__download_attachment"
]
}
}
This check is run automatically when saving a token.
.env once at boot. Token and thread channel changes need
a session restart. Say so after saving.access.json is re-read on every inbound message — policy changes via
/discord-threads:access take effect immediately, no restart.