claude_bridge_discord

作者 who96已验证

Single-file bridge: talk to Claude Code CLI from Discord.

162
Stars
10
Forks
Python
语言
2026/8/23
添加时间

⚠️ 第三方软件声明

本 Skill 为第三方开源软件,独立托管于 GitHub。SkillTip 仅为信息目录,不控制或维护底层仓库。所显示的安全检查为自动化且范围有限,安装前请自行审查源码。

阅读服务条款

安装

添加到你的 Claude Code skills 目录:

# Add to your Claude Code skills
git clone https://github.com/who96/claude_bridge_discord

快速入门

使用 claude_bridge_discord 等 Skills 的指南。

安全报告

已验证

上次扫描:—

{
  "status": "PASSED",
  "issues": []
}

README.md

CLI Discord Bridge

Single-file Discord bridge for Codex CLI operation.

The actively maintained runtime targets Codex: one Discord channel connects to one Codex CLI process. Legacy artifacts remain only for rollback and command continuity.

Command surface remains compatible with earlier bridge flows: /new /status /connect /handoff /help.

Deployment Topology

  • Single process, single channel, single vendor (Codex)
  • One process listens to exactly one CHANNEL_ID
  • Multi-channel or multi-vendor HA is done by duplicating processes, not by mixing routes in one process

Runtime Flow

Discord message -> bridge.py -> codex exec/resume --json -> parse JSON events -> Discord reply

Bridge state:

  • State dir: ~/.cli-discord-bridge/
  • Session file: ~/.cli-discord-bridge/session.json
    • Primary key: thread_id
    • Backward-compatible read: legacy session_id
  • Handoff dir: ~/.cli-discord-bridge/handoffs/

Codex Session Protocol

  • New thread:
    • codex exec --json --skip-git-repo-check [--dangerously-bypass-approvals-and-sandbox] [-m MODEL] "<prompt>"
  • Resume thread:
    • codex exec resume --json --skip-git-repo-check [--dangerously-bypass-approvals-and-sandbox] [-m MODEL] <thread_id> "<prompt>"
  • Parser rules:
    • Parse JSON lines only, ignore non-JSON noise
    • Use thread.started.thread_id as authoritative thread ID
    • Aggregate item.completed.item.type=="agent_message" text as reply body

/connect safety:

  • Explicit /connect <thread_id> is strict.
  • If resume returns a different thread.started.thread_id, bridge treats it as failure and blocks auto-fallback.

Implicit fallback:

  • In non-explicit mode, resume failure may switch to a new thread and update local state.

Environment Variables

VariableRequiredDefaultDescription
DISCORD_TOKENYesDiscord bot token
CHANNEL_IDYesDiscord channel ID
CODEX_BINNocodexCodex CLI binary path
CODEX_MODELNoemptyOptional model override
CODEX_TIMEOUTNo300Max seconds per Codex call
CODEX_CWDNo$HOMEWorking directory for Codex call
CODEX_FULL_ACCESSNo01 enables --dangerously-bypass-approvals-and-sandbox
SELFTEST_ON_STARTNo01 runs startup selftest

Compatibility fallback (for smooth migration):

  • CLAUDE_CWD can still be used if CODEX_CWD is not set
  • CLAUDE_TIMEOUT can still be used if CODEX_TIMEOUT is not set

Commands

CommandBehavior
/newClear current thread; next message creates a new thread
/statusShow current thread, cwd, timeout, backend
/connect [thread-id]Bind explicit thread (no arg = reset)
/handoffSummarize old thread -> coldstart new thread; rollback old thread if new bootstrap fails
/helpShow command help

Local Run

python3 -m venv .venv
.venv/bin/pip install -r requirements.txt

DISCORD_TOKEN="xxx" \
CHANNEL_ID="1234567890" \
CODEX_FULL_ACCESS="1" \
.venv/bin/python3 bridge.py

LaunchAgent (CLI)

Legacy rollback example:

  • com.claude.discord-bridge.plist.example (legacy)

Use the active CLI bridge example:

  • com.cli.discord-bridge.plist.example

Install example:

cp com.cli.discord-bridge.plist.example ~/Library/LaunchAgents/com.cli.discord-bridge.plist
# edit token/channel/paths
launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/com.cli.discord-bridge.plist

Stop:

launchctl bootout gui/$(id -u)/com.cli.discord-bridge

Logs:

tail -f ~/.cli-discord-bridge/bridge.log
tail -f ~/.cli-discord-bridge/bridge.err.log

Gray Release and Rollback

Recommended migration sequence:

  1. Start com.cli.discord-bridge in a new Discord channel.
  2. Keep the legacy rollback service running in parallel for observation.
  3. Observe 24h for stuck process, leaks, thread loss, and command compatibility.
  4. Switch OpenClaw DR entry to the new CLI bridge channel.
  5. If needed, rollback by stopping com.cli.discord-bridge and continuing with legacy service.

Notes

  • This project does not implement dynamic multi-vendor switching in one process.
  • If you need more HA lanes, copy service instances with different CHANNEL_ID and state dirs.

常见问题

What is claude_bridge_discord?

claude_bridge_discord is an open-source cli tools skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by who96. Single-file bridge: talk to Claude Code CLI from Discord. It has 162 GitHub stars.

Is claude_bridge_discord safe to use?

Yes. claude_bridge_discord passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.

How do I install claude_bridge_discord?

Clone the repository with "git clone https://github.com/who96/claude_bridge_discord" and add it to your Claude Code skills directory (see the Installation section above).

What programming language is claude_bridge_discord written in?

claude_bridge_discord is primarily written in Python. It is open-source under who96 on GitHub, so you can review or fork the full source.

Are there alternatives to claude_bridge_discord?

Yes. SkillsLLM lists many other CLI Tools skills you can browse and compare side by side. Open the CLI Tools category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh claude_bridge_discord against similar tools.

评论 (0)

暂无评论,成为第一个分享想法的人!

ui-ux-pro-max-skill

by nextlevelbuilder

12

An AI skill that provides design intelligence for building professional UI/UX across multiple platforms.

119,92012,870Python
CLI 工具ai-skillsantigravity
查看详情

happy

by slopus

Mobile and Web client for Codex and Claude Code, with realtime voice, encryption and fully featured

23,4501,980TypeScript
CLI 工具
查看详情

claudecodeui

by siteboon

Use Claude Code, OpenCode, Cursor CLI, and Codex on mobile and web with CloudCLI (aka Claude Code UI). CloudCLI is a free open source webui/GUI that helps you manage your Claude Code session and projects remotely.

13,3941,866TypeScript
CLI 工具
查看详情

CRS-自建Claude Code镜像,一站式开源中转服务,让 Claude、OpenAI、Gemini、Droid 订阅统一接入,支持拼车共享,更高效分摊成本,原生工具无缝使用。

12,5471,869JavaScript
CLI 工具
查看详情

ccstatusline

by sirmalloc

🚀 Beautiful highly customizable statusline for Claude Code CLI with powerline support, themes, and more.

12,508545TypeScript
CLI 工具
查看详情

开发者还喜欢

基于喜欢此 Skill 的开发者投票和收藏

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI 智能体ai-agentsbrainstorming
查看详情

hermes-agent

by NousResearch

10

The agent that grows with you

234,43747,175Python
AI 智能体ai-agentsagent-orchestration
查看详情

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

201,88160,308TypeScript
MCP 服务器apisai-tools
查看详情

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI 智能体claude-codeai-tools
查看详情