Borrowing it
Nothing to install: this file belongs to NobufumiMurata/telegram-copilot-bridge. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/NobufumiMurata/telegram-copilot-bridge/main/.github/copilot-instructions.mdgit clone --depth 1 https://github.com/NobufumiMurata/telegram-copilot-bridgeWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/instructions/nobufumimurata/telegram-copilot-bridge/copilot-instructions)<a href="https://agentmods.dev/instructions/nobufumimurata/telegram-copilot-bridge/copilot-instructions"><img src="https://agentmods.dev/badge/instructions/nobufumimurata/telegram-copilot-bridge/copilot-instructions.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.01413 | $0.01413 |
| Opus 5 | $0.00707 | $0.00707 |
| Sonnet 5 | $0.00283 | $0.00283 |
| Haiku 4.5 | $0.00141 | $0.00141 |
Grade A, and why
telegram-copilot-bridge copilot-instructions.md scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Runs shell commandslowCapability
Expected in a hook, worth knowing in a rule or an instructions file.
- Copilot CLI ACP: `copilot --acp --stdio` を subprocess.Popen で起動、NDJSON (1行1JSON) で通信 How it starts
The opening of the file, as written. The whole thing — 102 lines — stays where its author put it; the contents beside it link to each section on GitHub.
telegram-copilot-bridge
Telegram Bot API を使って Copilot CLI をリモート制御するブリッジ。 Telegram からプロンプト送信、セッション管理、ツール承認を行う。 公開リポジトリ — 機密情報は一切含まない。
プロジェクト構造
- Python 3.12+, src layout
- Telegram → Copilot CLI (ACP) ブリッジとして動作
- Telegram Bot API は
requestsで直接呼び出し (追加ライブラリ不要) - 認証情報は
.envファイル優先、フォールバックで環境変数・JSON 設定ファイル
ファイル構成
src/telegram_copilot_bridge/
__init__.py
__main__.py ← エントリポイント (argparse → hub.run_hub())
hub.py ← Hub メインロジック (Telegram polling → Copilot CLI)
telegram.py ← Telegram Bot API クライアント (バックグラウンドリスナー付き)
config.py ← 設定管理 (.env / 環境変数 / JSON)
copilot_bridge.py ← Copilot CLI ACP クライアント (NDJSON over stdio)
session_manager.py ← マルチセッション管理
bot_commander.py ← Telegram コマンドルーター
tests/
test_config.py
test_telegram.py
test_copilot_bridge.py
test_session_manager.py
test_bot_commander.py
セキュリティ要件
allowed_usersリストで送信元ユーザー ID を検証 (全受信メッセージ)- タイムアウト設定で自動シャットダウン (デフォルト: タイムアウトなし)
- 権限リクエストは 2 分でタイムアウト
- long-polling のオフセット管理 (古い更新の無視、
_drain_updatesで待機前にクリア) - シングルトンロック: TCP ポートバインドで多重起動を防止
設定
.env ファイルから自動読み込み。環境変数が優先。
| 環境変数 | 説明 | 必須 |
|---|---|---|
TELEGRAM_BOT_TOKEN |
Bot API トークン | ✅ |
TELEGRAM_CHAT_ID |
通知先チャット ID | ✅ |
TELEGRAM_ALLOWED_USERS |
カンマ区切りの許可ユーザー ID | 推奨 |
TELEGRAM_ENV_FILE |
.env ファイルパス (デフォルト: CWD の .env) |
❌ |
TELEGRAM_CONFIG_PATH |
JSON 設定ファイルパス (フォールバック) | ❌ |
COPILOT_MODEL |
デフォルト AI モデル | ❌ |
COPILOT_AUTOPILOT |
true で自動承認モード |
❌ |
COPILOT_DIRS_ROOT |
/dirs と /new のルートフォルダ |
❌ |
COPILOT_ALLOWED_DIRS |
カンマ区切りの許可ディレクトリ | ❌ |
COPILOT_ALLOWED_TOOLS |
カンマ区切りの許可ツール | ❌ |
起動方法
# .env ファイルを作成
cp .env.example .env
# 起動 (--hub フラグ不要、デフォルトで Hub モード)
python -m telegram_copilot_bridge
# オプション指定
python -m telegram_copilot_bridge --model claude-opus-4.6 --autopilot -v
Telegram コマンド
| コマンド | 動作 |
|---|---|
/new [dir] |
新しい Copilot セッション (COPILOT_DIRS_ROOT 設定時はフォルダ選択ボタン表示) |
/history [n] |
過去のセッション一覧 (デフォルト: 3件) |
/resume <id> |
過去のセッションを再開 |
/dirs [dir] |
ディレクトリ閲覧 |
/model [name] |
AI モデルの表示/変更 |
/mode |
autopilot/manual 切替 |
/list |
アクティブセッション一覧 |
/switch <id> |
セッション切替 |
/status |
セッション状態 |
/stop [id] |
セッション停止 |
/done |
全停止・終了 |
/help |
ヘルプ表示 |
| (テキスト) | アクティブセッションにプロンプト送信 |
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 7d ago First seen · 102 lines · 1,413 tokens per session scan A 2b5aa128d60b
telegram-copilot-bridge copilot-instructions.md is an instructions file published in the GitHub repository NobufumiMurata/telegram-copilot-bridge (0 stars, last pushed 4mo ago), licensed MIT. It adds 1,413 tokens to every session, about $0.0071 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other instructions, from other repositories
next.js AGENTS.md
AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.
codex AGENTS.md
AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.
vscode buildNext.instructions.md
Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).
langchain AGENTS.md
AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.
spec-kit AGENTS.md
AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.