Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add instructions/mark-life/telegram-claude-codex/claude-mdgit clone --depth 1 https://github.com/Mark-Life/telegram-claude-codexWrote 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/mark-life/telegram-claude-codex/claude-md)<a href="https://agentmods.dev/instructions/mark-life/telegram-claude-codex/claude-md"><img src="https://agentmods.dev/badge/instructions/mark-life/telegram-claude-codex/claude-md.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.01719 | $0.01719 |
| Opus 5 | $0.00860 | $0.00860 |
| Sonnet 5 | $0.00344 | $0.00344 |
| Haiku 4.5 | $0.00172 | $0.00172 |
Grade A, and why
telegram-claude-codex CLAUDE.md scanned grade A with 0 findings 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 5d 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.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 69 lines — stays where its author put it; the contents beside it link to each section on GitHub.
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Commands
bun install # install dependencies
bun run src/index.ts # start bot
bun --watch run src/index.ts # dev mode (auto-reload on changes)
bun run lint # check lint/format (ultracite/biome)
bun run fix # auto-fix lint/format issues
Architecture
Telegram bot that bridges coding-agent CLIs (Claude Code + OpenAI Codex) with Telegram. Spawns the active provider's CLI as a child process, streams its JSON output, normalizes it to a provider-agnostic event model, and progressively edits Telegram messages with the response. The active provider is swappable at runtime via /provider.
Module Overview (src/)
- index.ts — Entry point. Validates env vars (
BOT_TOKEN,ALLOWED_USER_ID,GROQ_API_KEY, optionalPROJECTS_DIR), warns (non-blocking) ifcodex login statusfails, registers commands (incl./provider), starts bot. - bot.ts — Grammy bot setup, command handlers (
/projects,/provider,/stop,/status,/new, …), message routing, capability gating. Maintains per-user state:activeProjectpath,activeProvider, and per-providersessionsmaps. - state.ts — Persisted bot state (
.data/state.json). HoldsactiveProject,activeProvider, and provider-namespacedsessions. One-time migration of the old flat-session shape →{activeProvider:"claude", sessions:{claude:<old>, codex:{}}}. - telegram.ts — Consumes the normalized
AgentEventstream viasendMessageDraft(300ms interval) with fallback to progressiveeditMessageText. Auto-splits at 4000 chars. Converts Markdown → Telegram HTML. Falls back to plain text on parse failure. Footer/thinking/subagent/plan UI gated on the active provider's capabilities. - transcribe.ts — Voice message transcription via Groq Whisper (
whisper-large-v3-turbo).
agent/ — provider abstraction layer
- types.ts —
AgentEvent(normalized event model),ProviderId("claude"|"codex"),RunOptions,ProviderCapabilities({cost, planMode, subagents, thinking}),SessionInfo,ProviderSpec,AgentProvider. - runner.ts — Generic process lifecycle: global one-process-per-user (keyed by userId, across providers), AbortController, 10-min timeout, stdout line-buffering, stderr capture. AsyncGenerator yielding
AgentEvent. - claude.ts — Claude
AgentProvider(kind:"sdk"): drivesquery()from@anthropic-ai/claude-agent-sdk, mapping typed SDK messages ontoAgentEvent(partialstream_event→text/thinking, complete assistant blocks→tool_use,.claude/plans//ExitPlanModeplan detection). No apiKey (subscription auth). PassesAppConfig.claudeSettingsviaoptions.settings. Caps: all true. - claude-settings.ts —
DEFAULT_CLAUDE_SETTINGS(hardened SDKSettings: denies interactive/harness tools + plan mode (Enter/ExitPlanMode), disables bundled skills/remote-control/artifacts,effortLevel:"high"; workflows left ON). Overridable at boot viaCLAUDE_SETTINGS_JSON(JSON overlay; top-level keys replace,permissionsmerges one level deep). - claude-history.ts —
~/.claude/projects/...session reader (the SDK writes the same store;persistSessiondefaults on). - codex.ts — Codex
AgentProvider:codex exec --json --dangerously-bypass-approvals-and-sandbox --skip-git-repo-check(resume viacodex exec resume <id> …; cwd comes from the spawn). JSONL→AgentEventparser,.codex/plans/→plan_readydetection. File-send + plan-convention instructions injected via first-turn prompt prefix (Codex has no--append-system-prompt). Caps:{planMode:true, thinking:true, cost:false, subagents:false}. - codex-history.ts —
~/.codex/sessions/YYYY/MM/DD/rollout-*.jsonlsession reader; project filtering via recorded cwd (realpath-normalized). - executor-mcp.ts — Optional cloud Executor (executor.sh) MCP wiring.
buildExecutorMcpServers({url, token})→ Claude-SDKmcpServersshape ({type:"http", url, headers}), undefined whenEXECUTOR_MCP_URL/EXECUTOR_API_KEYare absent/blank.readExecutorMcpServersreads them offAppConfig; claude.ts passes the map straight tooptions.mcpServers, codex.ts feeds it throughtoCodexMcpServers(→{url, http_headers, default_tools_approval_mode:"auto"}) into anmcp_serversconfig override. Tools surface asmcp__executor__execute/mcp__executor__resume. - registry.ts —
getProvider(id),listProviders()(claude + codex registered). - index.ts — Public surface:
runAgent(providerId, opts),stopAgent,hasActiveProcess,stopAll,listAllSessions(p),getSessionProject(p, id),clearSessionCache(p),getCapabilities(p).
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.
- 5d ago First seen · 69 lines · 1,719 tokens per session scan A 72bfc684c6d7
telegram-claude-codex CLAUDE.md is an instructions file published in the GitHub repository Mark-Life/telegram-claude-codex (9 stars, last pushed 27d ago), licensed MIT. It adds 1,719 tokens to every session, about $0.0086 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other instructions, from other repositories
hivekeep CLAUDE.md
Claude Code instructions for MarlBurroW/hivekeep, covering hivekeep, documentation map, tech stack, key conventions and naming.
AstrBot copilot-instructions.md
Copilot instructions for AstrBotDevs/AstrBot, covering astrbot development instructions, working effectively, bootstrap and install dependencies, running the application and dashboard build (vue.js/node.js).
gini-agent AGENTS.md
AGENTS.md instructions for Open-Curiosity/gini-agent, covering gini agent instructions, shape, adrs, boundaries and branches.
DevoxxGenieIDEAPlugin GEMINI.md
Gemini CLI instructions for devoxx/DevoxxGenieIDEAPlugin, a project described as: DevoxxGenie is an agentic plugin for IntelliJ IDEA that uses local LLM's (Ollama, LMStudio, GPT4All, Jan and Llama.cpp) and Cloud based LLMs to help review, test, explain your project code. Latest version now also supports Spec Driven…
whatsapp-claude-plugin CLAUDE.md
Claude Code instructions for Rich627/whatsapp-claude-plugin, a project described as: Claude Code WhatsApp channel plugin — run AI directly from WhatsApp, voice transcription, remote tool approval, access control. No API keys, no Docker, just a linked device.
project-careti CLAUDE.md
Instructions for caretive-ai/project-careti, covering project overview, important: 세션 시작 시 필수 작업, operations, desktop (tauri) and 빌드 순서.