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/Sagargupta16/claude-cost-optimizerWrote 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/sagargupta16/claude-cost-optimizer/cost-check)<a href="https://agentmods.dev/commands/sagargupta16/claude-cost-optimizer/cost-check"><img src="https://agentmods.dev/badge/commands/sagargupta16/claude-cost-optimizer/cost-check/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/sagargupta16/claude-cost-optimizer/cost-check"><img src="https://agentmods.dev/badge/commands/sagargupta16/claude-cost-optimizer/cost-check.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.00009 | $0.00379 |
| Opus 5 | $0.00005 | $0.00189 |
| Sonnet 5 | $0.00002 | $0.00076 |
| Haiku 4.5 | $0.00001 | $0.00038 |
Grade A, and why
cost-check 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.
What it actually says
Cost Check
Analyze the current session and report on cost efficiency. Be concise — this command should itself be cheap.
Instructions
-
Session summary: Count how many turns have occurred so far in this conversation. Note the approximate scope of work done.
-
Token usage estimate: Based on the conversation length and complexity, estimate:
- Approximate input tokens consumed (including CLAUDE.md overhead per turn)
- Approximate output tokens generated
- Which model has been used (Haiku/Sonnet/Opus)
-
Cost patterns identified: Flag any of these wasteful patterns if they occurred:
- Full file reads when partial reads would suffice
- Multiple search passes for the same information
- Verbose explanations where concise answers were appropriate
- Unnecessary exploration before making targeted edits
- Reading files that were not ultimately used
-
Recommendations: Suggest 1-3 specific actions to reduce cost for the remainder of this session. Examples:
- "Switch to Haiku for the remaining simple edits"
- "Use Grep with specific patterns instead of reading full files"
- "Batch remaining edits into fewer turns"
Output Format
SESSION COST REPORT
-------------------
Turns so far: {n}
Model used: {model}
Est. input tokens: ~{n}k
Est. output tokens: ~{n}k
Est. session cost: ~${n.nn}
PATTERNS FOUND:
- {pattern 1}
- {pattern 2}
RECOMMENDATIONS:
1. {recommendation}
2. {recommendation}
Keep the report under 20 lines. Do not elaborate beyond what is shown above.
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 · 52 lines · 9 tokens per session scan A c79fa823b048
cost-check is a command published in the GitHub repository Sagargupta16/claude-cost-optimizer (35 stars, last pushed 3d ago), licensed MIT. It adds 9 tokens to every session and 379 once invoked, about $0.0000 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 commands, from other repositories
audit-agents-skills
Audit quality of agents, skills, and commands in a Claude Code project.
audit-whitepapers
Audit version freshness, FR/EN parity, and metadata quality of all whitepapers and recap cards.
audit-repo-docs
Audit repository documentation against 85+ best practices from claude-code-ultimate-guide.
boldguy-linkedin-answer
Draft a LinkedIn comment on a post, referencing the guide's relevant section, in Flow style with AI markers removed.
methodology-advisor
Analyzes your codebase and asks 3 targeted questions to recommend the right AI-assisted development methodology stack.
security-audit
Comprehensive security audit of your project AND Claude Code configuration. Analyzes secrets exposure, injection surfaces, dependencies, hook security, and produces a scored security posture assessment.