cost-cap-guard

cost-cap-guard is a skill for Claude Code, Codex from Wh0FF24/whoff-agents. It costs 42 tokens per session (1,108 once invoked), scanned A, original, MIT.

A session budget checker for coding-agent tasks. It estimates how many tokens, the units used to process text, a proposed agent request may consume.

In plain words
What is it for?
It helps compare estimated input and output usage with a token limit, flag over-budget work, estimate cost, and trim prompts while keeping their objective.
Why use it?
It helps catch overly expensive prompts or tasks before another agent is started and provides a shorter version when needed.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions subagents; positional $N argument.

Good fit It helps compare estimated input and output usage with a token limit, flag over-budget work, estimate cost, and trim prompts while keeping their objective.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/wh0ff24/whoff-agents/cost-cap-guard
Install

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.

Any agent
npx skills add Wh0FF24/whoff-agents --skill cost-cap-guard
Clone the repo
git clone --depth 1 https://github.com/Wh0FF24/whoff-agents

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for cost-cap-guard

README.md
[![agentmods](https://agentmods.dev/badge/skills/wh0ff24/whoff-agents/cost-cap-guard/github.svg)](https://agentmods.dev/skills/wh0ff24/whoff-agents/cost-cap-guard)
Your own site
<a href="https://agentmods.dev/skills/wh0ff24/whoff-agents/cost-cap-guard"><img src="https://agentmods.dev/badge/skills/wh0ff24/whoff-agents/cost-cap-guard/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.

agentmods 80×15 button for cost-cap-guard

Your own site · 80×15
<a href="https://agentmods.dev/skills/wh0ff24/whoff-agents/cost-cap-guard"><img src="https://agentmods.dev/badge/skills/wh0ff24/whoff-agents/cost-cap-guard.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 42 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,108 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00042 $0.01108
Opus 5 $0.00021 $0.00554
Sonnet 5 $0.00008 $0.00222
Haiku 4.5 $0.00004 $0.00111

Measured 10d ago against content hash 01bb1a173837, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

cost-cap-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 10d 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.

skills/cost-cap-guard/SKILL.md · 104 lines

How it starts

The opening of the file, as written. The whole thing — 104 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Cost Cap Guard Skill

You are enforcing a token budget — calculating what this operation will actually cost, flagging if it exceeds the limit, and producing a trimmed prompt that delivers the same result for less.

Runaway agents are a real cost problem. A single verbose handoff packet, a bloated system prompt, or a multi-step task with no scoping can 3–5x the expected token count. This skill stops that before dispatch.

What You Will Do

  1. Read the proposed prompt — the full text being sent to the subagent, including system prompt, context, and task.

  2. Estimate token cost using this rule of thumb:

    • 1 token ≈ 4 characters
    • Input tokens + estimated output tokens = total session tokens
    • Multiply by model rate (Opus: ~$15/M input, ~$75/M output; Sonnet: ~$3/M input, ~$15/M output; Haiku: ~$0.25/M input, ~$1.25/M output)
  3. Compare against the session budget (default: 50k tokens unless specified):

STATUS: [WITHIN BUDGET / OVER BUDGET / WARNING]
Estimated input tokens:  X,XXX
Estimated output tokens: X,XXX
Total estimated tokens:  X,XXX
Budget:                  XX,XXX
Overage:                 +X,XXX (if applicable)
Estimated cost:          $X.XX
  1. If over budget, produce a trimmed version of the prompt:

    • Strip filler phrases and pleasantries
    • Replace prose context with bullet facts
    • Remove re-stated constraints the subagent can derive from the codebase
    • Trim examples to the minimum needed (1 example beats 3 when they're identical in structure)
    • Cut "here's what I've already tried" to a 1-line ruled-out summary
  2. Write the result to .claude/cost-cap-<timestamp>.md:

# Cost Cap Report — <ISO timestamp>

## Budget Status
[WITHIN BUDGET / OVER BUDGET / WARNING — X% of budget used]

## Token Estimate
- Input: X,XXX tokens (~$X.XX)
- Output: X,XXX tokens (~$X.XX)
- Total: X,XXX tokens (~$X.XX)

## Original prompt (X,XXX tokens)
[paste]

## Trimmed prompt (X,XXX tokens — X% reduction)
[paste trimmed version]

## What was cut and why
- [item]: [reason it was redundant]
- [item]: [reason it was derivable from context]

Read the full file on GitHub · 104 lines

Changes

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.

  1. 10d ago First seen · 104 lines · 42 tokens per session scan A 01bb1a173837

Subscribe to this mod's changes

cost-cap-guard is a skill published in the GitHub repository Wh0FF24/whoff-agents (2 stars, last pushed 2mo ago), licensed MIT. It adds 42 tokens to every session and 1,108 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.

Related

Other skills, from other repositories

shogun-bloom-config

An interactive wizard that creates model-routing settings from your AI subscription choices. Model routing decides which available model handles each kind of task.

yohey-w/multi-agent-shogun · 86 tokens

shogun-model-list

A reference table of AI command-line tools, their available models, subscription requirements, and maximum Bloom capability levels. Bloom's Taxonomy is a scale describing thinking tasks, from remembering information to creating new designs.

yohey-w/multi-agent-shogun · 73 tokens

shogun-model-switch

A live-switching tool for changing which command-line AI agent, model, and reasoning mode is running. It updates settings, restarts the agent, and refreshes the displayed session information.

yohey-w/multi-agent-shogun · 83 tokens

shogun-screenshot

A screenshot tool for getting images from a computer or web page and then cropping, resizing, or masking sensitive information. Playwright is a browser-automation tool used here to capture web pages.

yohey-w/multi-agent-shogun · 149 tokens

shogun-readme-sync

A skill that compares an English README with its Japanese counterpart and brings them back into alignment. A README is the project document that explains what the software is and how to use it.

yohey-w/multi-agent-shogun · 66 tokens

shogun-agent-status

A skill that shows whether the agents in a multi-agent Japanese feudal-themed team are working, waiting, missing, or assigned tasks. It combines terminal session status, task files, and unread messages.

yohey-w/multi-agent-shogun · 98 tokens