telegram-claude-codex CLAUDE.md

telegram-claude-codex CLAUDE.md is an instructions file for coding agents from Mark-Life/telegram-claude-codex. It costs 1,719 tokens per session, scanned A, original, MIT.

Repository instructions for a Telegram bot that connects chat messages to coding-agent command-line tools such as Claude Code and OpenAI Codex. It runs an agent for a selected project and streams the agent's replies back into Telegram.

In plain words
What is it for?
Use it to develop, run, check, and extend the Telegram bot, including project selection, provider switching, stopping tasks, and status handling.
Why use it?
It gives developers a way to start and control coding-agent work through Telegram instead of using each command-line tool directly. The instructions also explain how the bot's commands, providers, and project state fit together.

Instructions file

Install

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.

agentmods
npx agentmods add instructions/mark-life/telegram-claude-codex/claude-md
Clone the repo
git clone --depth 1 https://github.com/Mark-Life/telegram-claude-codex

Wrote 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.

agentmods badge for telegram-claude-codex CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/mark-life/telegram-claude-codex/claude-md.svg)](https://agentmods.dev/instructions/mark-life/telegram-claude-codex/claude-md)
Your own site
<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>
Per session 1,719 This file is loaded in full into every session.
When invoked 1,719 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured 5d ago against content hash 72bfc684c6d7, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

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.

CLAUDE.md · 69 lines

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, optional PROJECTS_DIR), warns (non-blocking) if codex login status fails, 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: activeProject path, activeProvider, and per-provider sessions maps.
  • state.ts — Persisted bot state (.data/state.json). Holds activeProject, activeProvider, and provider-namespaced sessions. One-time migration of the old flat-session shape → {activeProvider:"claude", sessions:{claude:<old>, codex:{}}}.
  • telegram.ts — Consumes the normalized AgentEvent stream via sendMessageDraft (300ms interval) with fallback to progressive editMessageText. 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.tsAgentEvent (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"): drives query() from @anthropic-ai/claude-agent-sdk, mapping typed SDK messages onto AgentEvent (partial stream_event→text/thinking, complete assistant blocks→tool_use, .claude/plans//ExitPlanMode plan detection). No apiKey (subscription auth). Passes AppConfig.claudeSettings via options.settings. Caps: all true.
  • claude-settings.tsDEFAULT_CLAUDE_SETTINGS (hardened SDK Settings: denies interactive/harness tools + plan mode (Enter/ExitPlanMode), disables bundled skills/remote-control/artifacts, effortLevel:"high"; workflows left ON). Overridable at boot via CLAUDE_SETTINGS_JSON (JSON overlay; top-level keys replace, permissions merges one level deep).
  • claude-history.ts~/.claude/projects/... session reader (the SDK writes the same store; persistSession defaults on).
  • codex.ts — Codex AgentProvider: codex exec --json --dangerously-bypass-approvals-and-sandbox --skip-git-repo-check (resume via codex exec resume <id> …; cwd comes from the spawn). JSONL→AgentEvent parser, .codex/plans/plan_ready detection. 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-*.jsonl session reader; project filtering via recorded cwd (realpath-normalized).
  • executor-mcp.ts — Optional cloud Executor (executor.sh) MCP wiring. buildExecutorMcpServers({url, token}) → Claude-SDK mcpServers shape ({type:"http", url, headers}), undefined when EXECUTOR_MCP_URL/EXECUTOR_API_KEY are absent/blank. readExecutorMcpServers reads them off AppConfig; claude.ts passes the map straight to options.mcpServers, codex.ts feeds it through toCodexMcpServers (→ {url, http_headers, default_tools_approval_mode:"auto"}) into an mcp_servers config override. Tools surface as mcp__executor__execute / mcp__executor__resume.
  • registry.tsgetProvider(id), listProviders() (claude + codex registered).
  • index.ts — Public surface: runAgent(providerId, opts), stopAgent, hasActiveProcess, stopAll, listAllSessions(p), getSessionProject(p, id), clearSessionCache(p), getCapabilities(p).

Read the full file on GitHub · 69 lines

Changes

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.

  1. 5d ago First seen · 69 lines · 1,719 tokens per session scan A 72bfc684c6d7

Subscribe to this mod's changes

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.

Related

Other instructions, from other repositories

hivekeep CLAUDE.md

Claude Code instructions for MarlBurroW/hivekeep, covering hivekeep, documentation map, tech stack, key conventions and naming.

MarlBurroW/hivekeep · 4,507 tokens

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).

AstrBotDevs/AstrBot · 736 tokens

gini-agent AGENTS.md

AGENTS.md instructions for Open-Curiosity/gini-agent, covering gini agent instructions, shape, adrs, boundaries and branches.

Open-Curiosity/gini-agent · 3,639 tokens

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…

devoxx/DevoxxGenieIDEAPlugin · 257 tokens

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.

Rich627/whatsapp-claude-plugin · 33 tokens

project-careti CLAUDE.md

Instructions for caretive-ai/project-careti, covering project overview, important: 세션 시작 시 필수 작업, operations, desktop (tauri) and 빌드 순서.

caretive-ai/project-careti · 2,344 tokens