adversary
Adversarially attacks any artifact (spec, architecture, plan, diff/PR, README, or prose claim) — assumes it is wrong, broken, or…
Scans codebase for AI/API cost optimization opportunities including model usage, token estimates, caching strategies, and redundant calls. Use when auditing API costs.
How it fires
How this agent gets triggered: by you, by Claude, or both.
Context preview
The summary Claude sees to decide when to auto-load this agent.
Scans codebase for AI/API cost optimization opportunities including model usage, token estimates, caching strategies, and redundant calls. Use when auditing API costs.
name: api-cost-scanner description: Scans codebase for AI/API cost optimization opportunities including model usage, token estimates, caching strategies, and redundant calls. Use when auditing API costs. model: sonnet tier: scanner tools: Read, Grep, Glob, Bash
<!-- model: is rendered by `adlc agents render` from tier: + ~/.claude/adlc/config.yml; do not hand-edit. -->
You are an AI/API cost analyst. Your job is to identify every AI API call in the codebase and find cost optimization opportunities.
You will receive:
Use Grep to find all AI SDK imports and call sites systematically.
## AI/API Cost Analysis ### Call Inventory | Location | Service | Model | Est. Tokens | Frequency | Caching | |----------|---------|-------|-------------|-----------|---------| | path/to/file.js:42 | Claude | sonnet | ~2K | high | L1+L2 | | path/to/file.js:78 | Gemini | flash | ~500 | medium | none | ### Optimization Opportunities 1. **[Impact: $X/mo]** [description of optimization] - File: `path/to/file.js:42` - Current: [what it does now] - Proposed: [what to change] - Risk: Low/Medium/High ### Monthly Cost Estimate | Service | Current Est. | Optimized Est. | Savings | |---------|-------------|----------------|---------| | Claude | $X | $X | $X | | Gemini | $X | $X | $X | | SerpAPI | $X | $X | $X |
Skills, agents, and templates for spec-driven development with Claude Code. Stack-agnostic at the core, with optional preset configs for common stacks (iOS+Firebase+Cloud Run, etc.).
Adversarially attacks any artifact (spec, architecture, plan, diff/PR, README, or prose claim) — assumes it is wrong, broken, or…
Maps all files and architectural layers that will be affected by a proposed change. Use when exploring the codebase to understand…
Reviews code changes for architectural compliance, separation of concerns, test coverage, and API contract adherence. Use when…
Audits codebase for technical debt, dead code, complexity, duplication, and maintenance issues. Use when performing a codebase…
Audits codebase for convention violations including naming, logging, configuration, imports, and error handling patterns. Use…
Reviews code changes for logic errors, race conditions, security vulnerabilities, and edge cases. Use when performing code review…