untether
AGENTS.md72 starsChanged 37 days agoMITView on GitHub
Telegram bridge for AI coding agents. Control Claude Code, Codex, OpenCode, and Pi from your phone (Gemini CLI and Amp are deprecated and unsupported — when a sweep breaks them, xfail/skip the test rather than fixing the runner) 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. Engine parity roadmap: v0.36.1 Antigravity (#558), v0.36.2 Codex app-server (#960–#968), v0.36.3 OpenCode ACP…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,542 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository11 other files it gives its agents.
- .codex/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- llms-full.txtllms.txt
- llms.txtllms.txt
- claude-stream-jsonSkill
- codex-opencode-piSkill
- jsonl-subprocess-runnerSkill
- release-coordinationSkill
- telegram-bot-apiSkill
- untether-architectureSkill
The file
We split this AGENTS.md into the rules it gives an agent
10 rules. About 0 are common, 3 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 33
Every run MUST emit exactly:
- Very specific: line 40
Use EventFactory for event construction.
- Very specific: line 46
ALL writes go through TelegramOutbox (never call Bot API directly)
- Very specific: line 48
Call answerCallbackQuery promptly to clear button spinners
- Distinctive: line 58
Use stub subprocess runners with fake CLI scripts
- Very specific: line 59
Use FakeTransport protocol doubles (not real Telegram clients)
- Distinctive: line 60
Verify 3-event contract in all runner tests
- Very specific: line 83
Never push to master/main, create v* tags or create GitHub releases — merging the dev→master PR is the release, and only Nathan approves it.
- Very specific: line 84
Test local changes on the dev bot (untether-dev.service, @untether_dev_bot), never staging (untether.service, which runs a PyPI/TestPyPI …
- Very specific: line 85
Every bug fix or significant change needs a GitHub issue, linked from CHANGELOG.md under the current ## vX.Y.Z (unreleased) heading.
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Untether — Agent Instructions
Telegram bridge for AI coding agents. Control Claude Code, Codex, OpenCode, and Pi from your phone (Gemini CLI and Amp are deprecated and unsupported — when a sweep breaks them, xfail/skip the test rather than fixing the runner) 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.
Engine parity roadmap: v0.36.1 Antigravity (#558), v0.36.2 Codex app-server (#960–#968), v0.36.3 OpenCode ACP (#969–#974).
OpenCode support means the 1.x CLI (npm opencode-ai); 2.x (@opencode/cli) is refused before spawning (#970).
Website: https://untether.cc · Help centre (user docs, synced flat from docs/ on master): https://littlebearapps.com/help/untether/<file-stem>/
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/ tests/), pytest with 80% coverage threshold - Australian English in user-facing text (realise, colour, behaviour, licence)
- Conventional commits:
feat:,fix:,docs:,refactor:,test:,chore: - Feature branches:
feature/*,fix/*,docs/*
Runner 3-event contract
Every run MUST emit exactly:
StartedEvent— once, when session ID is knownActionEvent(s)— zero or moreCompletedEvent— exactly once, always final
Exception (Claude live sessions, #776): after CompletedEvent a runner that keeps its process live may emit later turns as TurnEvent(started) → ActionEvent* → TurnEvent(completed) segments. Never a second CompletedEvent. See .claude/rules/runner-development.md.
Use EventFactory for event construction. Never construct event dataclasses directly.
Runner instances are shared across chats: bridge code reads the per-run RunStreamHandle (filled by publish_run_stream()), never runner.current_stream / runner.last_pid, which are diagnostics only (#510).
Telegram transport rules
- ALL writes go through
TelegramOutbox(never call Bot API directly) - Callback data max 64 bytes, format:
prefix:action:id - Call
answerCallbackQuerypromptly 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- Use stub subprocess runners with fake CLI scripts
- Use
FakeTransportprotocol doubles (not real Telegram clients) - Verify 3-event contract in all runner tests
Commands
| Command | Description |
/cancel | Stop the running agent (an idle live session is closed; pending /at runs and loops are dropped too) |
/agent | Show or set engine for this chat |
/model | Override the model for an engine |
/planmode | Set Claude Code permission mode (on/plan-auto/auto/off) |
/usage | Claude subscription quota; token totals for Codex/OpenCode |
/stats | Per-engine session statistics (today/week/all-time) |
/auth | Codex device re-authentication |
/export | Export session transcript |
/browse | Browse project files |
/config | Interactive settings menu |
/steer / /queue | Claude: steer a follow-up into the running session, or queue it (bare form sets the chat/topic default) |
/verbose | Toggle verbose progress mode |
/restart | Gracefully restart Untether |
Branches, releases and test bots (never break these)
- Work on
feature/*/fix/*/docs/*branches → PR todev(publishes an rc to TestPyPI).masteralways matches the latest PyPI release. - Never push to
master/main, createv*tags or create GitHub releases — merging thedev→masterPR is the release, and only Nathan approves it. - Test local changes on the dev bot (
untether-dev.service,@untether_dev_bot), never staging (untether.service, which runs a PyPI/TestPyPI wheel). Never restart Untether from inside an active Untether session — config hot-reloads, and the restart drain drops the final message. - Every bug fix or significant change needs a GitHub issue, linked from
CHANGELOG.mdunder the current## vX.Y.Z (unreleased)heading.
Before committing
uv run ruff format --check src/ tests/
uv run ruff check src/ tests/
uv run pytest
uv lock --checkDoes it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

