cc-telegram-bridge
CLAUDE.md20 starsChanged 6 months agoMITView on GitHub
Before modifying Telegram flow, Feishu/Lark flow, bus flow, state/config handling, usage/budget/audit logic, or file delivery, read: That file is the source of truth for codebase navigation and test selection. Static Telegram transport rules belong in instance-level ~/.cctb/<instance>/agent.md, not in resumed project AGENTS.md or CLAUDE.md. If those rules change, update docs/telegram-instance-agent.md and sync affected instance agent.md files. This repository is not in maintenance mode. The active objective is: make TaroCub a reliable local control surface for Codex, Claude Code, Kimi Code,…
- Reads credentials
1 other project uses a version of this.
Adopted by
Most recently taken up by
- cloveric/tarocubword for word, first seen May 30, 2026
Other versions1 project uses a version of this.
Word for word · 1
- cloveric/tarocub★ 20100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository4 other files it gives its agents.
- AGENTS.mdAGENTS.md
- lark-bot-permissionsSkill
- scraplingSkill
- tarocub-service-opsSkill
The file
Show its rules and text
We split this CLAUDE.md into the rules it gives an agent
18 rules. About 0 are common, 13 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈13
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 5
Before modifying Telegram flow, Feishu/Lark flow, bus flow, state/config handling, usage/budget/audit logic, or file delivery, read:
- Distinctive: line 20
Do not treat "feature implemented" as "work complete" unless the current milestone has been verified end-to-end.
- Distinctive: line 24
When the operator says "commit and release", do not stop at a commit, tag, or GitHub Release.
- Distinctive: line 26
Commit the intended changes without unrelated runtime state or secrets.
- Distinctive: line 27
Create or update the GitHub Release with accurate notes.
- Very specific: line 30
Do not include external package-registry publishing in the release flow.
- Distinctive: line 34
When you feel the urge to stop, summarize, or hand back partially-finished work:
- Very specific: line 36
Run ./scripts/pre-complete-hook.sh (or .\scripts\pre-complete-hook.ps1 on Windows)
- Distinctive: line 37
If it fails, fix the failures
- Distinctive: line 38
If it passes but known parity/stability gaps remain, continue with the highest-value next task
- Distinctive: line 43
Do not stop just because:
- Distinctive: line 60
Before claiming meaningful progress, prefer evidence over assertion:
- Distinctive: line 68
When choosing the next task without asking:
- Very specific: line 89
Test both the response-text tag path ([send-file:] / [send-image:], all engines) and the Codex telegram-out auto-delivery path.
- Very specific: line 93
Never break the deliverTelegramResponse function without re-running its test cases (tests/telegram-response-delivery.test.ts, see commit …
- Distinctive: line 114
Before committing or pushing, verify that none of the following appear in code, docs, or examples:
- Distinctive: line 123
Run this check before pushing:
- Distinctive: line 131
If it matches anything, fix before committing.
≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
TaroCub Instructions
Read First
Before modifying Telegram flow, Feishu/Lark flow, bus flow, state/config handling, usage/budget/audit logic, or file delivery, read:
docs/entrypoint-map.mddocs/telegram-instance-agent.mdwhen changing static Telegram transport instructions
That file is the source of truth for codebase navigation and test selection.
Static Telegram transport rules belong in instance-level ~/.cctb/<instance>/agent.md, not in resumed project AGENTS.md or CLAUDE.md. If those rules change, update docs/telegram-instance-agent.md and sync affected instance agent.md files.
Mission
This repository is not in maintenance mode. The active objective is:
make TaroCub a reliable local control surface for Codex, Claude Code, Kimi Code, and Antigravity across Telegram and Feishu/Lark, keeping parity where possible and using each platform's native strengths where it is better
Do not treat "feature implemented" as "work complete" unless the current milestone has been verified end-to-end.
Release Rule
When the operator says "commit and release", do not stop at a commit, tag, or GitHub Release. A complete TaroCub release requires:
- Commit the intended changes without unrelated runtime state or secrets.
- Create or update the GitHub Release with accurate notes.
- Restart and verify the Telegram and Lark fleet.
Do not include external package-registry publishing in the release flow. For Lark fleet restarts, use node dist/src/index.js lark service restart --all; do not hand-roll per-instance restart loops.
Persistence Rule
When you feel the urge to stop, summarize, or hand back partially-finished work:
- Run
./scripts/pre-complete-hook.sh(or.\scripts\pre-complete-hook.ps1on Windows) - If it fails, fix the failures
- If it passes but known parity/stability gaps remain, continue with the highest-value next task
- Only stop when:
- the current milestone is actually complete, or
- you hit a real blocker that cannot be resolved locally
Do not stop just because:
- tests are passing
- one bug is fixed
- one feature was merged
- a bot replied once
This project should be driven toward:
- stronger service stability
- tighter access control
- better session continuity
- cleaner operator experience
- closer cross-channel parity with Telegram and Lark-native UX where Lark is stronger
Verification Standard
Before claiming meaningful progress, prefer evidence over assertion:
npm testnpm run build- focused runtime checks for the area touched
Operator Priorities
When choosing the next task without asking:
- Fix correctness or security bugs
- Fix duplicate replies, dropped updates, broken service lifecycle, or bad session continuity
- Improve operator controls and observability
- Improve GitHub presentation and documentation
File Delivery: Engine Differences
The engines surface files differently. The delivery layer (src/telegram/delivery.ts → response-delivery.ts) handles these formats:
| Engine | Format | Example | Notes |
| All engines | [send-file:/path] / [send-image:/path] tag | [send-file:/Users/me/img.png] | The only response-text delivery tag. [send-image:] prefers sendPhoto. |
| All engines | Inline text file block | ```file:report.txt\ncontent\n``` | Only honored when it is the entire response — a fenced file: block surrounded by other text is treated as an explanatory example, not an attachment. |
| Codex | telegram-out auto-delivery | files written under workspace/.telegram-out/<req>/ | Codex's primary file path: the message-turn loop auto-delivers files the engine produced in the current request output dir. |
Codex does NOT use Markdown image/link extraction. That extraction was removed: deliverTelegramResponse leaves Markdown absolute links (, [name](/path)) as ordinary chat text (codified by the "leaves markdown absolute links as ordinary chat text" test in tests/telegram-response-delivery.test.ts). Codex delivers files via telegram-out auto-delivery, generated-image [send-image:] tags, and the cctb send side channel — not Markdown syntax.
When modifying file delivery logic:
- Test both the response-text tag path (
[send-file:]/[send-image:], all engines) and the Codex telegram-out auto-delivery path. - File path patterns must match both Unix (
/Users/...) and Windows (C:\Users\...) absolute paths. - The
sendFileOrPhotohelper auto-detects image extensions and usessendPhoto(Telegram compresses) with asendDocumentfallback. - Multiple images are sent one-by-one (each via
sendFileOrPhoto).sendMediaGroupexists on the API but currently has zero call sites — there is no album batching today; do not assume it. - Never break the
deliverTelegramResponsefunction without re-running its test cases (tests/telegram-response-delivery.test.ts, see commit7dad7a4).
Engine Runtime Differences
| Capability | Codex | Claude Code | Kimi Code | Antigravity |
| Runtime | persistent app-server by default | streaming CLI worker | persistent ACP worker | one-shot print mode |
| Explicit resume | /resume thread <id> | local scan and /resume <n> | ACP session/list scan and /resume session <id> via real session/load | log scan or /resume conversation <id> |
| Goal | bridge-native, including status/clear | native goal prompt | unsupported by ACP 0.31.1; reject explicitly | native goal prompt |
| Mid-turn steer | app-server turn/steer | unsupported | unsupported by ACP | unsupported |
| Compact | bridge reset fallback | native compact | real ACP /compact command | unsupported |
| Usage | structured token usage when emitted | token and cost usage | no structured per-turn usage in ACP 0.31.1 | no structured per-turn usage |
| Instructions | trusted runtime channel | appended system prompt | workspace .kimi-code/agents/agent.md main-agent override; prompt-scoped block only for external workspace overrides | prompt-scoped bridge instructions |
Kimi AskUserQuestion currently exposes only ACP-advertised option IDs. Keep it
single-choice and do not add a free-text Other path unless the protocol starts
providing a structured input field. See docs/kimi-engine-notes.md before
changing Kimi behavior.
Security: No Private Data in Commits
Before committing or pushing, verify that none of the following appear in code, docs, or examples:
- Bot tokens — use placeholder
<bot-token-from-BotFather> - API keys —
ghp_*,sk-ant-*,ANTHROPIC_API_KEY, etc. - Pairing codes — real 6-char codes like
38J63T - Chat IDs / User IDs — real Telegram numeric IDs
- File paths containing usernames — use
~/or%USERPROFILE%instead of/Users/realname/ .envfiles,access.json,session.json— must be in.gitignore
Run this check before pushing:
# NOTE: use /usr/bin/grep explicitly — an interactive shell may alias/shadow `grep`
# (ugrep with --ignore-files silently returned ZERO on a history that really had 7 hits).
# The token pattern must NOT require a literal "bot" prefix: a raw BotFather token
# (<digits>:<35 chars>) is exactly what leaked once and that form never matched.
git diff --cached | /usr/bin/grep -inE 'ghp_[A-Za-z0-9]{20,}|sk-ant-|LTAI[A-Za-z0-9]{10,}|ALIBABA_CLOUD_ACCESS_KEY|TINGWU_APP_KEY=[A-Za-z0-9]|OSSAccessKeyId|[0-9]{8,10}:[A-Za-z0-9_-]{35}|TELEGRAM_BOT_TOKEN=[A-Za-z0-9]'If it matches anything, fix before committing.
Repo Notes
- Cross-platform (macOS / Linux / Windows). Primary development target is macOS; Windows support is maintained.
- One Telegram bot per instance; one Lark app/service surface for the Lark channel
- One instance per process
- State lives under
~/.cctb/<instance>/(POSIX) or%USERPROFILE%\.cctb\<instance>\(Windows)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

