skip to content
all projects
shipped 2026

Remote Claude

Discord bot that pipes your DMs into a local Claude Code session.

TypeScript Node.js discord.js Claude
automationaiopen source

A Discord bot that wraps the Claude Code CLI so you can use it from any device. You DM the bot, it spawns claude -p with your prompt piped via stdin, streams the NDJSON response back event-by-event, and splits it across messages automatically. Claude runs on your local machine with full filesystem and tool access – the bot is just a thin transport layer.

The non-obvious constraint was Windows. Prompts can’t go on the command line because of the 8191-character shell limit and escaping hazards, so everything goes through stdin instead. System prompt context (Discord interface awareness, recalled history, pending screenshots) gets written to a temp file and passed via --append-system-prompt-file for the same reason. Cancellation also required taskkill /F /T rather than .kill() – Node’s kill only terminates the shell process, not the child tree underneath it.

It grew past a simple relay: /recall searches your DM history and injects matching messages as context, /screenshot captures your screen and queues it for Claude to analyse, and there’s a memory system for facts that persist across sessions. The bot sets its Discord presence to the current working directory, so you can tell at a glance which project it’s parked in.

Writeups

from this project