skill-cost-projections

Featured

Project remaining workflow cost from per-phase averages — warns on budget ceiling overruns

AI & Automation 3,887 stars 365 forks Updated today MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Cost Projections Skill ## Overview Projects remaining workflow cost based on per-phase averages from completed work. Displays cost data in the HUD/statusline and warns when projected totals exceed a configured budget ceiling. **Minimum data requirement:** Needs **2+ completed steps** before projecting. With fewer than 2 data points, the average is unreliable — display actual spend only and skip projection. --- ## Step 1: Collect Completed Phase Costs Read cost data from `~/.claude-octopus/metrics/` or from metrics-tracker.sh output. Each completed phase/step should have an associated cost entry. ```bash # Read metrics from the session metrics directory METRICS_DIR="$HOME/.claude-octopus/metrics" SESSION_METRICS="$METRICS_DIR/session-$(date +%Y%m%d).jsonl" # Each line contains: {"phase": "discover", "cost": 0.42, "tokens_in": 12000, "tokens_out": 3400, "timestamp": "..."} # Sum costs from completed steps completed_costs=$(jq -s '[.[].cost]' "$SESSION_METRICS") completed_count=$(jq -s 'length' "$SESSION_METRICS") total_spent=$(jq -s '[.[].cost] | add' "$SESSION_METRICS") ``` **Data sources (in priority order):** 1. `~/.claude-octopus/metrics/session-*.jsonl` — structured per-phase cost entries 2. `metrics-tracker.sh` output — fallback for legacy sessions 3. HUD accumulated cost counters — last resort If fewer than 2 completed steps are available, display only actual spend: ``` 💰 Spent: $0.42 (1 step complete — need 2+ for projection) ``` --- ## Step 2: Compute Av...

Details

Author
nyldn
Repository
nyldn/claude-octopus
Created
6 months ago
Last Updated
today
Language
Shell
License
MIT

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category