agentleFS
leoshenzhleoshenzh/codex-on-telegram/SKILL.md

claude-to-im

Skill2 starsChanged 5 months agoMITView on GitHub

Use when working on the local Telegram bridge that lets the owner continue Codex or Claude sessions from Telegram, especially for setup, start/stop, health checks, restart questions, binding questions, or runtime reconfiguration.

  • Reads credentials

5 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions5 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 5

    1. op7418/Claude-to-IM-skill★ 2.9ksame name
    2. ZhouYinLong-lab/Dog-Skills★ 7same name
    3. happynocode/claude-to-im-codex-plus★ 2same name
    4. sss-hust/skills★ 1same name
    5. zkw15555506767-boop/claude-skills★ 1same name

    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 repository2 other files it gives its agents.

The file

Show its rules and text

We split this skill into the rules it gives an agent

26 rules. 0 are common, 18 are distinctive, and 8 are very specific to this project.

  • 0

    Common

    Most of the 5 edited versions we read keep these.

  • 18

    Distinctive

    This author's own choices. Worth a look.

  • 8

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use when the owner asks about the local Telegram bridge itself.

    line 22
  2. Very specific:

    Use when the task is setup, start, stop, status, logs, doctor, or reconfigure.

    line 23
  3. Distinctive:

    Use when the owner asks whether Telegram will continue the same session after restart.

    line 24
  4. Very specific:

    Use when the owner asks how /bind, /sessions, topics, or local-session continuation behave.

    line 25
  5. Distinctive:

    Do not use this skill for unrelated Telegram bot work or generic chat replies.

    line 26
  6. Distinctive:

    Keep Telegram as the only chat channel.

    line 29
  7. Distinctive:

    Keep runtime selection between Claude and Codex.

    line 30
  8. Distinctive:

    Keep daemon control, health checks, and local-session continuation.

    line 31
  9. Distinctive:

    Keep Telegram private chat, groups, and topics aligned with the current Codex runtime behavior.

    line 32
  10. Distinctive:

    Do not reintroduce Discord, Feishu/Lark, QQ, or Weixin flows.

    line 33
  11. Very specific:

    Default runtime if unset: claude.

    line 48
  12. Distinctive:

    Keep group use owner-only by default through owner / allowlist checks

    line 54
  13. Distinctive:

    Keep one separate bound session per Telegram topic

    line 55
  14. Distinctive:

    Do not surface local Claude-runtime history when running the Codex runtime

    line 57
  15. Distinctive:

    Keep the current active session easy to resume from Telegram

    line 59
  16. Very specific:

    Ensure npm install and npm run build have been run.

    line 62
  17. Very specific:

    Create ~/.claude-to-im/config.env from config.env.example.

    line 63
  18. Distinctive:

    If a window or topic has never been bound before, the first normal message should create a session automatically.

    line 77
  19. Very specific:

    If a bridge session already has an sdk_session_id, /sessions may merge that with matching local Codex history so the same underlying …

    line 79
  20. Distinctive:

    Do not rebind just because the daemon was restarted.

    line 86
  21. Distinctive:

    If a short prefix matches more than one session, the bridge should reject it as ambiguous instead of guessing.

    line 92
  22. Distinctive:

    Default runtime should be Codex.

    line 95
  23. Very specific:

    Default mode should be code.

    line 96
  24. Distinctive:

    Keep instructions short and concrete.

    line 124
  25. Distinctive:

    Prefer direct commands over long explanations.

    line 125
  26. Very specific:

    If the bridge is broken, run doctor before guessing.

    line 126

“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Codex on Telegram

This skill manages a Telegram bridge for continuing local Claude/Codex sessions from mobile chat.

When to Use

  • Use when the owner asks about the local Telegram bridge itself.
  • Use when the task is setup, start, stop, status, logs, doctor, or reconfigure.
  • Use when the owner asks whether Telegram will continue the same session after restart.
  • Use when the owner asks how /bind, /sessions, topics, or local-session continuation behave.
  • Do not use this skill for unrelated Telegram bot work or generic chat replies.

Scope

  • Keep Telegram as the only chat channel.
  • Keep runtime selection between Claude and Codex.
  • Keep daemon control, health checks, and local-session continuation.
  • Keep Telegram private chat, groups, and topics aligned with the current Codex runtime behavior.
  • Do not reintroduce Discord, Feishu/Lark, QQ, or Weixin flows.

Commands

  • setup: explain the config file and required steps
  • start: run bash scripts/daemon.sh start
  • stop: run bash scripts/daemon.sh stop
  • status: run bash scripts/daemon.sh status
  • logs [N]: run bash scripts/daemon.sh logs N
  • doctor: run bash scripts/doctor.sh
  • reconfigure: show the current config path and explain which fields to edit

This Install

  • Absolute data home: $HOME/.claude-to-im/
  • Absolute config file: $HOME/.claude-to-im/config.env
  • Launch/runtime invariant: this install must run with CTI_HOME=$HOME/.claude-to-im when starting, stopping, checking, or regenerating launchd.
  • Default runtime if unset: claude; Codex runs when CTI_RUNTIME=codex, or when auto falls back to Codex.
  • Bridge session records and bindings live under $HOME/.claude-to-im/data/.
  • Local Codex history shown in /sessions does not come only from $HOME/.claude-to-im/; it is discovered from local Codex session files, usually under ~/.codex/, or from CTI_CODEX_SESSIONS_ROOT if that override is set.

