一键导入
telegram-multi-session
Install, repair, and manage the multi-session Telegram channel server that allows switching between Claude Code sessions from Telegram
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Install, repair, and manage the multi-session Telegram channel server that allows switching between Claude Code sessions from Telegram
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | telegram-multi-session |
| description | Install, repair, and manage the multi-session Telegram channel server that allows switching between Claude Code sessions from Telegram |
| user_invocable | true |
| tools_required | ["Bash","Read","Edit","Write"] |
Manages the custom multi-session Telegram server that replaces the default plugin
server. This skill is self-contained: server.ts lives inside the skill
directory and is deployed by the install command.
Throughout this skill, <tg-state> refers to the Telegram state directory.
Resolve it at runtime:
TG_STATE="${GOVERNED_WORKFLOW_TELEGRAM_STATE:-$(python3 -c 'from core.paths import REPO_ROOT; print(REPO_ROOT)')/.local/channels/telegram}"
If GOVERNED_WORKFLOW_TELEGRAM_STATE is not set, the default is <repo>/.local/channels/telegram/.
The source server.ts lives inside this skill directory and is deployed to <tg-state>/server.ts.
Arguments passed: (check the args variable from the skill invocation)
Parse the arguments (space-separated). If empty or unrecognized, run status.
status<tg-state>/server.ts.mcp.json in the telegram plugin directory is patched (points to custom server vs default)<tg-state>/.env exists and contains BOT_TOKEN<tg-state>/sessions/, check PID liveness, list active sessionsinstall<tg-state>/ if it doesn't existserver.ts from the skill directory to <tg-state>/server.ts:
cp <skill-dir>/server.ts "$TG_STATE/server.ts"
cp ~/.claude/plugins/cache/claude-plugins-official/telegram/$(ls ~/.claude/plugins/cache/claude-plugins-official/telegram/)/package.json "$TG_STATE/"
cd "$TG_STATE" && bun install --no-summary
Note: Bun resolves node_modules relative to the file location, not --cwd. Installing dependencies here ensures the server can find grammy and @modelcontextprotocol/sdk.ls ~/.claude/plugins/cache/claude-plugins-official/telegram/
Use the latest version directory..mcp.json in that directory and patch it to point to the custom server:
{
"mcpServers": {
"telegram": {
"command": "bun",
"args": ["run", "/absolute/path/to/tg-state/server.ts"]
}
}
}
Use the actual expanded path to <tg-state>/server.ts (no ~ or env vars — bun requires an absolute literal path).<tg-state>/.env exists with a BOT_TOKEN line. If not, tell the user:
Bot token not found. Create
<tg-state>/.envwith:BOT_TOKEN=your_token_here
repairRe-patches .mcp.json after a plugin update overwrites it. Does NOT re-copy
server.ts unless --force is passed.
Steps:
--force flag is present, copy server.ts from skill directory to <tg-state>/server.ts<tg-state>/node_modules is missing, re-run bun install:
cd "$TG_STATE" && bun install --no-summary
.mcp.json)updateDeploys the latest server.ts from the skill directory, overwriting the currently
deployed one. Use this after editing the source file in the skill directory.
Steps:
<skill-dir>/server.ts to <tg-state>/server.tsuninstallRestore .mcp.json to the default plugin config. Does NOT delete the custom server.
Steps:
.mcp.json to the default:
{
"mcpServers": {
"telegram": {
"command": "bun",
"args": ["run", "--cwd", "${CLAUDE_PLUGIN_ROOT}", "--shell=bun", "--silent", "start"]
}
}
}
server.ts and .env are preserved.sessions<tg-state>/sessions/kill -0 <pid>)name <new-name>Set the session name for the CURRENT session by calling the set_session_name MCP tool.
Note: this only works if the multi-session server is running in this session.
The tool is available as mcp__plugin_telegram_telegram__set_session_name.
WORKSPACE environment variable overrides this
(WORKSPACE=work claude --channels ...). If neither is set, a random s-<4hex>
name is used. Names can also be changed at runtime via set_session_name or
/telegram-multi-session name <name>.[session-name] so the
user can tell which Claude Code session is responding./sessions to list active sessions, /switch <name> to
route incoming messages to a specific session.claim_channel, channel_status,
set_session_name.node_modules alongside it.
This is required because bun resolves modules relative to the file location, not
the working directory..mcp.json but not the deployed server.ts. Run
/telegram-multi-session repair after any plugin update.Cannot find module '@modelcontextprotocol/sdk/server/index.js': Dependencies are missing. Run:
cd "$TG_STATE" && bun install --no-summary
This happens if the install step was skipped or node_modules was deleted./telegram-multi-session update to deploy the fix. As a manual workaround, use
the claim_channel MCP tool from any live session, or restart a session.This skill is self-contained. server.ts is bundled inside the skill directory
so no external source is needed on a new device.
To set up on a new device:
<repo>/claude/skills/telegram-multi-session/plugin:telegram@claude-plugins-official)/telegram-multi-session install — this also installs dependencies automatically<tg-state>/.env with BOT_TOKEN=your_token_here if not transferredNote: node_modules/, bun.lock, and package.json in <tg-state>/ are NOT
transferred between devices — they are regenerated by the install command.
Orchestrates a governed multi-phase implementation workflow — assessment, research, planning, execution, review, and delivery — with backend-enforced phase gates, scope locking, and proof-driven research.
Guides the orchestrator through phases 1.0-1.4 of the governed workflow — assessment, research, research proving, impact analysis, and preparation review. Produces a thorough, structured foundation before planning begins.
Guides the orchestrator through Phase 2.0 (Planning) of the governed workflow — structuring the execution plan (with per-item scope), proposing acceptance criteria, and collaborating with the plan-advisor teammate.
Install, repair, and manage the multi-session Telegram channel server that allows switching between Claude Code sessions from Telegram
Initial workspace setup — configures modules and verification profiles based on user selections from the admin panel
Manage project rules (.claude/rules/*.md with glob-based auto-loading). Use when authoring, editing, or deleting rule files via MCP, or when explaining how rule loading works to the user.