ai-cost-guard

ai-cost-guard is a skill for Claude Code from timurgaleev/vibestack. It costs 73 tokens per session (5,673 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 73 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,673 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.00073 $0.05673
Opus 5 $0.00036 $0.02837
Sonnet 5 $0.00015 $0.01135
Haiku 4.5 $0.00007 $0.00567

Measured 7d ago against content hash 7c0e82f555a2, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, 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 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.

skills/ai-cost-guard/SKILL.md · 335 lines

How it starts

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

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/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/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

The -i matters: a class name (Anthropic(), new OpenAI()) and a boto3 method (invoke_model, converse) differ in case from the package and API-operation spellings.

Read the full file on GitHub · 335 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. 7d 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 (6 stars, last pushed 8d ago), licensed MIT. It adds 73 tokens to every session and 5,673 once invoked, about $0.0004 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.

Related

Other skills, from other repositories

company-analyzer

A company-analysis tool that calls language models to produce analyses such as SWOT, valuation, and industry reviews. It includes shell helpers for caching results, tracking API costs, and checking a daily budget.

aAAaqwq/AGI-Super-Team · 0 tokens

plan-llm-cost-guardrails

Audit an LLM-powered app for runaway-cost and quota-abuse exposure, then produce a phased guardrail plan. Use when the user says "cap my AI costs", "my LLM bill could blow up", "rate limit my AI", "token budget", "runaway agent loop", or is hardening LLM features before launch.

kensaurus/cursor-kenji · 78 tokens

bedrock-rag

Build RAG on Amazon Bedrock Knowledge Bases — ingestion, chunking, embeddings, vector stores, Retrieve and RetrieveAndGenerate, citations, and Guardrails contextual grounding. Use when a chatbot must answer from a document corpus with sources.

ihatesea69/kiro-kit · 52 tokens

sap-rpt1

SAP-RPT-1-OSS local tabular prediction workflows for FI/CO prototype datasets. Use when preparing SAP finance CSV exports for classification or regression experiments with source-verified setup, leakage checks, and governance review.

secondsky/sap-skills · 51 tokens

data-engineering

Design and implement data pipelines, ETL processes, and data infrastructure. Use when building data ingestion, transformation, or storage systems.

ihatesea69/kiro-kit · 30 tokens

experiment-tracking

Track ML experiments systematically with MLflow, W&B, or similar tools. Use when running experiments, comparing model versions, or managing reproducibility.

ihatesea69/kiro-kit · 33 tokens