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/greyok00/slimtoken/slimtoken-optimizernpx skills add greyok00/slimtoken --skill slimtoken-optimizergit clone --depth 1 https://github.com/greyok00/slimtokenWrote 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/greyok00/slimtoken/slimtoken-optimizer)<a href="https://agentmods.dev/skills/greyok00/slimtoken/slimtoken-optimizer"><img src="https://agentmods.dev/badge/skills/greyok00/slimtoken/slimtoken-optimizer.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.00116 | $0.01048 |
| Opus 5 | $0.00058 | $0.00524 |
| Sonnet 5 | $0.00023 | $0.00210 |
| Haiku 4.5 | $0.00012 | $0.00105 |
Grade A, and why
slimtoken-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 3d 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 — 83 lines — stays where its author put it; the contents beside it link to each section on GitHub.
slimtoken-optimizer
Trim prompt tokens before a request goes out. Use this whenever a conversation has grown long, tool results are large, or you're about to hit a context/token-budget limit on a local or cloud model. Model-agnostic — it rewrites the request, not the model.
When to use
- A tool returned a large result (file dump, directory listing, log, JSON) and the same content appears more than once across turns.
- The transcript is long and older turns are now low-value.
- You're close to a model's context limit and need headroom cheaply.
- You want to know how many tokens a request actually costs before sending.
How to use
Default — the proxy. slimtoken runs as a proxy in front of the model API
(slimtoken serve --upstream <model>). Every request routed through it is
minified automatically — you don't need to call anything. If the proxy is in
the path, the work is already done. Do not re-minify a request that already went
through the proxy.
Fallback 1 — CLI (when the proxy isn't in the path; no server needed):
# Count tokens in a request (cl100k, approximate for non-cl100k models)
slimtoken optimize --input request.json # always-on: full pipeline, most headroom
slimtoken optimize -i request.json --max-input-tokens 8192 # also prune to a budget
# stdin works too: cat request.json | slimtoken optimize
# See recommended local-model configs + measured reduction by GPU VRAM tier
slimtoken presets --measure # 4 / 8 / 16 GB tiers, real % drop
slimtoken presets --vram-gb 8 --measure
Fallback 2 — MCP stdio (when the host agent runtime speaks MCP and you want a persistent tool surface):
tools: slimtoken.optimize_messages, slimtoken.estimate_tokens,
slimtoken.prune_context, slimtoken.minify_tool_result,
slimtoken.inspect_budget, slimtoken.get_config,
slimtoken.list_model_presets
Run the server with slimtoken-mcp (or python -m slimtoken.mcp_server) and point
your MCP client at it over stdio. The MCP tools call the same core pipeline as the
CLI — nothing is reimplemented.
What ships with it
2 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.
- 3d ago First seen · 83 lines · 116 tokens per session scan A 0d413bb6cc84
slimtoken-optimizer is a skill published in the GitHub repository greyok00/slimtoken (4 stars, last pushed 10d ago), licensed MIT. It adds 116 tokens to every session and 1,048 once invoked, about $0.0006 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
promptfoo-redteam-setup
Create or refine promptfoo redteam setup configs: purpose, targets, plugins, strategies, frameworks, multi-input target inputs, policy text, grader guidance, contexts, and static-code-derived target/threat mapping. Use when preparing a red team scan plan from live probes, code evidence, or provider configs, or when…
redteam-plugin-development
Standards for creating redteam plugins and graders. Use when creating new plugins, writing graders, or modifying attack templates.
promptfoo-evals
Write, refine, run, and QA promptfoo evaluation suites: promptfooconfig.yaml, prompts, providers, vars, tests, assertions, model-graded rubrics, transforms, datasets, exports, and CI gates. Use for non-redteam eval coverage, regression tests, or new eval matrices. Do not use for adversarial redteam plugin or strategy…
promptfoo-provider-setup
Configure promptfoo providers or redteam targets for hosted models, live HTTP APIs, Python/JavaScript local scripts, agent SDKs, or multi-input systems. Use when connecting promptfoo to the system under test, mapping vars, auth env vars, request bodies, response transforms, or static-code-derived provider wrappers. Do…
search-params
URL search param and hash state management. Use when adding or modifying URL search params, working with useSearchParams, setSearchParams, useSearchParamState, or navigate() with query strings or hash fragments, or fixing browser back/forward button issues.
discount-review
Inspect the discount policy fixture with a repeatable review checklist and helper script.