cc-connect on Hugging Face Spaces (Private, Matrix Gitter bridge)
Bridge your Gitter / Matrix chat to Claude Code, running on HF Space. No public web exposure — cc-connect is a Matrix bot service using sync long-polling.
Platform Choice: Why Matrix (Gitter bridge)
6-22 : Slack manifest mode 死结 (短名 slash command 政策改),改走 Matrix.
homeserver : https://gitter.ems.host (社区自建 Gitter 桥接 homeserver)
identity server : https://vector.im
user : @agent:gitter.im
access token : mat_Wz3t7HAFYvXZnPKgauUmIpTHiyCnHC_CBhOq1 (mautrix 旧 prefix)
HF 容器 6-22 05:55:06 实测 :matrix: connected user_id=@agent:gitter.im + platform ready + cc-connect is running projects=1
View Logs
1 # Install
2 pip install -U "huggingface_hub[cli]"
3
4 # Login
5 hf auth login
6
7 # Runtime logs
8 hf spaces logs ce9900ce/cc-connect-matrix --tail 100
9
10 # Stream live
11 hf spaces logs ce9900ce/cc-connect-matrix --follow
Quick Deploy (5 minutes after getting 2 tokens)
1 # Get ANTHROPIC_API_KEY from console.anthropic.com
2 ./deploy-matrix-hf.sh '<MATRIX_ACCESS_TOKEN>' '<ANTHROPIC_API_KEY>'
3 # Auto-creates private Space + Dataset + 3 Secrets + push code
4 # Watch: hf spaces logs ce9900ce/cc-connect-matrix --follow
Hetzner Alternative (5 minutes)
If you have a Hetzner VPS, even faster:
1 ./deploy-hetzner.sh < vps-ip >
2 # Edit .env with tokens, then: docker compose restart
Architecture
HF Space Container (Debian 12, no public port)
+- start.sh (PID 1)
+- cc-connect v1.4.0-beta.1 (Go binary) ← Matrix sync long-polling ↔ Claude Code
+- Claude Code CLI (npm)
+- sync_loop.sh ← git commit + push to HF Dataset every 5min
+- watchdog.sh ← keep cc-connect alive
v git push/pull v
HF Dataset (persistent storage)
No port 8080. No web UI. Just a Matrix bot.
Setup
1. Matrix account (already done)
大古已经提供 token. Gitter 桥接 homeserver gitter.ems.host, user @agent:gitter.im.
2. Create HF Dataset (auto-done by deploy script)
ce9900ce/cc-connect-state-matrix, Private
3. Create HF Space (auto-done by deploy script)
ce9900ce/cc-connect-matrix, SDK: Docker , Private
4. Space Secrets (auto-added by deploy script)
Secret Value MATRIX_ACCESS_TOKENmat_xxx from Gitter bridgeANTHROPIC_API_KEYFrom console.anthropic.com HF_TOKENHF write token (for sync_loop)
5. Upload code (auto-push by deploy script)
deploy script does: git push -f to Space repo.
Usage
In Element / Gitter:
Find bot : @agent:gitter.im (Matrix user)
DM : Send direct message
Channel : @agent:gitter.im hello
License
MIT.
Mon Jun 22 07:16:15 UTC 2026