Discord Bridge for Autonomous Claude Code Sessions

A developer has built a Discord bridge for autonomous Claude Code sessions to solve the pull-based limitation where Claude only acts when tools fire or CLI input is sent. The system enables real-time two-way chat via WebSocket with local file queueing and push notifications on stop/error events.
Architecture
Inbound flow: Discord → WebSocket → bridge.js → discord-inbox.jsonl → PostToolUse hook → Claude
Outbound flow: Claude → Discord MCP → #claude-code-chat → phone push notification
Components
- bridge.js (~50 lines, discord.js v14): Persistent WebSocket to Discord gateway that listens to a dedicated channel and writes messages as JSONL to a local inbox file with zero API polling.
- PostToolUse hook: Reads local inbox on every tool call with no network calls or throttling — just a file read that takes microseconds versus the 2-minute polling interval used previously.
- PreToolUse hook: Auto-starts the bridge on first tool call of every session, silently doing nothing if already running.
- Outbound webhook: Sends structured STATUS updates on Stop/Error events with per-session named threads auto-created via Discord's thread_name parameter (requires ?wait=true to get channel_id back — default returns 204 empty).
Key Design Decisions
The main architectural shift was using a local file queue over API polling. JSONL with atomic truncation prevents race conditions. The bridge is session-agnostic — Discord history persists across crashes and restarts, allowing multiple agents to share the same channel.
Limitations
Permission approval prompts (1/2/3) still require terminal input since Claude is idle at that point and tools aren't firing. This works for redirecting mid-active-run but not for answering stopped prompts.
Testing Results
Tested on 27K lines analyzed overnight across two parallel sessions, finding 15 bugs and delivering a 6-month roadmap at 5:42 AM. Setup requires three bash files and approximately twenty minutes.
📖 Read the full source: r/LocalLLaMA
👀 See Also

Artifactr: Local-first CLI tool for managing AI coding agent artifacts
Artifactr is a free, open-source CLI tool for managing LLM artifacts like skills, commands, and agent definitions. It stores files in portable vaults with no network connections and supports automatic syncing via symlinks.

ClawTalk iOS App Enables Voice Chat with Self-Hosted OpenClaw AI Agents
ClawTalk is a native iOS app that provides push-to-talk voice chat for OpenClaw self-hosted LLM setups. It features on-device speech-to-text using WhisperKit, real-time streaming responses with markdown rendering, and supports multiple TTS options including ElevenLabs, OpenAI, and Apple's built-in voices.

NGX-OS: Network OS Built for AI with eBPF and MCP Integration
NGX-OS is a network operating system designed from the ground up for AI integration, using eBPF for real-time telemetry and MCP for direct LLM access to network state data without translation layers.
Survey of Local-First Markdown Memory Servers for AI Agents: Mem0, Hindsight, Zep, and the Newcomer Engram
A user tested ~20 local agent memory systems for storing memories as editable files. Engram (by Obsidian68) was the only one that met all requirements: fully local, Markdown storage, smart dedup, importance decay, and standalone server.