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.
npx agentmods add skills/perhapsspy/project-legibility/codex-token-disciplinenpx skills add perhapsspy/project-legibility --skill codex-token-disciplinegit clone --depth 1 https://github.com/perhapsspy/project-legibilityWrote 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/skills/perhapsspy/project-legibility/codex-token-discipline)<a href="https://agentmods.dev/skills/perhapsspy/project-legibility/codex-token-discipline"><img src="https://agentmods.dev/badge/skills/perhapsspy/project-legibility/codex-token-discipline.svg" alt="Measured on agentmods" 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 | $0.00069 | $0.01241 |
| Opus 5 | $0.00034 | $0.00620 |
| Sonnet 5 | $0.00014 | $0.00248 |
| Haiku 4.5 | $0.00007 | $0.00124 |
Grade A, and why
codex-token-discipline 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 4d 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 — 103 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Codex Token Discipline
Purpose
Reduce total root-and-child cost without weakening task success, required evidence, or the requested deliverable.
Keep reads, tool output, retries, and delegation bounded. Preserve reusable evidence and escalate only the unresolved part.
Operating Frame
Use only what changes behavior:
- Name the current phase: explore, plan, implement, verify, publish, or handoff.
- Define the next evidence needed before reading broadly.
- Before a potentially noisy tool call, define the smallest useful return shape and output budget.
- Delegate noisy side work only when it can return distilled findings with evidence.
- At phase boundaries, save compact resume state and hand session-continuation decisions to the owning director when one exists.
Skip the ritual for small edits, direct answers, and simple commands.
Preflight Output Contract
Prevent excess output before it enters the main context; do not rely on summarizing it afterward.
- For any unpredictable or batch command, name the required return shape first: status, count, paths, selected fields, or first actionable failure.
- Set a finite return budget on the tool call. For exec-family calls, default to an explicit budget at or below 2,000 tokens unless named evidence requires more; do not wait for a single large-output threshold.
- Filter, aggregate, or select at the source. For tests and builds, return the exit status, first actionable failure, and command before requesting more detail.
- When full output is useful for later inspection, write it to a task-local or temporary artifact and return only its path, size, compact summary, and first actionable failure. Inspect bounded slices from the artifact as needed.
- Do not create an artifact for disposable output that can be reduced at the source.
Summary-First Reads
Start narrow; widen only when it changes the next decision.
- Search with
rgor file lists before opening files. - Prefer
git diff --stat,git diff --name-only, focusedgit diff -- <path>, and targetedsed -nranges before full diffs. - For logs and command output, use
tail,head,jq, counts, filters, or error searches before full transcripts. - Treat every returned tool result as future input cost. Prefer counts, paths, summaries, or selected evidence before full output.
- After a failure, widen from the saved artifact or rerun only the smallest failing scope; avoid repeated full transcripts in the main thread.
What ships with it
3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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.
- 4d ago First seen · 103 lines · 69 tokens per session scan A 62c1358711bf
codex-token-discipline is a skill published in the GitHub repository perhapsspy/project-legibility (5 stars, last pushed today), licensed MIT. It adds 69 tokens to every session and 1,241 once invoked, about $0.0003 per session on Opus 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-31.
Other skills, from other repositories
qa
Browser-based QA verification. Launches a real browser, navigates the app, clicks buttons, fills forms, and tests user flows. Works as a standalone skill or as a phase end condition in campaigns. Requires Playwright (optional dependency, graceful skip if not installed).
live-preview
Mid-build visual verification loop. Takes screenshots of components during construction, not just after. Catches visual regressions and invisible features before they compound. Requires Playwright or similar screenshot tool.
author
Write a new doc in the right place with the right name. Use when asked to "write a doc", "where should this doc go", "add an ADR", "document this decision", "new spec", or "new feature plan".
router
Find the right doc before reading code. Use when asked "where is X documented", "is there a spec/ADR for X", "what's the roadmap", "open bugs", "read the docs about X", or "share the docs".
changelog
Record shipped work in the monthly changelog (append-only). Use when something ships or when asked "what changed", "add to changelog", "release notes", or "what shipped this month".
init
Set up docflow in a repo with no docs yet: scaffold the docs tree, write docflow.json, add agent guidance. Use when asked to "set up docflow", "initialize docs", "scaffold docs", or "make this repo use docflow".