kevinWangSheng be74fddca2 fix(agent): prevent panic from closing events channel while readLoop may still send
In 6 agent session implementations (codex, opencode, qoder, iflow, cursor,
gemini), Close() unconditionally calls close(events) after an 8-second
timeout, even when the readLoop goroutine may still be running and
sending events to the channel. Due to Go's select non-determinism, the
readLoop goroutine can choose the send case over the ctx.Done() case,
causing a "send on closed channel" panic.

Move close(events) into the case where wg.Wait() succeeds (readLoop has
fully exited), and skip closing on timeout to prevent the race. This
follows the same safe pattern already used by claudeSession, where the
events channel is only closed after the readLoop goroutine has finished.
2026-03-14 08:36:29 -07:00

CC-Connect Banner

CI Status Release npm downloads License Go Report Card

Discord Telegram

English | 中文


Control your local AI agents from any chat app. Anywhere, anytime.

cc-connect bridges AI agents running on your machine to the messaging platforms you already use.
Code review, research, automation, data analysis — anything an AI agent can do,
now accessible from your phone, tablet, or any device with a chat app.

CC-Connect Architecture


✨ Why cc-connect?

🤖 Universal Agent Support

7 AI Agents — Claude Code, Codex, Cursor Agent, Qoder CLI, Gemini CLI, OpenCode, iFlow CLI. Use whichever fits your workflow, or all of them at once.

📱 Platform Flexibility

9 Chat Platforms — Feishu, DingTalk, Slack, Telegram, Discord, WeChat Work, LINE, QQ, QQ Bot (Official). Most need zero public IP.

🔄 Multi-Agent Orchestration

Multi-Bot Relay — Bind multiple bots in a group chat and let them communicate with each other. Ask Claude, get insights from Gemini — all in one conversation.

🎮 Complete Chat Control

Full Control from Chat — Switch models (/model), tune reasoning (/reasoning), change permission modes (/mode), manage sessions, all via slash commands.

🧠 Persistent Memory

Agent Memory — Read and write agent instruction files (/memory) without touching the terminal.

⏰ Intelligent Scheduling

Scheduled Tasks — Set up cron jobs in natural language. "Every day at 6am, summarize GitHub trending" just works.

🎤 Multimodal Support

Voice & Images — Send voice messages or screenshots; cc-connect handles STT/TTS and multimodal forwarding.

📦 Multi-Project Architecture

Multi-Project — One process, multiple projects, each with its own agent + platform combo.

🌍 Multilingual Interface

5 Languages — Native support for English, Chinese (Simplified & Traditional), Japanese, and Spanish. Built-in i18n ensures everyone feels at home.


飞书 Telegram 微信

Left:Lark  |  Telegram  |  Right:Wechat


🚀 Quick Start

The easiest way — Send this to Claude Code or any AI coding agent, and it will handle the entire installation and configuration for you:

Follow https://raw.githubusercontent.com/chenhg5/cc-connect/refs/heads/main/INSTALL.md to install and configure cc-connect.

IMPORTANT: Use interactive tools (like AskUserQuestion) to guide me through configuration choices:
- Agent selection (Claude Code, Cursor, Gemini, etc.)
- Platform selection (Feishu, Telegram, Discord, etc.)
- API keys and authentication tokens
- Project paths and preferences

Don't guess values—always ask me to choose via interactive prompts.

📦 Manual Install

Via npm:

# Stable version
npm install -g cc-connect

# Beta version (more features, may be unstable)
npm install -g cc-connect@beta

Download binary from GitHub Releases:

# Linux amd64 - Stable
curl -L -o cc-connect https://github.com/chenhg5/cc-connect/releases/latest/download/cc-connect-linux-amd64
chmod +x cc-connect
sudo mv cc-connect /usr/local/bin/

# Beta version (from pre-release)
curl -L -o cc-connect https://github.com/chenhg5/cc-connect/releases/download/v1.x.x-beta/cc-connect-linux-amd64

Build from source (requires Go 1.22+):

git clone https://github.com/chenhg5/cc-connect.git
cd cc-connect
make build

⚙️ Configure

mkdir -p ~/.cc-connect
cp config.example.toml ~/.cc-connect/config.toml
vim ~/.cc-connect/config.toml

▶️ Run

./cc-connect

🔄 Upgrade

# npm
npm install -g cc-connect

# Binary self-update
cc-connect update           # Stable
cc-connect update --pre     # Beta (includes pre-releases)

📊 Support Matrix

Component Type Status
Agent Claude Code ✅ Supported
Agent Codex (OpenAI) ✅ Supported
Agent Cursor Agent ✅ Supported
Agent Gemini CLI (Google) ✅ Supported
Agent Qoder CLI ✅ Supported
Agent OpenCode (Crush) ✅ Supported
Agent iFlow CLI ✅ Supported
Agent Goose (Block) 🔜 Planned
Agent Aider 🔜 Planned
Platform Feishu (Lark) ✅ WebSocket — no public IP needed
Platform DingTalk ✅ Stream — no public IP needed
Platform Telegram ✅ Long Polling — no public IP needed
Platform Slack ✅ Socket Mode — no public IP needed
Platform Discord ✅ Gateway — no public IP needed
Platform LINE ✅ Webhook — public URL required
Platform WeChat Work ✅ WebSocket / Webhook
Platform QQ (NapCat/OneBot) ✅ WebSocket — Beta
Platform QQ Bot (Official) ✅ WebSocket — no public IP needed

📖 Platform Setup Guides

Platform Guide Connection Public IP?
Feishu (Lark) docs/feishu.md WebSocket No
DingTalk docs/dingtalk.md Stream No
Telegram docs/telegram.md Long Polling No
Slack docs/slack.md Socket Mode No
Discord docs/discord.md Gateway No
WeChat Work docs/wecom.md WebSocket / Webhook No (WS) / Yes (Webhook)
QQ / QQ Bot docs/qq.md WebSocket No

🎯 Key Features

💬 Session Management

/new [name]       Start a new session
/list             List all sessions
/switch <id>      Switch session
/current          Show current session

🔐 Permission Modes

/mode             Show available modes
/mode yolo        # Auto-approve all tools
/mode default     # Ask for each tool

🔄 Provider Management

/provider list              List providers
/provider switch <name>     Switch API provider at runtime

⏰ Scheduled Tasks

/cron add 0 6 * * * Summarize GitHub trending

📖 Full documentation: docs/usage.md


📚 Documentation


👥 Community


🙏 Contributors


⭐ Star History

Star History Chart

📄 License

MIT License


Built with ❤️ by the cc-connect community

S
Description
Bridge local AI coding agents (Claude Code, Cursor, Gemini CLI, Codex) to messaging platforms (Feishu/Lark, DingTalk, Slack, Telegram, Discord, LINE, WeChat Work). Chat with your AI dev assistant from anywhere — no public IP required for most platforms.
Readme
24 MiB
0 Stars 1 Watchers 0 Forks
Languages
Go 91.9%
TypeScript 7.5%
JavaScript 0.2%
Makefile 0.1%
HTML 0.1%
Other 0.1%