Optimize Codex Usage
Reduce total Codex consumption while preserving the requested outcome,
authorization boundaries, safety checks, and completion evidence.
Load Policy
- For a conceptual explanation or a narrow current-product fact, use this file
and current official OpenAI documentation only. Do not inspect a repository
or load the audit reference unless the request needs it.
- For an audit, design change, or implementation involving Skills,
AGENTS.md, MCP, context, history, tools, validation, or reporting, read
references/context-audit.md before changing files.
- Add another Axiom skill only when the requested implementation crosses into
that skill's distinct owner: an AGENTS instruction system, traceable Git
state, or a persistent system change. Usage analysis alone needs only this
skill.
Measurement Boundary
- Use exact token, credit, cache, reasoning, or tool metrics only when the host
exposes them for the scoped run. Axiom cannot recover hidden usage data.
- Otherwise label UTF-8 bytes, words, lines, reference counts, tool calls, and
route-chain sizes as proxies or estimates.
- Do not claim a percentage saving without a repeatable before/after workload
and equivalent quality acceptance.
- Fetch current official OpenAI documentation only when a volatile Codex fact
affects the decision. Never place current prices, plan limits, or model
quotas in always-loaded instructions.
Non-Negotiable Boundaries
- Define the required quality, safety, authorization, rollback, and evidence
bar before optimizing. Lower resource use counts only when that bar still
passes.
- Do not remove required tests, rollback checks, secret handling, destructive
safeguards, or outcome-owning evidence to reduce context or calls.
- Do not automatically change the model, reasoning effort, execution mode, or
host configuration. Offer a bounded comparison only when the user requests
usage optimization and the host supports the choice.
- Preserve unrelated work. Do not reset, stash, clean, stage, commit, push,
deploy, install tools, change user Skills, or mutate remote state without
separate authorization.
- Do not add telemetry, background work, automatic updates, or network checks.
Optimization Order
- Bound the target workflows and representative requests.
- Measure always-loaded and common-path context before rare worst cases.
- Inventory metadata and route edges before reading bodies.
- Read only candidate owners, then remove duplication or route detail behind
one directly discoverable on-demand reference.
- Reduce repeated tool calls, checks, updates, and reports only where the
next decision does not depend on each intermediate result.
- Re-run the same routing, authorization, safety, and outcome scenarios.
- Stop when further reduction would trade away required quality or evidence.
Prefer precise trigger descriptions, one canonical owner per rule,
phase-specific references, bounded retries, conclusive stopping conditions,
and concise evidence-led reporting. Keep ordinary no-match work outside Axiom.
Report
Lead with the implemented or recommended outcome. Include affected files or
surfaces, comparable before/after measurements, validation results, and real
unverified gaps. Omit repeated rationale, routine successful details, and exact
usage claims the host did not expose.
1---2name: optimize-codex-usage3description: Reduce or diagnose Codex token, credit, and context consumption without weakening task quality or safety. Use only when the user explicitly asks to save Codex credits or tokens, optimize Skills, AGENTS.md, MCP, or context loading, explain unusually high Codex usage, or design a lower-consumption workflow. Do not use for ordinary coding, software performance work, or generic cost questions.4---56# Optimize Codex Usage78Reduce total Codex consumption while preserving the requested outcome,9authorization boundaries, safety checks, and completion evidence.1011## Load Policy1213- For a conceptual explanation or a narrow current-product fact, use this file14 and current official OpenAI documentation only. Do not inspect a repository15 or load the audit reference unless the request needs it.16- For an audit, design change, or implementation involving Skills,17 `AGENTS.md`, MCP, context, history, tools, validation, or reporting, read18 `references/context-audit.md` before changing files.19- Add another Axiom skill only when the requested implementation crosses into20 that skill's distinct owner: an AGENTS instruction system, traceable Git21 state, or a persistent system change. Usage analysis alone needs only this22 skill.2324## Measurement Boundary2526- Use exact token, credit, cache, reasoning, or tool metrics only when the host27 exposes them for the scoped run. Axiom cannot recover hidden usage data.28- Otherwise label UTF-8 bytes, words, lines, reference counts, tool calls, and29 route-chain sizes as proxies or estimates.30- Do not claim a percentage saving without a repeatable before/after workload31 and equivalent quality acceptance.32- Fetch current official OpenAI documentation only when a volatile Codex fact33 affects the decision. Never place current prices, plan limits, or model34 quotas in always-loaded instructions.3536## Non-Negotiable Boundaries3738- Define the required quality, safety, authorization, rollback, and evidence39 bar before optimizing. Lower resource use counts only when that bar still40 passes.41- Do not remove required tests, rollback checks, secret handling, destructive42 safeguards, or outcome-owning evidence to reduce context or calls.43- Do not automatically change the model, reasoning effort, execution mode, or44 host configuration. Offer a bounded comparison only when the user requests45 usage optimization and the host supports the choice.46- Preserve unrelated work. Do not reset, stash, clean, stage, commit, push,47 deploy, install tools, change user Skills, or mutate remote state without48 separate authorization.49- Do not add telemetry, background work, automatic updates, or network checks.5051## Optimization Order52531. Bound the target workflows and representative requests.542. Measure always-loaded and common-path context before rare worst cases.553. Inventory metadata and route edges before reading bodies.564. Read only candidate owners, then remove duplication or route detail behind57 one directly discoverable on-demand reference.585. Reduce repeated tool calls, checks, updates, and reports only where the59 next decision does not depend on each intermediate result.606. Re-run the same routing, authorization, safety, and outcome scenarios.617. Stop when further reduction would trade away required quality or evidence.6263Prefer precise trigger descriptions, one canonical owner per rule,64phase-specific references, bounded retries, conclusive stopping conditions,65and concise evidence-led reporting. Keep ordinary no-match work outside Axiom.6667## Report6869Lead with the implemented or recommended outcome. Include affected files or70surfaces, comparable before/after measurements, validation results, and real71unverified gaps. Omit repeated rationale, routine successful details, and exact72usage claims the host did not expose.