--- name: cost description: "AI Build Cost Tracker — track how much AI is costing you per feature. Use when user wants to track AI spending, understand cost per feature, optimize AI usage, or budget their Claude/GPT costs." allowed-tools: Bash, Read, Write, Grep --- # AI Build Cost Tracker Know exactly what each feature costs to build with AI. Budget smarter, spend less. ## Process ### Phase 1: Show Current State ```bash node ${CLAUDE_PLUGIN_ROOT}/tools/cost-tracker.mjs show ``` Parse the JSON output for cost history and summary. ### Phase 2: Cost Dashboard Present spending overview: **Total Spend:** - All-time total cost - This week / this month breakdown - Average cost per task **By Task/Feature:** - Ranked list of features by cost (most expensive first) - Flag any outliers (tasks costing 3x+ the average) **By Model:** - Cost breakdown by AI model used - Potential savings from model switching **Daily Trend:** - Last 30 days of daily spending - Identify high-spend days ### Phase 3: Cost Insights Generate actionable insights: 1. **Where money goes** — what types of tasks cost the most (debugging? features? refactoring?) 2. **Optimization opportunities** — tasks that could use a cheaper model 3. **Budget projection** — at current rate, monthly spend estimate 4. **Cost per line of code** — rough estimate based on git diff ### Phase 4: Logging New Costs To log a new cost entry: ```bash node ${CLAUDE_PLUGIN_ROOT}/tools/cost-tracker.mjs log "