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 arturseo-geo/claude-code-skills --skill token-optimizergit clone --depth 1 https://github.com/arturseo-geo/claude-code-skillsWrote 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/arturseo-geo/claude-code-skills/token-optimizer)<a href="https://agentmods.dev/skills/arturseo-geo/claude-code-skills/token-optimizer"><img src="https://agentmods.dev/badge/skills/arturseo-geo/claude-code-skills/token-optimizer/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/arturseo-geo/claude-code-skills/token-optimizer"><img src="https://agentmods.dev/badge/skills/arturseo-geo/claude-code-skills/token-optimizer.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.00152 | $0.04214 |
| Opus 5 | $0.00076 | $0.02107 |
| Sonnet 5 | $0.00030 | $0.00843 |
| Haiku 4.5 | $0.00015 | $0.00421 |
Grade A, and why
token-optimizer 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 — 452 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Token Optimizer Skill
The Token Cost Breakdown
Understanding where tokens actually go in a typical Claude Code session:
| Source | Typical tokens | Controllable? |
|---|---|---|
| System tools (built-in) | ~16.8k | No — Fixed |
| System prompt | ~2.7k | No — Fixed |
| MCP tool descriptions | 200-500 per tool | Yes — Disable unused |
| CLAUDE.md / memory files | 1k-20k+ | Yes — Trim aggressively |
| Agent persona files | 200-1k each | Yes — Use functional roles |
| Skill descriptions | ~100 per skill | Yes — Keep library lean |
| Extended thinking (hidden) | Up to 31,999/request | Yes — Cap with env var |
| Prompt caching overhead | 25% write premium | Yes — Maximise cache hits |
| Subagent model choice | 5-15x cost difference | Yes — Route to Haiku |
| Conversation history | Grows until compaction | Yes — Compact strategically |
Settings — The High-Impact Tuning Knobs
Add to .claude/settings.json:
{
"model": "sonnet",
"env": {
"MAX_THINKING_TOKENS": "10000",
"CLAUDE_AUTOCOMPACT_PCT_OVERRIDE": "70",
"CLAUDE_CODE_SUBAGENT_MODEL": "haiku"
}
}
MAX_THINKING_TOKENS
Extended thinking reserves up to 31,999 tokens per request for internal reasoning.
- Default: 31,999 (very expensive for simple tasks)
10000: ~70% cost reduction on thinking, sufficient for most coding tasks0: disables extended thinking entirely (use for trivial/repetitive tasks)20000: good balance for complex architecture work- See
references/thinking-tokens.mdfor detailed tuning guidance
CLAUDE_CODE_SUBAGENT_MODEL
Subagents (spawned via the Task tool) default to the same model as the main session.
- Set to
haikufor cheap parallel work: file reading, grep, simple transforms - Subagents doing complex reasoning? Override per-task to
sonnet - Never route subagents to Opus — the reasoning overhead is wasted on narrow tasks
- Typical savings: 60-80% reduction on subagent costs
CLAUDE_AUTOCOMPACT_PCT_OVERRIDE
Controls when auto-compaction fires (default ~83.5% = 167k tokens used).
70: compacts earlier, more frequently, less data lost per event50: very aggressive — good for extremely long sessions- Lower = more compaction events but each loses less precision
What ships with it
5 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.
- 9d ago First seen · 452 lines · 152 tokens per session scan A c4a0f2a5c846
token-optimizer is a skill published in the GitHub repository arturseo-geo/claude-code-skills (11 stars, last pushed 5mo ago), licensed MIT. It adds 152 tokens to every session and 4,214 once invoked, about $0.0008 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-30.
Other skills, from other repositories
session-wrap
Use when wrapping up a session before ending. 4 parallel subagents detect doc updates, repeated patterns, learning points, and follow-ups, then a verifier deduplicates and presents choices. Triggers on /session-wrap, session wrap, session cleanup, end of session.
skill-factory
A workflow that examines completed session work and turns reusable patterns into Claude Code skills.
relay
Session relay — compresses what's been done so far (writes a one-liner for /compact) and generates a "next task" prompt (a baton) for the user to hand off. Use on requests like "relay / hand off / next session / continue after compact / baton / handoff / clean up context and continue next task." Does not run /compact…
strategic-compact
Suggests manual context compaction at logical intervals to preserve context through task phases rather than arbitrary auto-compaction.
rotation-check
Standard-Gerüst für rotierende Pipeline-Checks: Pro Lauf genau ein Ziel aus einer Menge (Projekte, Ordner, Repos) wählen — bevorzugt das am längsten ungeprüfte —, den Check durchführen, Ergebnis in einer Check-Registry und einem Verlaufslog festhalten. Nutze diesen Skill, wenn ein wiederkehrender Check über viele…
progress-channel
One visible channel for every long-running process — local sweeps, backgrounded commands, and work handed to external systems (a CI run, a media-server queue, a long download). The server that serves the live progress page IS the tracker — a stdlib Python daemon holding live jobs in memory, auto-spawned by the first…