untether AGENTS.md

A set of project instructions for Untether, a Telegram bridge that lets you control coding agents running on your computer from a phone or another device. It documents the system's parts, coding rules, and message-handling contract.

In plain words
What is it for?
Use it when working on Untether's runners, Telegram commands, progress tracking, JSONL messages, logging, linting, tests, or supported coding-agent integrations.
Why use it?
It gives contributors a shared explanation of how Telegram, agent runners, progress updates, and permissions fit together. This reduces guesswork when changing the codebase.

Instructions file for CodexOpenCode

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/littlebearapps/untether/agents-md
Clone the repo
git clone --depth 1 https://github.com/littlebearapps/untether

Made for: Codex, OpenCode.

Per session 709 This file is loaded in full into every session.
When invoked 709 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 $0.00709 $0.00709
Opus 5 $0.00354 $0.00354
Sonnet 5 $0.00142 $0.00142
Haiku 4.5 $0.00071 $0.00071

Measured 2d ago against content hash f75af8c61da7, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

untether AGENTS.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 2d 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.

AGENTS.md · 78 lines

How it starts

The opening of the file, as written. The whole thing — 78 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Untether — Agent Instructions

Telegram bridge for AI coding agents. Control Claude Code, Codex, OpenCode, Pi, Gemini CLI, and Amp from your phone or any device — agents run on your machine in the background while you're away from the terminal. Features interactive permissions, voice input, cost tracking, and live progress streaming.

Architecture

Telegram <-> TelegramPresenter <-> RunnerBridge <-> Runner (claude/codex/opencode/pi/gemini/amp)
                                       |
                                  ProgressTracker
  • Runners (src/untether/runners/) — engine-specific subprocess managers
  • RunnerBridge (src/untether/runner_bridge.py) — connects runners to Telegram presenter
  • TelegramPresenter (src/untether/telegram/bridge.py) — renders progress, inline keyboards, answers
  • Commands (src/untether/telegram/commands/) — command/callback handlers
  • Schemas (src/untether/schemas/) — msgspec structs for JSONL parsing

Key conventions

  • Python 3.12+, anyio for async, msgspec for JSONL, structlog for logging
  • Ruff for linting (uv run ruff check src/), pytest with 80% coverage threshold
  • Australian English in user-facing text (realise, colour, behaviour, licence)
  • Conventional commits: feat:, fix:, docs:, refactor:, test:
  • Feature branches: feature/*, fix/*, docs/*

Runner 3-event contract

Every run MUST emit exactly:

  1. StartedEvent — once, when session ID is known
  2. ActionEvent(s) — zero or more
  3. CompletedEvent — exactly once, always final

Use EventFactory for event construction. Never construct event dataclasses directly.

Telegram transport rules

  • ALL writes go through TelegramOutbox (never call Bot API directly)
  • Callback data max 64 bytes, format: prefix:action:id
  • Call answerCallbackQuery promptly to clear button spinners
  • Message limit 4096 chars; Untether splits long responses across multiple messages by default

Testing

uv run pytest                    # all tests
uv run pytest tests/test_*.py -x # specific file

Read the full file on GitHub · 78 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. 2d ago First seen · 78 lines · 709 tokens per session scan A f75af8c61da7

Subscribe to this mod's changes

untether AGENTS.md is an instructions file published in the GitHub repository littlebearapps/untether (66 stars, last pushed 3d ago), licensed MIT. It adds 709 tokens to every session, about $0.0035 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-30.