Bridge Claude Code / Codex to IM platforms — chat with AI coding agents from Telegram, Discord, or Feishu/Lark.
Want a desktop GUI instead? Check out CodePilot — a full-featured desktop app with visual chat interface, session management, file tree preview, permission controls, and more. This skill was extracted from CodePilot's IM bridge module for users who prefer a lightweight, CLI-only setup.
This skill runs a background daemon that connects your IM bots to Claude Code or Codex sessions. Messages from IM are forwarded to the AI coding agent, and responses (including tool use, permission requests, streaming previews) are sent back to your chat.
You (Telegram/Discord/Feishu)
↕ Bot API
Background Daemon (Go binary)
↕ Claude Agent SDK or Codex SDK (configurable via CTI_RUNTIME)
Claude Code / Codex → reads/writes your codebase
- Three IM platforms — Telegram, Discord, Feishu/Lark, enable any combination
- Interactive setup — guided wizard collects tokens with step-by-step instructions
- Permission control — tool calls require explicit approval via inline buttons in chat
- Streaming preview — see Claude's response as it types (Telegram & Discord)
- Session persistence — conversations survive daemon restarts
- Secret protection — tokens stored with
chmod 600, auto-redacted in all logs - Zero code required — install the skill and run
/go-talk-coder setup, that's it
- Go >= 1.22 — for building from source
- Claude Code CLI (for
CTI_RUNTIME=claudeorauto) — installed and authenticated (claudecommand available) - Codex CLI (for
CTI_RUNTIME=codexorauto) —npm install -g @openai/codex. Auth: runcodex auth login, or setOPENAI_API_KEY(optional, for API mode)
npx skills add PhantomMatthew/go-talk-codergit clone https://github.com/PhantomMatthew/go-talk-coder.git ~/.claude/skills/go-talk-coderClones the repo directly into your personal skills directory. Claude Code discovers it automatically.
If you prefer to keep the repo elsewhere (e.g., for development):
git clone https://github.com/PhantomMatthew/go-talk-coder.git ~/code/go-talk-coder
mkdir -p ~/.claude/skills
ln -s ~/code/go-talk-coder ~/.claude/skills/go-talk-coderIf you use Codex, clone directly into the Codex skills directory:
git clone https://github.com/PhantomMatthew/go-talk-coder.git ~/.codex/skills/go-talk-coderOr use the provided install script for automatic dependency installation and build:
# Clone and install (copy mode)
git clone https://github.com/PhantomMatthew/go-talk-coder.git ~/code/go-talk-coder
bash ~/code/go-talk-coder/scripts/install-codex.sh
# Or use symlink mode for development
bash ~/code/go-talk-coder/scripts/install-codex.sh --linkClaude Code: Start a new session and type / — you should see go-talk-coder in the skill list. Or ask Claude: "What skills are available?"
Codex: Start a new session and say "go-talk-coder setup" or "start bridge" — Codex will recognize the skill and run the setup wizard.
/go-talk-coder setup
The wizard will guide you through:
- Choose channels — pick Telegram, Discord, Feishu, or any combination
- Enter credentials — the wizard explains exactly where to get each token, which settings to enable, and what permissions to grant
- Set defaults — working directory, model, and mode
- Validate — tokens are verified against platform APIs immediately
/go-talk-coder start
The daemon starts in the background. You can close the terminal — it keeps running.
Open your IM app and send a message to your bot. Claude Code will respond.
When Claude needs to use a tool (edit a file, run a command), you'll see a permission prompt with Allow / Deny buttons right in the chat.
All commands are run inside Claude Code or Codex:
| Claude Code | Codex (natural language) | Description |
|---|---|---|
/go-talk-coder setup |
"go-talk-coder setup" / "配置" | Interactive setup wizard |
/go-talk-coder start |
"start bridge" / "启动桥接" | Start the bridge daemon |
/go-talk-coder stop |
"stop bridge" / "停止桥接" | Stop the bridge daemon |
/go-talk-coder status |
"bridge status" / "状态" | Show daemon status |
/go-talk-coder logs |
"查看日志" | Show last 50 log lines |
/go-talk-coder logs 200 |
"logs 200" | Show last 200 log lines |
/go-talk-coder reconfigure |
"reconfigure" / "修改配置" | Update config interactively |
/go-talk-coder doctor |
"doctor" / "诊断" | Diagnose issues |
The setup wizard provides inline guidance for every step. Here's a summary:
- Message
@BotFatheron Telegram →/newbot→ follow prompts - Copy the bot token (format:
123456789:AABbCc...) - Recommended:
/setprivacy→ Disable (for group use) - Find your User ID: message
@userinfobot
- Go to Discord Developer Portal → New Application
- Bot tab → Reset Token → copy it
- Enable Message Content Intent under Privileged Gateway Intents
- OAuth2 → URL Generator → scope
bot→ permissions: Send Messages, Read Message History, View Channels → copy invite URL
- Go to Feishu Open Platform (or Lark)
- Create Custom App → get App ID and App Secret
- Batch-add permissions: go to "Permissions & Scopes" → use batch configuration to add all required scopes (the
setupwizard provides the exact JSON) - Enable Bot feature under "Add Features"
- Events & Callbacks: select "Long Connection" as event dispatch method → add
im.message.receive_v1event - Publish: go to "Version Management & Release" → create version → submit for review → approve in Admin Console
- Important: The bot will NOT work until the version is approved and published
~/.go-talk-coder/
├── config.env ← Credentials & settings (chmod 600)
├── data/ ← Persistent JSON storage
│ ├── sessions.json
│ ├── bindings.json
│ ├── permissions.json
│ └── messages/ ← Per-session message history
├── logs/
│ └── bridge.log ← Auto-rotated, secrets redacted
└── runtime/
├── bridge.pid ← Daemon PID file
└── status.json ← Current status
| Component | Role |
|---|---|
cmd/cti/main.go |
CLI entry — handles start/stop/status/logs/doctor commands |
cmd/cti-daemon/main.go |
Daemon entry — starts bridge and handles signals |
internal/config/ |
Load/save config.env, map to bridge settings |
internal/store/ |
JSON file BridgeStore with write-through cache |
internal/llm/ |
Claude Agent SDK and Codex SDK streaming providers |
internal/permission/ |
Async permission gateway: SDK canUseTool ↔ IM buttons |
internal/logger/ |
Secret-redacted file logging with rotation |
internal/supervisor/ |
Process management (start/stop/status) |
internal/doctor/ |
Health checks and diagnostics |
SKILL.md |
Claude Code skill definition |
1. Claude wants to use a tool (e.g., Edit file)
2. SDK calls canUseTool() → LLMProvider emits permission_request SSE
3. Bridge sends inline buttons to IM chat: [Allow] [Deny]
4. canUseTool() blocks, waiting for user response (5 min timeout)
5. User taps Allow → bridge resolves the pending permission
6. SDK continues tool execution → result streamed back to IM
Run diagnostics:
/go-talk-coder doctor
/go-talk-coder doctor
This checks: Go version, config file existence and permissions, token validity (live API calls), log directory, PID file consistency, and recent errors.
| Issue | Solution |
|---|---|
| `Bridge won't start` | Run `doctor`. Check if Go binaries are built. Check logs. |
| `Messages not received` | Verify token with `doctor`. Check allowed users config. |
| `Permission timeout` | User didn't respond within 5 min. Tool call auto-denied. |
| `Stale PID file` | Run `stop` then `start`. daemon.sh auto-cleans stale PIDs. |
See [references/troubleshooting.md](references/troubleshooting.md) for more details.
## Security
- All credentials stored in `~/.go-talk-coder/config.env` with `chmod 600`
- Tokens are automatically redacted in all log output (pattern-based masking)
- Allowed user/channel/guild lists restrict who can interact with the bot
- The daemon is a local process with no inbound network listeners
- See [SECURITY.md](SECURITY.md) for threat model and incident response
## Development
```bash
make deps # Download dependencies
make build # Build CLI and daemon binaries
make test # Run tests
make fmt # Format code
make lint # Run linter
make dev # Run daemon in dev mode