Expected Behavior

  • Let the owner continue a local Codex session from Telegram private chat, groups, and topics
  • Keep group use owner-only by default through owner / allowlist checks
  • Keep one separate bound session per Telegram topic
  • Show local Codex history in /sessions
  • Do not surface local Claude-runtime history when running the Codex runtime
  • Ignore slash-command-only titles when naming local Codex sessions
  • Keep the current active session easy to resume from Telegram

Setup flow

  1. Ensure npm install and npm run build have been run.
  2. Create ~/.claude-to-im/config.env from config.env.example.
  3. Set Telegram fields (bot token, owner user ID, allowlist, etc.).
  4. For group use, set CTI_TG_REQUIRE_PRIVATE_CHAT=false.
  5. In BotFather, disable group privacy for the bot so normal group messages reach the bridge.
  6. CTI_ENABLED_CHANNELS=telegram is already the code default; explain it when asked, but it is not the special fix for most setups.
  7. Start the daemon.

Session and binding behavior

  • Session records live in ~/.claude-to-im/data/sessions.json.
  • Telegram window/topic bindings live in ~/.claude-to-im/data/bindings.json.
  • Message history lives in ~/.claude-to-im/data/messages/.
  • Restarting the daemon should keep using the same bound session because those files are loaded again on startup.
  • A Telegram window or topic does not need a fresh /bind after a normal restart.
  • If a window or topic has never been bound before, the first normal message should create a session automatically.
  • Topic-enabled groups should keep one separate session per topic instead of one shared group session.
  • If a bridge session already has an sdk_session_id, /sessions may merge that with matching local Codex history so the same underlying session is not listed twice.

When rebind is actually needed

  • Rebind only if the wrong session was bound on purpose or by mistake.
  • Rebind if bindings.json was deleted, reset, or replaced.
  • Rebind if you want that Telegram window/topic to point at a different local session.
  • Do not rebind just because the daemon was restarted.

/sessions and /bind

  • /sessions shows the current bound session first, then other recent bridge sessions, then eligible local Codex sessions that are not already represented.
  • /bind accepts the full session id or a unique prefix.
  • /bind can match a bridge session id, a stored sdk_session_id, or a discovered local Codex session id.
  • If a short prefix matches more than one session, the bridge should reject it as ambiguous instead of guessing.

Current expected behavior

  • Default runtime should be Codex.
  • Default mode should be code.
  • CTI_CLAUDE_EFFORT is an optional override that only matters when this install is switched to CTI_RUNTIME=claude as fallback. Only describe its configured value if it is actually set in config.env; do not claim the code hard-defaults it to high.
  • /sessions in Codex runtime should show local Codex history only.
  • Local Codex session titles should ignore slash commands and prefer normal spoken prompts.
  • The current session should always appear before other recent sessions in /sessions.
  • Recent sessions should then be ordered by latest activity first.
  • First normal message in a private chat, group, or topic should auto-create a session if none is bound yet.
  • Topic-enabled groups should keep one separate session per topic.

Key config fields to explain when asked

  • CTI_RUNTIME: choose codex, claude, or auto
  • CTI_DEFAULT_WORKDIR: default working directory for newly created bridge sessions
  • CTI_DEFAULT_MODEL: default model for newly created bridge sessions when one is set
  • CTI_DEFAULT_MODE: choose code, plan, or ask
  • CTI_CLAUDE_EFFORT: Claude thinking strength override when this install is run as a Claude fallback
  • CTI_CLAUDE_SETTING_SOURCES: Claude CLI setting sources for bridge sessions. Default is user,project,local, which loads global/project instructions and enabled plugins such as codex@openai-codex. Set to none only when SDK isolation is intentional. Because project/local settings can include hooks, MCP, permissions, and plugins, only /cwd into directories you trust.
  • CTI_CLAUDE_PLUGIN_DIRS: optional comma-separated local Claude plugin directories to load for bridge sessions.
  • CTI_CODEX_PASS_MODEL: whether the stored/default model is forwarded into Codex runtime calls
  • CTI_CODEX_SKIP_GIT_REPO_CHECK: whether Codex is allowed to run outside a detected git repo
  • CTI_CODEX_APPROVAL_POLICY, CTI_CODEX_SANDBOX_MODE, CTI_CODEX_MODEL_REASONING_EFFORT, CTI_CODEX_NETWORK_ACCESS_ENABLED, CTI_CODEX_ADDITIONAL_DIRECTORIES: Codex runtime overrides
  • CTI_TG_BOT_TOKEN: Telegram bot token
  • CTI_TG_ALLOWED_USERS: who may use the bot
  • CTI_TG_OWNER_USER_ID: the owner lock
  • CTI_TG_REQUIRE_PRIVATE_CHAT: whether groups/topics are allowed
  • CTI_AUTO_APPROVE: whether permission prompts are skipped

Response style

  • Keep instructions short and concrete.
  • Prefer direct commands over long explanations.
  • If the bridge is broken, run doctor before guessing.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.