ton-rs: Instructions file for Codex

AGENTS.md

ton-rs AGENTS.md is an instructions file for Codex, OpenCode from ston-fi/ton-rs. It costs 1,926 tokens per session, scanned A, original, Apache-2.0.

A development guide for ton-rs, a group of public Rust libraries for building software around TON, a blockchain network. It explains where different code belongs and how public interfaces and serialized data should be maintained.

In plain words
What is it for?
Use it when adding or reviewing TON types, wallets, contracts, providers, macros, or other Rust library changes. It helps decide whether code belongs in the core library, the main library, or the macro package.
Why use it?
It gives agents rules for changing shared Rust libraries without breaking their public interfaces or TON’s fixed data formats. It also directs review of changes involving APIs, dependencies, features, serialization, documentation, or releases.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions CLAUDE.md; mentions AGENTS.md.

This is ston-fi/ton-rs's own configuration. It tells Codex and OpenCode how to work on ton-rs itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything ton-rs configures →

Reuse

Borrowing it

Nothing to install: this file belongs to ston-fi/ton-rs. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/ston-fi/ton-rs/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/ston-fi/ton-rs

Made for: Codex, OpenCode.

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 ton-rs AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/ston-fi/ton-rs/agents-md/github.svg)](https://agentmods.dev/instructions/ston-fi/ton-rs/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/ston-fi/ton-rs/agents-md"><img src="https://agentmods.dev/badge/instructions/ston-fi/ton-rs/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for ton-rs AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/ston-fi/ton-rs/agents-md"><img src="https://agentmods.dev/badge/instructions/ston-fi/ton-rs/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,926 This file is loaded in full into every session.
When invoked 1,926 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.01926 $0.01926
Opus 5.5 $0.00770 $0.00770
Sonnet 5.5 $0.00385 $0.00385
Haiku 4.5 $0.00193 $0.00193

Measured 9d ago against content hash 3f84ad59b9e1, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

ton-rs 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 9d 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 · 157 lines

How it starts

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

ton-rs agent guide

Using ton-rs from another project

Before writing a custom codec, adapter, get-method wrapper, or wallet helper, check the capability map below and read the relevant crate guide. Prefer the existing implementation when its wire format and behavior match the task; explain the missing capability before introducing a replacement.

Use the dependency version/revision resolved by the consuming project's Cargo.lock, not an arbitrary checkout or the latest online documentation. cargo metadata --format-version 1 in that project exposes each resolved package's manifest_path; read AGENTS.md beside the relevant manifest and inspect its src/ and tests. Crate guides are included in published packages. Paths in each crate guide are relative to that crate unless stated otherwise.

Do not assume dependency instructions are loaded automatically. In the consuming project's agent instructions, explicitly ask agents to read the resolved ton_core, ton_macros, and (when used) ton/ton_ledger guides. This repository's CLAUDE.md imports this guide so the shared entry point stays in one place. Repository maintenance commands below apply when changing ton-rs; downstream work should run the consuming project's checks and deterministic wire fixtures.

Task Reuse first Details
Typed cells, opcodes, fixed-width fields, strict cell parsing TLB derive; prefix, bits_len, adapter, ensure_empty Macro options
Required internal or nullable Tolk addresses InternalAddress, NullableAddress; raw MsgAddress for other wire variants Core recipes
Maybe, referenced or either payloads, coin/variable lengths Option<T>, TLBRef, TLBEither, TLBEitherRef, TLBCoins, VarLenBits/VarLenBytes Core recipes
TON dictionaries in Rust maps TLBHashMapE/TLBHashMap with existing key/value adapters Dictionary recipe
Typed TVM results and get methods FromTVMStack, ton_methods, ton_contract! Macro options, contract helpers
Standard messages, Jetton/NFT/SBT contracts, metadata block_tlb, contracts::tep, SnakeData, MetaLoader ton guide
Provider integration without native tonlib StateProvider, EmulationProvider, ContractClient::builder(...) ton guide
Software or hardware wallet signing TonWallet or TonLedgerWallet::builder(...) Wallet guide, Ledger guide
JSON address/hash encodings ton_core::serde field adapters, behind serde Core recipes

Read the full file on GitHub · 157 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. 9d ago Changed · +5 lines · +71 tokens per session 3f84ad59b9e1
  2. 10d ago Changed · +33 lines · +702 tokens per session f1577e6c22a5
  3. 1mo ago Changed · +27 lines · +389 tokens per session 90ce99173f56
  4. 2mo ago First seen · 92 lines · 764 tokens per session scan A 83cf69ba1090

Subscribe to this mod's changes

ton-rs AGENTS.md is an instructions file published in the GitHub repository ston-fi/ton-rs (175 stars, last pushed 8d ago), licensed Apache-2.0. It adds 1,926 tokens to every session, about $0.0077 per session on Opus 5.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.

Related

ton-rs AGENTS.md compared with instructions from other repositories

ton-rs AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
ton-rs AGENTS.mdston-fi/ton-rsInstructions file1758d agoApache-2.0A1,926Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143kyesterdayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode