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.
git clone --depth 1 https://github.com/sigistry/marketplaceWrote 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/commands/sigistry/marketplace/token-cost-audit)<a href="https://agentmods.dev/commands/sigistry/marketplace/token-cost-audit"><img src="https://agentmods.dev/badge/commands/sigistry/marketplace/token-cost-audit/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/commands/sigistry/marketplace/token-cost-audit"><img src="https://agentmods.dev/badge/commands/sigistry/marketplace/token-cost-audit.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.00020 | $0.00772 |
| Opus 5 | $0.00010 | $0.00386 |
| Sonnet 5 | $0.00004 | $0.00154 |
| Haiku 4.5 | $0.00002 | $0.00077 |
Grade A, and why
token-cost-audit 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 7d 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 — 41 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Audit the LLM call sites at $ARGUMENTS (default: the current diff, or the app's model-calling modules) for token and cost waste, quantify the potential reduction, and dispatch the token-cost-optimizer agent to apply the safe wins. Large cost cuts (frequently 60–85%) are routinely on the table in LLM apps but hide behind tedious manual auditing, this command does that auditing directly on your call sites and prompt assembly.
Process
Step 1: Detect the provider(s) and map the call sites
Identify each SDK in use (Anthropic, OpenAI, Gemini/Vertex, LangChain, LlamaIndex, Vercel AI SDK) and enumerate the call sites, the system prompts they send, and how per-turn context is assembled. Note the model tier each call uses and whether calls run in a loop.
Step 2: Classify the waste
Score each site against this catalog:
| Issue | Signal | Fix |
|---|---|---|
| Oversized / duplicated system prompt | Multi-KB system string, or the same preamble rebuilt per request | Extract once; trim dead instructions |
| No prompt caching | Stable prefix re-sent uncached every call | Enable prompt caching on the stable prefix |
| Cache-busting prefix | now()/UUID/unsorted JSON early in the prompt |
Move volatile content after the cache breakpoint |
| Redundant context re-sent | Full history/RAG docs resent each turn unchanged | Cache, trim, or window the context |
| Over-powered model tier | Frontier model on classification/extraction/routing | Route easy tasks to a cheaper tier |
Missing max_tokens |
No output cap on a bounded task | Set a sensible cap |
| Unbatched calls | Independent calls in a serial loop | Batch, or use the batch endpoint |
Step 3: Quantify
For each finding, estimate the token/cost reduction from what is visible in code: prompt size (count the tokens in the static string), call frequency, cache hit-rate opportunity (reads cost a small fraction of base input; a stable multi-KB prefix reused across calls is the highest-leverage win), and tier price deltas (cheaper tiers are typically several times less per token). State assumptions; mark anything needing a production token count as estimated.
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.
- 7d ago First seen · 41 lines · 20 tokens per session scan A 3f4ab829741a
token-cost-audit is a command published in the GitHub repository sigistry/marketplace (3 stars, last pushed today), licensed MIT. It adds 20 tokens to every session and 772 once invoked, about $0.0001 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-09-03.
Other commands, from other repositories
prompt-generator
Generate effective prompts for Claude 4.5 Sonnet to achieve user-defined outcomes.
prompt-review
Scan prompts for ground rule, KISS/DRY, AI sweep, and context budget violations.
prompt-optimize
Apply fixes for issues found by prompt-review.
prompt-create
Create a new prompt following ground rules.
gen-image
Generate a brand-aligned AI image — tool selection, full prompt (subject, style, lighting, camera, mood, negatives), variation prompts, and seed strategy. Works across Midjourney, DALL-E, Ideogram, Firefly, and Stable Diffusion.
prompt-history
Manage history of created and optimized prompts.