ai-cost-guard

ai-cost-guard is a skill for Claude Code from timurgaleev/vibestack. It costs 28 tokens per session (6,230 once invoked), scanned A, original, MIT.

A review process for code that calls paid AI services such as language, speech or image models.

In plain words
What is it for?
Use it before shipping AI integrations or investigating an unusually high model-API bill.
Why use it?
It finds loops, retries and parallel work that could create unexpectedly large bills, then requires spending limits.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: names the AskUserQuestion tool.

Good fit Use it before shipping AI integrations or investigating an unusually high model-API bill.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/timurgaleev/vibestack/ai-cost-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 timurgaleev/vibestack --skill ai-cost-guard
Clone the repo
git clone --depth 1 https://github.com/timurgaleev/vibestack

Made for: Claude Code.

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 ai-cost-guard

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/timurgaleev/vibestack/ai-cost-guard"><img src="https://agentmods.dev/badge/skills/timurgaleev/vibestack/ai-cost-guard.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 28 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 6,230 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. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Rogue Agent · line 18
    Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
    Fix: Remove any persistence mechanisms (cron jobs, startup scripts, state files). Skills should not maintain state across sessions without explicit user consent.
How audits are shown
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.00028 $0.06230
Opus 5.5 $0.00011 $0.02492
Sonnet 5.5 $0.00006 $0.01246
Haiku 4.5 $0.00003 $0.00623

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

Security

Grade A, and why

ai-cost-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 22d 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/ai-cost-guard/SKILL.md · 347 lines

How it starts

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

If this session was compacted, the copy of this skill in context may be cut off. Read ${CLAUDE_SKILL_DIR}/SKILL.md from disk and resume at the step you are on.

When to invoke

Use when: "ai cost guard", "cap llm spend", "unbounded llm loop", "token budget", "runaway api cost", "bedrock spend limit", "why was the Anthropic/OpenAI bill so high", or before merging a change that adds a call to a paid model API.

Preamble

eval "$("${VIBESTACK_HOME:-$HOME/.vibestack}/bin/vibe-slug" 2>/dev/null)" 2>/dev/null || SLUG="unknown"
_LEARN_FILE="${VIBESTACK_HOME:-$HOME/.vibestack}/projects/${SLUG:-unknown}/learnings.jsonl"
if [ -f "$_LEARN_FILE" ]; then
  _LEARN_COUNT=$(wc -l < "$_LEARN_FILE" 2>/dev/null | tr -d ' ')
  echo "LEARNINGS: $_LEARN_COUNT entries loaded"
  if [ "$_LEARN_COUNT" -gt 5 ] 2>/dev/null; then
    "${VIBESTACK_HOME:-$HOME/.vibestack}/bin/vibe-learnings-search" --limit 5 2>/dev/null || true
  fi
else
  echo "LEARNINGS: none yet"
fi

{{include lib/snippets/session-host.md}}

{{include lib/snippets/decision-brief.md}}

{{include lib/snippets/working-protocols.md}}

{{include lib/snippets/state-protocols.md}}

User-invocable

When the user types /ai-cost-guard, run this skill.


Step 1: Inventory paid-API call sites

Every call to a metered model API is a place where money leaves the account. Find all of them before judging any of them.

grep -rniE \
  'anthropic|@anthropic-ai/sdk|openai|bedrock-runtime|invoke_?model|converse|boto3.*bedrock|google\.generativeai|replicate|elevenlabs|deepgram|fal\.ai|fal_client|@fal-ai|messages\.create|chat\.completions\.create|responses\.create|generate_content|replicate\.run|\.transcribe|\.subscribe' \
  --include='*.py' --include='*.ts' --include='*.tsx' --include='*.js' --include='*.mjs' \
  --include='*.go' --include='*.rb' --include='*.java' --include='*.kt' --include='*.rs' \
  --exclude-dir=node_modules --exclude-dir=.git --exclude-dir=dist --exclude-dir=build \
  --exclude-dir=vendor --exclude-dir=.venv . 2>/dev/null

Read the full file on GitHub · 347 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. 22d ago Changed · +9 lines aec025dadad3
  2. 1mo ago Changed · +3 lines 54be7a8171e2
  3. 1mo ago Changed · -45 tokens per session d1ff0ab43285
  4. 2mo ago First seen · 335 lines · 73 tokens per session scan A 7c0e82f555a2

Subscribe to this mod's changes

ai-cost-guard is a skill published in the GitHub repository timurgaleev/vibestack (8 stars, last pushed 20d ago), licensed MIT. It adds 28 tokens to every session and 6,230 once invoked, about $0.0001 per session on Opus 5.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.

Related

ai-cost-guard compared with skills from other repositories

ai-cost-guard next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
ai-cost-guardtimurgaleev/vibestackSkill820d agoMITA28Claude Code
plan-llm-cost-guardrailskensaurus/cursor-kenjiSkill92mo agoMITA78Claude Code
fs-creative-voltagenexu-io/open-designSkill110ktodayApache-2.0A49Claude Code, Codex
ai-readinessanthropics/financial-servicesSkill42ktodayApache-2.0A112Claude Code
merger-modelanthropics/financial-servicesSkill42ktodayApache-2.0A87Claude Code
technical-basicHKUDS/Vibe-TradingSkill39kyesterdayMITA48Claude Code, Codex
tinker-training-costsynthetic-sciences/openscienceSkill4.5k2d agoApache-2.0A55Claude Code, Codex