Borrowing it
Nothing to install: this file belongs to NiuTrans/ToFu. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/NiuTrans/ToFu/main/AGENTS.mdgit clone --depth 1 https://github.com/NiuTrans/ToFuWrote 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.
[](https://agentmods.dev/instructions/niutrans/tofu/agents-md)<a href="https://agentmods.dev/instructions/niutrans/tofu/agents-md"><img src="https://agentmods.dev/badge/instructions/niutrans/tofu/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.
<a href="https://agentmods.dev/instructions/niutrans/tofu/agents-md"><img src="https://agentmods.dev/badge/instructions/niutrans/tofu/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.03682 | $0.03682 |
| Opus 5.5 | $0.01473 | $0.01473 |
| Sonnet 5.5 | $0.00736 | $0.00736 |
| Haiku 4.5 | $0.00368 | $0.00368 |
Grade A, and why
ToFu 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.
How it starts
The opening of the file, as written. The whole thing — 267 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Repository guidance
This file is the single source of repository-wide rules for every coding agent; read it completely before changing code. Keep task quality as the primary objective, then minimize model turns and raw context growth without weakening verification.
- Use isolated worktrees for sustained changes in a shared checkout. Never
reset, clean, or replace the shared tree to prepare a task. When other
(uncommitted or in-flight) work exists in the workspace, NEVER run
workspace-destroying commands such as
git checkout --,git checkout <branch>,git switch,git restore,git stash,git reset --hard, orgit clean: they can silently discard concurrent edits. Create each worktree withgit -C <shared-checkout> worktree add <path> -b <branch> <shared-current-branch>, never from the platform task workspace'sHEAD, which may be a task-input snapshot. Commits made in an isolated worktree never reach the current branch by themselves: the executing agent (the model — never the human user) must land them itself, immediately once the worktree work is finished and verified, not later and never as a hand-off: runpython3 scripts/git_land.py <branch>from the shared checkout. Unlikegit merge, it does not refuse when other writers have uncommitted edits in the same files; it carries those edits forward with a three-way merge, then removes the worktree and deletes the branch. Known generated outputs are rebuilt from merged sources; uncommitted sources and their outputs stay uncommitted. Do not reset generated files to unblock it. If it refuses, nothing was changed; follow its printed instruction (merge the current branch into the worktree branch to resolve a real conflict, or rerun after another writer's overlapping lines are committed). A task is not complete until its worktree commits are merged into the current branch. The merge commit's first parent is the pre-integration backup; the tool prints it, so record that SHA in the final answer instead of creatingbackup/*branches. - Start unfamiliar work with one bounded discovery batch over the owning
modules, contracts, tests, and current changes: use
rg/rg --filesand targeted ranges instead of repeatedly reading one file at a time. Do not dump the whole dirty worktree, full diffs, generated bundles, or large logs. On this host's FUSE mount, prefergit ls-filesandgit grepoverfind/grep -r: deepfindwalks intermittently return empty. - Use
docs/README.mdas the first-hop map to the owning module and contract;docs/catalog.jsonis the machine-readable documentation inventory. Change the authority first, then derive generated clients and bundles. Edit retained browser code infrontend/src/runtime/sections/, never the generatedapp-runtime.js. Edit styles infrontend/src/styles/{application,settings}/, never generated files understatic/. - Repo-root local trees that are untracked on purpose (gitignored):
promo/(marketing HTML/PNGs) andcodex/(a local vendored Codex CLI checkout used for comparison/evaluation). Neither is a runtime dependency of tracked code:lib/oauth/codex*andlib/skills/paths.pyspawn acodexbinary and scan.codex/skillsby name only. Do not track or delete these trees. - Generated Python modules follow the package-local
generated_*.py(or*_generated.pywhere the name predates the convention) prefix, never loose hand-mixed names in a package root. See CONTRIBUTING.md “Generated files”. - Batch independent read-only inspections with the live tools' documented batching or parallel-call interface. Tool schemas, not repository examples, define the available names, arguments, and execution semantics. Return only evidence needed for the next judgment.
- Background long commands with
run_command(background=true)when useful. The receipt and the tool description say whether the completion reaches you automatically: only a task that owns its conversation turn is woken with it. A swarm worker or other delegated run collects its handle withpollbefore it finishes; a leaf worker'spollandkillreach only thebg_*commands it started. A headless API request runs every command in the foreground. Usepollwith a bounded wait only when no useful work remains. Never busy-poll or infer success from an absent session. Keep user progress updates within 60 seconds. - Add or update the smallest executable specification for the behavior, then use a test ladder: smallest relevant tests first, then neighboring contracts, then broad gates once the worktree is stable. Do not rerun an unchanged suite. With concurrent writers, report that a full-suite result is a moving target.
- Update the owning current-state document with the change; delete superseded plans instead of leaving an archive beside authoritative documentation.
- Batch mechanical edits, but inspect and test semantic boundaries separately. Preserve fault injection, rollback, authority, and user-visible error behavior.
- Before finishing a tool-heavy task, run
python3 audit_codex_session.py <rollout.jsonl>when a session path is available. Treat fewer calls as a win only when the same correctness checks and required evidence still pass.
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.
- 2d ago Changed · +59 lines · +869 tokens per session 9b12d4349d29
- 17d ago Changed · +35 lines · +464 tokens per session 85f3de53e607
- 19d ago Changed · +17 lines · +273 tokens per session e5f2aff0c62d
- 28d ago Changed · +31 lines · +472 tokens per session b92b545c433a
- 2mo ago First seen · 125 lines · 1,604 tokens per session scan A bf8eb26216c8
ToFu AGENTS.md is an instructions file published in the GitHub repository NiuTrans/ToFu (151 stars, last pushed 2d ago), licensed MIT. It adds 3,682 tokens to every session, about $0.0147 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-09-07.
ToFu AGENTS.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| ToFu AGENTS.mdNiuTrans/ToFu | Instructions file | 151 | 2d ago | MIT | A | 3,682 | Codex, OpenCode |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 9,719 | GitHub Copilot |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 5,516 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 143k | today | MIT | A | 7,461 | Codex, OpenCode |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 149k | today | MIT | A | 4,680 | Codex, OpenCode |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 3,093 | GitHub Copilot |
| vscode model-prompts.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 2,022 | GitHub Copilot |