Control Claude Code on your PC from your phone via Discord.
Phone (Discord app) → Discord → This Bot (PC) → Claude Code CLI
| Requirement | Version | Check Command |
|---|---|---|
| Node.js | 18+ | node --version |
| npm | 9+ | npm --version |
| Claude Code CLI | latest | claude --version |
| Discord Account | - | - |
git clone https://github.com/Googlingprogrammer/remote-claude.git
cd remote-claude
npm install- Go to https://discord.com/developers/applications
- Click New Application → Name it (e.g., "Claude Hub")
- Go to Bot tab (left sidebar)
- Click Reset Token → Copy the token
- Enable MESSAGE CONTENT INTENT under "Privileged Gateway Intents"
# Create .env file
cp .env.example .envEdit .env and add your token:
DISCORD_TOKEN=your_bot_token_here
npm startThe bot will print an invite URL. Use it to add the bot to any Discord server you're in, then DM the bot directly.
{
"projects": {
"myapp": {
"path": "C:\\Work\\myapp",
"description": "My application"
}
},
"channelMap": {},
"allowedUsers": []
}| Field | Type | Description |
|---|---|---|
projects |
object | Map of project names to paths |
projects[name].path |
string | Absolute path to project directory |
projects[name].description |
string | Optional description |
channelMap |
object | Internal: maps DM channels to active projects |
allowedUsers |
array | Discord user IDs allowed to use bot (empty = allow all) |
| Variable | Required | Description |
|---|---|---|
DISCORD_TOKEN |
Yes | Discord bot token |
All commands use the ! prefix. Send commands via DM to the bot.
| Command | Arguments | Description |
|---|---|---|
!add |
<name> <path> [description] |
Register a project |
!remove |
<name> |
Unregister a project |
!projects |
- | List all projects |
!use |
<name> |
Set active project for conversation |
!clear |
- | Start fresh conversation (next message only) |
!stop |
- | Kill running Claude process |
!status |
- | Show current state |
!help |
- | Show command list |
Any message not starting with ! is sent as a prompt to Claude Code.
You: !add myapp C:\Work\myapp My cool application
Bot: Added myapp → C:\Work\myapp
You: !use myapp
Bot: Switched to myapp → C:\Work\myapp
You: What files are in this project?
Bot: ⏳ (processing...)
Bot: ✅ Here are the files in your project...
You: !clear
Bot: Next message starts a fresh conversation.
You: Explain the main entry point
Bot: ⏳ (processing...)
Bot: ✅ The main entry point is...
- Bot receives DM from allowed user
- If command (
!), execute command logic - If prompt, spawn Claude Code CLI:
claude -p "<prompt>" --output-format text -c - Capture stdout, strip ANSI codes, send to Discord
- Split messages >2000 chars at natural boundaries
| Flag | Purpose |
|---|---|
-p <prompt> |
Pass the prompt |
--output-format text |
Plain text output |
-c |
Continue previous conversation |
The -c flag is omitted after !clear to start fresh.
remote-claude/
├── bot.js # Main bot code
├── config.json # Projects and settings
├── package.json # Dependencies
├── .env # Discord token (create from .env.example)
├── .env.example # Template for .env
├── install.bat # Windows setup script
├── start.bat # Windows launcher
├── README.md # This file
├── PRD.md # Product requirements
└── PROGRESS.md # Development progress
install.bat
:: Follow prompts, then:
start.bat| Issue | Solution |
|---|---|
Missing DISCORD_TOKEN |
Create .env file with your bot token |
claude: command not found |
Install Claude Code: npm install -g @anthropic-ai/claude-code |
| Bot doesn't respond | Ensure MESSAGE CONTENT INTENT is enabled in Discord Developer Portal |
| Bot responds in server | Bot only responds to DMs, not server channels |
| Long delay | Claude is processing; watch for ⏳ emoji |
- Bot only responds to direct messages (not server channels)
- Optional user allowlist via
config.json - No credentials stored except Discord token
- Claude runs with your local permissions
{
"discord.js": "^14.16.3",
"dotenv": "^16.4.7"
}MIT