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 skills add anhnguyen0905/codex-mcp --skill context-disciplinegit clone --depth 1 https://github.com/anhnguyen0905/codex-mcpWrote 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/anhnguyen0905/codex-mcp/context-discipline)<a href="https://agentmods.dev/skills/anhnguyen0905/codex-mcp/context-discipline"><img src="https://agentmods.dev/badge/skills/anhnguyen0905/codex-mcp/context-discipline/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/skills/anhnguyen0905/codex-mcp/context-discipline"><img src="https://agentmods.dev/badge/skills/anhnguyen0905/codex-mcp/context-discipline.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.00031 | $0.01023 |
| Opus 5 | $0.00015 | $0.00511 |
| Sonnet 5 | $0.00006 | $0.00205 |
| Haiku 4.5 | $0.00003 | $0.00102 |
Grade A, and why
context-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 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.
How it starts
The opening of the file, as written. The whole thing — 89 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Context Discipline
Why
Protect the orchestrator's working context across long backlogs. Repeated exploration, large diffs, and verbose logs crowd out current-task evidence. Keep bulk evidence outside the orchestrator and bring back only anchored conclusions. Write durable state to disk so a fresh session can resume without hidden context.
Recitation
At every phase boundary and immediately before each codex_execute, re-state all three in one
concise line: the current phase, the current task ID + title, and the next pending gate. Recite the
run position from current durable state; do not re-read control files solely for this recitation.
No-raw-read rules (orchestrator)
- For a diff over 400 lines, delegate a conformance summary to a subagent, then directly read only targeted critical hunks.
- For test or build logs, run them via a script and inspect only tail output or grep matches. Delegate full-log analysis to a subagent.
- During Phase 2 exploration, use Explore subagents. Require conclusions with paths and line anchors; never bulk-dump files into the orchestrator.
Tiered read-back
- Have the orchestrator and Codex read budgeted derived slices instead of whole control files:
.codex-flow/CONTEXT-T<n>.md(≤ 4000 estimated tokens using the chars/4 heuristic) for each task and.codex-flow/RESUME.md(≤ 8000 estimated tokens using the chars/4 heuristic) on resume. - Keep full
.codex-flow/PLAN.mdas the durable source of truth on disk. Read it in full only to resolve a disputed finding, follow a slice's omitted-pointer line to a needed section, or as the standalone fallback when the slice helper is unavailable. - Treat derived slice files as generated views. Regenerate them; never hand-edit them.
- Check the generation anchor recorded in each slice header. Re-check every
[verify]-stamped block against the current code before relying on it.
Safe compaction points
- Phase 2 boundary: wait until the plan is approved, PLAN.md and planning.md are written, and the AGENTS.md guidance commit is complete. TASKS.md does not exist yet and is not required.
- Sequential task boundary: wait until the task passes review and its Decision log schema block is on disk. If checkpoint commits are enabled, wait for that commit too.
- Parallel wave boundary: wait until every task commit is merged, the integration review passes, and the coordinator appends the per-task Decision log schema blocks.
- At an allowed boundary, verify the required durable state is on disk. Tell the user this is a
safe compaction point and suggest running
/compact; the orchestrator cannot run that client command. With state on disk, an auto-compaction landing at or after the boundary is lossless. - NEVER compact mid-task.
- Phase 5 step 0 re-reads the task's generated context slice and TASKS.md entry from disk after compaction; read full PLAN.md only under the Tiered read-back rules.
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.
- 9d ago First seen · 89 lines · 31 tokens per session scan A 6ab256df778e
context-discipline is a skill published in the GitHub repository anhnguyen0905/codex-mcp (3 stars, last pushed yesterday), licensed MIT. It adds 31 tokens to every session and 1,023 once invoked, about $0.0002 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
media-ingest
Ingest video, audio, PDF, book, screenshot, and GitHub repo content into the brain. Multi-format handling with entity extraction and backlink propagation. Covers video-ingest, youtube-ingest, and book-ingest subtypes.
mem0-oss-to-platform
Plan and then execute a migration of a project from the mem0 open-source / self-hosted SDK (the local Memory class) to the mem0 Platform / hosted / managed SDK (the MemoryClient class). Use this whenever a developer wants to move, switch, or migrate their mem0 usage off OSS/self-hosted to the hosted API — e.g.…
Cortex
Operate Cortex, the LifeOS memory system — the typed Knowledge Archive (People, Companies, Ideas, Research with typed related: links) plus recall of prior work sessions, ISAs, and conversations. Search, add, harvest, develop, ingest, distill, graph-navigate, recall. USE WHEN cortex, knowledge, knowledge base, search…
memory
Use when the user asks to remember, recall, forget, update, search, or inspect durable OpenSquilla memory, including profile facts in USER.md and long-term notes in MEMORY.md or memory//.md.
ha-data-stores
Map of Hope Agent's local data stores and safe read-only query workflow. Use when the user asks where Hope Agent stores data, wants to inspect sessions/messages/memory/logs/background jobs/knowledge indexes/settings, asks the model to query local app data, or debugging requires checking persisted state. Trigger…
establishing-project-context
Use when the user asks to establish shared project language, or project work exposes a conflicting, renamed, or deprecated domain term that needs active semantic modeling. Routine small tasks stay on the fast path.