Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Project remaining workflow cost from per-phase averages — warns on budget ceiling overruns
.claude/skills/hashgraph-online-skill-cost-projections/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-07 | ✗→✓ | ▲ Improved | 50% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 65% | 0% |
| case-12 | ✗→✓ | ▲ Improved | 16% | 0% |
| case-14 | ✗→✓ | ▲ Improved | -26% | 0% |
| case-19 | ✗→✓ | ▲ Improved | 66% | 0% |
> Host: Codex CLI — This skill was designed for Claude Code and adapted for Codex. > Cross-reference commands use installed skill names in Codex rather than /octo:* slash commands. > Use the active Codex shell and subagent tools. Do not claim a provider, model, or host subagent is available until the current session exposes it. > For host tool equivalents, see skills/blocks/codex-host-adapter.md.
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.
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):
~/.claude-octopus/metrics/session-*.jsonl — structured per-phase cost entriesmetrics-tracker.sh output — fallback for legacy sessionsIf fewer than 2 completed steps are available, display only actual spend:
💰 Spent: $0.42 (1 step complete — need 2+ for projection)Calculate the mean cost across all completed steps.
bashavg_cost=$(echo "$total_spent / $completed_count" | bc -l)
Formula:
avg_cost = total_cost / completed_stepsExample: If 3 steps cost $0.30, $0.50, $0.40 → avg = $1.20 / 3 = $0.40/step
Multiply the average cost per step by the number of remaining steps.
bashremaining_steps=$((total_steps - completed_count)) projected_remaining=$(echo "$avg_cost * $remaining_steps" | bc -l) projected_total=$(echo "$total_spent + $projected_remaining" | bc -l)
Formula:
projected_remaining = avg_cost × remaining_steps
projected_total = total_spent + projected_remainingStep counts by workflow type: | Workflow | Total Steps | Example Phases | |----------|-------------|----------------| | embrace | 4 | Discover, Define, Develop, Deliver | | research | 3-7 | Per-agent probe count | | review | 3 | Fleet, Verifier, Synthesis | | debate | 3 | Opening, Rebuttal, Synthesis |
Format the cost projection for the HUD/statusline display.
Standard display:
💰 Spent: $2.40 | Est. remaining: $3.60 | Total: ~$6.00Format rules:
~ to indicate estimate💰 prefix for the cost lineWhen insufficient data (< 2 steps):
💰 Spent: $0.42 (need 2+ steps for projection)Integration: This display line is emitted by the octopus-hud hook and rendered in the statusline alongside phase progress and provider status.
If the OCTO_BUDGET_CEILING environment variable is set, compare the projected total against it and warn on overrun.
bashif [[ -n "${OCTO_BUDGET_CEILING:-}" ]]; then ceiling="$OCTO_BUDGET_CEILING" if (( $(echo "$projected_total > $ceiling" | bc -l) )); then overage=$(echo "$projected_total - $ceiling" | bc -l) echo "⚠️ Budget ceiling: \$$ceiling — projected to exceed by \$$overage" fi fi
Display when over budget:
💰 Spent: $2.40 | Est. remaining: $3.60 | Total: ~$6.00
⚠️ Budget ceiling: $5.00 — projected to exceed by $1.00Display when within budget:
💰 Spent: $2.40 | Est. remaining: $3.60 | Total: ~$6.00
✅ Within budget ceiling: $10.00Note: OCTO_BUDGET_CEILING is optional. When unset, no ceiling check is performed.
If the projected total is high relative to the task, suggest switching to the budget profile to reduce costs.
bash# Suggest budget profile when projected total exceeds $5.00 (configurable) COST_THRESHOLD="${OCTO_COST_THRESHOLD:-5.00}" if (( $(echo "$projected_total > $COST_THRESHOLD" | bc -l) )); then echo "💡 Tip: Switch to OCTO_PROFILE=budget to reduce costs" fi
Display:
💰 Spent: $2.40 | Est. remaining: $3.60 | Total: ~$6.00
💡 Tip: Switch to OCTO_PROFILE=budget to reduce costsThe budget profile (OCTO_PROFILE=budget) routes to cheaper models and reduces agent count to minimize spend.
Normal — within budget, moderate cost:
💰 Spent: $2.40 | Est. remaining: $3.60 | Total: ~$6.00Over budget ceiling:
💰 Spent: $2.40 | Est. remaining: $3.60 | Total: ~$6.00
⚠️ Budget ceiling: $5.00 — projected to exceed by $1.00
💡 Tip: Switch to OCTO_PROFILE=budget to reduce costsEarly in workflow (insufficient data):
💰 Spent: $0.42 (need 2+ steps for projection)Low cost — no warnings:
💰 Spent: $0.80 | Est. remaining: $0.80 | Total: ~$1.60The cost projection line is rendered as part of the HUD statusline output, updated after each phase completes.
Reads per-phase cost data written by the metrics tracker. Each completed phase logs cost, token counts, and provider details.
When OCTO_PROFILE=budget is active, the projection accounts for reduced per-step costs from cheaper model routing.
No metrics directory:
💰 Cost projection unavailable — no metrics data foundCorrupted metrics data: Skip malformed entries and project from valid data only. If no valid entries remain, show unavailable message.
Zero remaining steps: When all steps are complete, show final total only:
💰 Final cost: $4.80 (4 steps)| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 16,930 | 15,214 | -10% | 1 | 1 | 0% | 2,407 | 2,058 | -14% | 0 | 0 | — |
case-02 | fail→fail | 11,377 | 10,900 | -4% | 1 | 1 | 0% | 1,141 | 2,042 | +79% | 0 | 0 | — |
case-03 | fail→fail | 14,973 | 10,650 | -29% | 1 | 1 | 0% | 1,350 | 2,154 | +60% | 0 | 0 | — |
case-04 | pass→pass | 9,565 | 3,177 | -67% | 1 | 1 | 0% | 1,100 | 2,542 | +131% | 0 | 0 | — |
case-05 | pass→pass | 9,126 | 2,616 | -71% | 1 | 1 | 0% | 940 | 2,434 | +159% | 0 | 0 | — |
case-06 | pass→pass | 8,893 | 13,593 | +53% | 1 | 1 | 0% | 1,749 | 3,491 | +100% | 0 | 0 | — |
case-07 | fail→pass | 12,989 | 7,733 | -40% | 1 | 1 | 0% | 1,524 | 2,283 | +50% | 0 | 0 | — |
case-08 | fail→pass | 8,461 | 2,209 | -74% | 1 | 1 | 0% | 1,346 | 2,220 | +65% | 0 | 0 | — |
case-09 | pass→pass | 16,876 | 7,852 | -53% | 1 | 1 | 0% | 2,117 | 2,230 | +5% | 0 | 0 | — |
case-10 | pass→pass | 9,629 | 2,377 | -75% | 1 | 1 | 0% | 1,597 | 2,223 | +39% | 0 | 0 | — |
case-11 | pass→pass | 13,885 | 7,241 | -48% | 1 | 1 | 0% | 1,497 | 2,138 | +43% | 0 | 0 | — |
case-12 | fail→pass | 10,488 | 2,095 | -80% | 1 | 1 | 0% | 1,848 | 2,144 | +16% | 0 | 0 | — |
case-13 | pass→pass | 13,011 | 8,436 | -35% | 1 | 1 | 0% | 1,610 | 2,671 | +66% | 0 | 0 | — |
case-14 | fail→pass | 18,190 | 6,986 | -62% | 1 | 1 | 0% | 2,856 | 2,121 | -26% | 0 | 0 | — |
case-19 | fail→pass | 8,406 | 10,288 | +22% | 1 | 1 | 0% | 1,699 | 2,825 | +66% | 0 | 0 | — |
case-15 | pass→pass | 9,220 | 5,024 | -46% | 1 | 1 | 0% | 1,664 | 2,513 | +51% | 0 | 0 | — |
case-16 | pass→pass | 7,800 | 6,854 | -12% | 1 | 1 | 0% | 1,375 | 2,127 | +55% | 0 | 0 | — |
case-17 | fail→pass | 16,050 | 6,868 | -57% | 1 | 1 | 0% | 1,961 | 2,152 | +10% | 0 | 0 | — |
case-18 | pass→pass | 17,499 | 8,307 | -53% | 1 | 1 | 0% | 1,710 | 2,322 | +36% | 0 | 0 | — |
case-20 | pass→pass | 13,301 | 3,530 | -73% | 1 | 1 | 0% | 1,468 | 2,385 | +62% | 0 | 0 | — |
case-21 | fail→pass | 12,543 | 2,885 | -77% | 1 | 1 | 0% | 1,308 | 2,338 | +79% | 0 | 0 | — |
case-22 | pass→pass | 12,514 | 2,252 | -82% | 1 | 1 | 0% | 1,231 | 2,186 | +78% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 19 counted toward the lift figure. The other 3 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +32 percentage points is the difference between those two pass rates over the 19 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.