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/davidcreador/codex-token-guard/token-guardnpx skills add Davidcreador/codex-token-guard --skill token-guardgit clone --depth 1 https://github.com/Davidcreador/codex-token-guardWrote 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/davidcreador/codex-token-guard/token-guard)<a href="https://agentmods.dev/skills/davidcreador/codex-token-guard/token-guard"><img src="https://agentmods.dev/badge/skills/davidcreador/codex-token-guard/token-guard.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.00040 | $0.00685 |
| Opus 5 | $0.00020 | $0.00342 |
| Sonnet 5 | $0.00008 | $0.00137 |
| Haiku 4.5 | $0.00004 | $0.00068 |
Grade A, and why
token-guard 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 — 74 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Codex Token Guard
Use this skill when a Codex session needs lower token waste without lower output quality.
Operating Rule
Default to quality over savings. If uncertain, preserve content.
Workflow
- Prefer focused search and reads:
rg --files | sed -n '1,200p'instead offind .rg "pattern" path/instead ofgrep -rsed -n '1,160p' file.tsinstead ofcaton large files
- Keep full error context:
- actual error message
- file path
- line and column
- failing test name
- stack frame where useful
- Use CLI checks:
codex-token-guard statscodex-token-guard stats --sessioncodex-token-guard snapshotcodex-token-guard benchmarkcodex-token-guard notifications statuscodex-token-guard digest status
- Before compaction, preserve:
- goal
- current status
- key decisions
- files touched
- bugs/errors
- next steps
Modes
safe: only blocks obvious waste.balanced: default; blocks high-noise reads, warns on broad tests, compresses noisy output.aggressive: strict budgets and fail-closed hook errors.
Quality Protection
Never remove user instructions, recent edits, architecture decisions, actual error messages, file paths, line numbers, API names, function names, or test names.
Notifications
Notifications are on by default. They show Token Guard estimated avoided, raw, and sent-token totals for blocked commands, output compression above the configured threshold, benchmark results, and Stop summaries. They are not Codex context-window UI readings.
Runtime metrics and session state live under .codex-token-guard/runtime/ so hooks do not edit tracked starter templates.
In-thread notices are enabled by default and stay one line at milestone scale:
[token-guard] est. avoided 30k tokens (25%); guard sent 90k of 120k raw.
Context Digest is enabled by default. It injects a small session digest only on resume-style prompts, large prompts, or long sessions after enough hook activity since the last digest. It should not run every turn.
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 · 74 lines · 40 tokens per session scan A 841cdf8f8368
token-guard is a skill published in the GitHub repository Davidcreador/codex-token-guard (2 stars, last pushed 2mo ago), licensed MIT. It adds 40 tokens to every session and 685 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
azure-openai-to-responses
Migrate Python apps from Azure OpenAI Chat Completions to the Responses API. Covers AzureOpenAI/AsyncAzureOpenAI client migration to the v1 endpoint, streaming, tools, structured output, multi-turn, EntraID auth, and model compatibility checks. Python-focused, Azure OpenAI-specific. USE FOR: migrate to responses API…
gh-issues
Fetch GitHub issues, spawn sub-agents to implement fixes and open PRs, then monitor and address PR review comments. Usage: /gh-issues [owner/repo] [--label bug] [--limit 5] [--milestone v1.0] [--assignee @me] [--fork user/repo] [--watch] [--interval 5] [--reviews-only] [--cron] [--dry-run] [--model glm-5]…
greeting-user
Explains how to properly greet the user.
canvas
Display HTML content on connected OpenClaw nodes (Mac app, iOS, Android).
peekaboo
Capture and automate macOS UI with the Peekaboo CLI.
gog
Google Workspace CLI for Gmail, Calendar, Drive, Contacts, Sheets, and Docs.