agentleFS
littlebearappslittlebearapps/untether/AGENTS.md

untether

AGENTS.md72 starsChanged 4 months agoMITView on GitHub

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

The file

We split this AGENTS.md into the rules it gives an agent

7 rules. About 0 are common, 3 are distinctive, and 4 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.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Every run MUST emit exactly:

    line 29
  2. Very specific:

    Use EventFactory for event construction.

    line 34
  3. Very specific:

    ALL writes go through TelegramOutbox (never call Bot API directly)

    line 38
  4. Very specific:

    Call answerCallbackQuery promptly to clear button spinners

    line 40
  5. Distinctive:

    Use stub subprocess runners with fake CLI scripts

    line 50
  6. Very specific:

    Use FakeTransport protocol doubles (not real Telegram clients)

    line 51
  7. Distinctive:

    Verify 3-event contract in all runner tests

    line 52

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

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
  • Use stub subprocess runners with fake CLI scripts
  • Use FakeTransport protocol doubles (not real Telegram clients)
  • Verify 3-event contract in all runner tests

Commands

CommandDescription
/cancelStop the running agent
/agentShow or set engine for this chat
/modelOverride the model for an engine
/planmodeToggle plan mode (on/auto/off)
/usageShow API costs for the current session
/statsPer-engine session statistics (today/week/all-time)
/authCodex device re-authentication
/exportExport session transcript
/browseBrowse project files
/configInteractive settings menu
/verboseToggle verbose progress mode
/restartGracefully restart Untether

Before committing

uv run ruff check src/
uv run pytest
uv lock --check

Download now (ZIP)

Does 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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.