cost-audit
Use when AI inference costs are growing unexpectedly, when comparing model choices by cost/quality ratio, or when optimizing token usage across a multi-model pipeline — produces an actionable cost reduction plan
Best use case
cost-audit is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Use when AI inference costs are growing unexpectedly, when comparing model choices by cost/quality ratio, or when optimizing token usage across a multi-model pipeline — produces an actionable cost reduction plan
Teams using cost-audit should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/cost-audit/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How cost-audit Compares
| Feature / Agent | cost-audit | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Use when AI inference costs are growing unexpectedly, when comparing model choices by cost/quality ratio, or when optimizing token usage across a multi-model pipeline — produces an actionable cost reduction plan
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Cost Audit Audit AI inference costs and optimize token usage across multi-model pipelines. This is not about cutting capabilities — it is about eliminating waste, right-sizing models, and keeping costs predictable. ## When to Use - AI API costs growing faster than usage justifies - Unsure whether you are using the right model tier for each task - Want to compare cost-quality trade-offs before committing to a model - Preparing for production traffic and need a cost baseline - Running fleet mode or parallel agents and want to avoid runaway spend ## Model Cost Tiers Use the most capable model necessary — not the most capable model available. | Tier | Models | Best for | |------|--------|----------| | **Premium** | `claude-opus-4.7`, `claude-opus-4.6`, `claude-opus-4.5` | Architecture decisions, complex multi-file reasoning, security audits | | **Standard** | `claude-sonnet-4.6`, `claude-sonnet-4.5`, `gpt-5.2` | Most coding tasks, code review, test generation, documentation | | **Fast / Cheap** | `claude-haiku-4.5`, `gpt-5-mini`, `gpt-4.1` | File edits, boilerplate, classification, triage, simple summaries | ## Workflow ### 1. Identify high-cost call sites Scan for: - Long system prompts that repeat across calls - Premium models used for simple transforms - Entire file contents passed when only relevant sections are needed - No context caching on static instructions - Fleet mode with all agents on premium tiers ### 2. Measure baseline | Metric | How to measure | |--------|---------------| | Total tokens / task | Compare before and after context changes | | Model mix | Tally which models are called per workflow | | Prompt size distribution | Log avg/max token counts per call type | ### 3. Apply reduction patterns **Model downgrade** - Does this task require premium reasoning? If not, drop a tier. - Classification, routing, simple edits → use fast/cheap tier - Reserve premium for tasks that demonstrably need it **Context pruning** - Pass a summary instead of the full history when prior turns are less relevant - Slice file ranges with `view_range` instead of full-file reads - Remove redundant boilerplate from system prompts **Prompt deduplication** - Repeated instructions in every call → move to a system prompt / shared prefix - Static context that never changes → candidate for caching (if platform supports it) **Task batching** - Small independent tasks → batch into one call instead of N separate calls - Fan-out agents → assign right tier per task, not fleet-wide premium ### 4. Estimate savings For each change: ```text Change: Replace claude-opus-4.7 on doc-summary with claude-haiku Before: ~4,000 tokens × $0.015/1K = $0.06/call After: ~4,000 tokens × $0.00025/1K = $0.001/call Savings: ~$0.059/call, ~$590/10K calls ``` Use approximate public pricing for estimation. Actual prices vary; check your provider dashboard. ### 5. Prioritize | Priority | Criterion | |----------|-----------| | High | Premium model on a task a fast model handles well | | High | Context window > 50K tokens when shorter would suffice | | Medium | Duplicate context passed on every call | | Medium | Fleet agents with mismatched model tiers | | Low | Minor prompt size variations | ### 6. Report format ```markdown ## Cost Audit Report ### Summary Estimated waste: ~$X/day at current scale Top three opportunities: [list] ### Findings #### [HIGH] Premium model for boilerplate generation Location: [file or workflow name] Issue: `claude-opus-4.7` used for all code generation including templates and stubs. Recommendation: Use `claude-haiku-4.5` for boilerplate; reserve opus for complex tasks. Estimated savings: ~80% cost reduction on boilerplate tasks. #### [MEDIUM] Entire codebase passed as context on every PR review ... ``` ## Common Waste Patterns | Pattern | Fix | |---------|-----| | Entire conversation history on every call | Summarize old context, keep recent turns | | Full file reads when only one function matters | Use `view_range` for targeted reads | | Premium model for all parallel agents in fleet | Assign tier per task type | | Same instructions repeated in every prompt | Move to shared system prompt | | No caching on static reference docs | Check if your API client supports prompt caching | ## See Also - [multi-model-strategy](../../copilot-exclusive/multi-model-strategy/SKILL.md) — when to use which model tier - [team-planner](../../copilot-exclusive/team-planner/SKILL.md) — assigning models per agent in a team - `orchestration/templates/orchestrator-template.md` — model selection guidance in orchestration context
Related Skills
security-audit
Use when a codebase needs a formal security audit beyond a quick scan — applies OWASP Top 10 and STRIDE threat modeling from a CSO perspective to surface systemic vulnerabilities.
token-cost-optimizer
Use before a large Copilot task when model choice, context size, or parallelism could drive up billed usage — estimate cost pressure early and apply Copilot-specific reduction tactics before you run
verification-before-completion
Use before claiming any task is done — run the exact command that proves the fix works, read the output, and only then report success.
using-git-worktrees
Use when you need multiple branches checked out at once — create isolated working directories for parallel development without cloning the repository repeatedly
triage
Use when a single issue needs structured triage — classify it, reproduce if needed, request missing information, and leave a durable brief or close-out note in the tracker.
to-issues
Use when a plan, spec, or PRD must become an actionable backlog — break it into thin dependency-aware issues that each deliver a verifiable vertical slice
sprint-workflow
Use when starting a new feature, refactor, or multi-step dev task — runs the full sprint cycle (Think → Plan → Build → Review → Test → Ship → Monitor) using Copilot CLI's plan/autopilot modes.
sprint-retro
Use at the end of a sprint to run a data-driven retrospective — analyzes session history and git metrics to surface what shipped, what slowed you down, and concrete improvements.
release
Use when a sprint or feature is complete and ready to ship — tags the version, generates GitHub Release notes, runs rollout or smoke verification, and publishes to npm/PyPI/Docker registries.
prompt-optimizer
Use when a rough prompt, vague idea, or task description needs to become a finished copy-pasteable prompt for a chat-based LLM - rewrite it into one ready-to-send prompt with no blanks, no placeholders, and a clear output shape.
outside-voice
Use when you need an independent second opinion before, during, or after implementation — run challenge, consult, or review mode in a direct builder-to-builder voice
llm-wiki
Use when research or domain knowledge keeps getting rediscovered across sessions — build a supplementary markdown wiki that compounds synthesized knowledge without replacing GitHub or committed project guidance