ion AGENTS.md

A project guide for ion, a software project with Go, TypeScript, and Swift parts. It records where major components live, which rules apply to each area, and the maximum file sizes allowed by automated checks.

In plain words
What is it for?
Use it when editing ion's engine, desktop app, relay, iOS app, or extension SDK. It also guides developers on splitting files that exceed the allowed size.
Why use it?
It helps developers find the right code and avoid changes that make the continuous integration checks fail. It also explains where the authoritative copy of the extension SDK is kept.

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

Made for: Codex, OpenCode.

Per session 21,531 This file is loaded in full into every session.
When invoked 21,531 The same file — it is already loaded in full.
Security scan C 1 finding. 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.21531 $0.21531
Opus 5 $0.10766 $0.10766
Sonnet 5 $0.04306 $0.04306
Haiku 4.5 $0.02153 $0.02153

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

Security

Grade C, and why

ion AGENTS.md scanned grade C with 1 finding 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

**To rebuild from scratch, run `make graph`.** It moves the existing graph aside, re-extracts, and restores the old one if extraction fails — no manual `rm -rf` needed, and a failed rebuild never leaves the clone with no
AGENTS.md · 895 lines

How it starts

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

Ion

Layout

Component Path Language
Engine engine/ Go
Desktop desktop/ TypeScript (Electron + React)
Relay relay/ Go
iOS ios/IonRemote/ Swift

Engine, desktop, and iOS each have their own AGENTS.md with subsystem-specific rules.

SDK edits have a source-of-truth split (repo source vs. build-overwritten installed copy) — moved to engine/AGENTS.md § "Extension SDK source location". Read it before changing any file under engine/extensions/sdk/ion-sdk/ or touching ~/.ion/extensions/sdk/.

File-size caps (CI hard-fails above)

Language Cap
TypeScript / TSX 600
Go (*.go) 800
Go (*_test.go) 1500
Swift 600

Override: // @file-size-exception: <reason> (# for shell/yaml/python) on line 1. Existing god files allowlisted in .file-size-allowlist.yml — do not extend them; extract new code to a new file.

When a file exceeds the cap

Split the file — find the natural seams (logical groupings, hook boundaries, helper clusters) and extract to a new file. Never remove or collapse comments, collapse whitespace, or shorten code to hit the line limit. Comments are load-bearing documentation. If the choice is between a well-commented file that is 10 lines over cap and a stripped file that is under cap, the stripped version is worse. Split instead.

Cohesion of change: a feature lives in one folder. Full reference: docs/architecture/file-organization.md.

Context files

  • AGENTS.md is canonical and committed.
  • CLAUDE.md is a local-only symlink to sibling AGENTS.md. Gitignored. Created by make bootstrap (or directly via make claude-symlinks).
  • Do not seed per-bounded-context AGENTS.md. Defer until traces show confusion.
  • Before any work that touches engine/, read docs/engine-grounding.md. It is the non-negotiable framing for engine changes — contract stability, snapshot semantics, engine-vs-harness boundaries, and the "modifying the engine is restricted" default. Engine work without this grounding is a defect.

Read the full file on GitHub · 895 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 · 895 lines · 21,531 tokens per session scan C 1726b6e357ab

Subscribe to this mod's changes

ion AGENTS.md is an instructions file published in the GitHub repository dsswift/ion (4 stars, last pushed 2d ago), licensed MIT. It adds 21,531 tokens to every session, about $0.1077 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.