ai-cost-audit

ai-cost-audit is a skill for Claude Code from RBraga01/builder-ai. It costs 49 tokens per session (1,508 once invoked), scanned A, original, MIT.

A review process for measuring and projecting the cost of a feature that uses a large language model, or LLM. It combines the number of input and output tokens, expected call volume, and projected spending at ten times the current scale.

In plain words
What is it for?
Use it before launching or scaling an LLM feature, when API spending rises unexpectedly, or when choosing a model for high-volume use; it is intended to be skipped for small, low-cost internal scripts and unstable prototypes.
Why use it?
It prevents a feature from appearing affordable only because current usage is small. The process reveals how costs may change before launch or expansion.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the builder-ai plugin — 8 skills, 5 agents shipped together

Good fit Use it before launching or scaling an LLM feature, when API spending rises unexpectedly, or when choosing a model for high-volume use; it is intended to be skipped for small, low-cost internal scripts and unstable prototypes.

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

Made for: Claude Code.

Or install builder-ai, the plugin that ships this one along with the rest of its 8 skills, 5 agents.

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

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

agentmods 80×15 button for ai-cost-audit

Your own site · 80×15
<a href="https://agentmods.dev/skills/rbraga01/builder-ai/ai-cost-audit"><img src="https://agentmods.dev/badge/skills/rbraga01/builder-ai/ai-cost-audit.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 49 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,508 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.00049 $0.01508
Opus 5 $0.00024 $0.00754
Sonnet 5 $0.00010 $0.00302
Haiku 4.5 $0.00005 $0.00151

Measured 10d ago against content hash 546159c02475, 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-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 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/ai-cost-audit/SKILL.md · 177 lines

How it starts

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

AI Cost Audit

The Law

EVERY LLM FEATURE HAS A COST TRAJECTORY. DISCOVER IT BEFORE 10× SCALE DISCOVERS YOU.
"It's cheap enough now" is a claim about current volume, not future volume.
"The API has reasonable pricing" is not a projection.
Token counts + call volume + cost at 10× scale IS a cost audit.

When to Use

Trigger:

  • Before launching any LLM feature (pre-launch projection)
  • When monthly API bill increased > 20% with no obvious cause
  • Before scaling a feature to a new user segment
  • Before committing to a model or provider for a high-volume use case

When NOT to Use

  • Internal one-off scripts or developer tools with < 50 calls/day — cost is negligible; write the call, move on
  • Features still in prototype where the call structure will change significantly before launch — audit after the design stabilises
  • When total monthly API cost is guaranteed < $50 regardless of 10× scale — skip the audit, check the bill quarterly

The Process

Step 1 — Count Tokens Precisely

Do not estimate. Count:

import tiktoken

enc = tiktoken.get_encoding("cl100k_base")  # cl100k for GPT/Claude

def count_tokens(text: str) -> int:
    return len(enc.encode(text))

# Measure each segment separately
print("System prompt:", count_tokens(system_prompt))
print("Avg context:", count_tokens(avg_context_sample))
print("Avg user message:", count_tokens(avg_user_message_sample))
print("Avg output:", count_tokens(avg_output_sample))

Get real samples from logs or representative test data — not the "hello world" example.

Step 2 — Measure Call Volume

Calls per user session: N
Sessions per day: M
Background/batch calls per day: K
Retry rate: R% (from logs or estimate)
Total calls per day: (N × M) + K × (1 + R/100)

Step 3 — Calculate Current Cost

COST_PER_1K_INPUT  = 0.003   # $/1k tokens — replace with actual model pricing
COST_PER_1K_OUTPUT = 0.015

def cost_per_call(input_tokens, output_tokens):
    return (input_tokens / 1000 * COST_PER_1K_INPUT
          + output_tokens / 1000 * COST_PER_1K_OUTPUT)

daily_cost    = cost_per_call(avg_input, avg_output) * calls_per_day
monthly_cost  = daily_cost * 30

Read the full file on GitHub · 177 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 · 177 lines · 49 tokens per session scan A 546159c02475

Subscribe to this mod's changes

ai-cost-audit is a skill published in the GitHub repository RBraga01/builder-ai (2 stars, last pushed 3d ago), licensed MIT. It adds 49 tokens to every session and 1,508 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

ai-engineering-toolkit

6 production-ready AI engineering workflows: prompt evaluation (8-dimension scoring), context budget planning, RAG pipeline design, agent security audit (65-point checklist), eval harness building, and product sense coaching.

sickn33/agentic-awesome-skills · 47 tokens

prompt-master

Generates optimized prompts for AI tools. Activates only when the user explicitly asks to write, fix, improve, or adapt a prompt for a specific AI tool (LLM, Cursor, Midjourney, image AI, video AI, coding agents, etc.). Does not activate for general conversation, coding tasks, document writing, or other…

nidhinjs/prompt-master · 78 tokens

flux2-lora-training

Plan or review LoRA and edit-training work specifically for FLUX.2 Klein or Qwen-Image-Edit, including paired datasets, trainer-version contracts, and held-out fidelity checks. Do not use for generic Stable Diffusion/DiT training, prompt authoring, or model serving; route those tasks to their specialized skill.

AnastasiyaW/codex-claude-code-config · 73 tokens

vlm-segmentation

Choose and evaluate VLM or segmentation pipelines, including text-conditioned detection, masks, part labels, model-license constraints, and measured GPU deployment choices. Use when a task has a VLM or segmentation component; route pure diffusion prompting, training, or serving to its specialized skill.

AnastasiyaW/codex-claude-code-config · 61 tokens

deepseek-provider-contract

Validate a proposed DeepSeek API integration before any key or project context is sent: check thinking-mode tool-call history, strict-schema assumptions, bounded output, and provider data boundaries. Use when integrating DeepSeek, adding DeepSeek tool calls or streaming, debugging DeepSeek 400 after a tool call, or…

AnastasiyaW/codex-claude-code-config · 98 tokens

forensic-prompt-compiler

Forensic image-to-prompt compiler for image generation models. Use this skill whenever the user wants to: convert/describe an existing image into a generation prompt, reconstruct a scene as a prompt, generate prompts from reference images for AI image tools (Midjourney, FLUX, Stable Diffusion, DALL-E, or any diffusion…

AnastasiyaW/codex-claude-code-config · 218 tokens