Skip to content
costs logo

Cost Dashboard Skill

costs

View cost dashboard and spending analytics (project)

SKILL.md

Full skill instructions

Cost Dashboard Skill

Display Devflow cost tracking and spending analytics by reading session data directly.

Usage

/​costs [options]

Options

OptionDescription
--period dayShow today's costs only
--period weekShow this week's costs
--period monthShow this month's costs (default)
--history NShow last N sessions
--story KEYFilter by story key

Prompt

You are displaying the Devflow cost dashboard.

Arguments: $ARGUMENTS

Step 1: Read Configuration

Read the configuration file:

  • Path: tooling/​.automation/​costs/​config.json

This contains:

  • budget_dev: Development budget (USD)
  • subscription_plan: Current plan (free/​pro)
  • subscription_token_limit: Monthly token limit
  • subscription_billing_period_days: Days in billing period
  • display_currencies: Currencies to show
  • currency_rates: Exchange rates

Step 2: Find Session Files

Find all session files:

  • Path pattern: tooling/​.automation/​costs/​sessions/​*.json

Step 3: Read and Aggregate Session Data

For each session file, extract:

  • session_id: Session identifier
  • start_time / end_time: Timestamps
  • story_key: Associated story (if any)
  • entries[]: Array of cost entries with model, input_tokens, output_tokens, cost_usd
  • totals: Aggregated totals for the session

Identify the most recent session as the "current session".

Step 4: Calculate Metrics

Calculate:

  1. Current session tokens/​cost: From the most recent session
  2. Cumulative tokens: Sum of all tokens across ALL sessions this billing period
  3. Cumulative cost: Sum of all cost_usd across ALL sessions
  4. Cost by model: Group costs by model (opus, sonnet, haiku)
  5. Cost by story: Group costs by story_key
  6. Budget usage: (cumulative_cost / budget_dev) * 100
  7. Subscription usage: (cumulative_tokens / subscription_token_limit) * 100
  8. Average cost per session: cumulative_cost / session_count
  9. Average tokens per session: cumulative_tokens / session_count
  10. Input/​output ratio: total_input_tokens / total_output_tokens
  11. Days remaining: Calculate from billing period start
  12. Projected monthly cost: (cumulative_cost / days_elapsed) * 30
  13. Projected token usage: (cumulative_tokens / days_elapsed) * 30

Step 5: Apply Filters

Based on $ARGUMENTS:

  • --period day: Filter sessions from today only
  • --period week: Filter sessions from last 7 days
  • --period month: Filter sessions from last 30 days (default)
  • --history N: Show only last N sessions
  • --story KEY: Filter sessions matching story_key

Step 6: Format Output

Display the dashboard using this format:

=================================================================
                    DEVFLOW COST DASHBOARD
=================================================================
Plan: [plan] | Tokens: [cumulative]/[limit] ([%]%) | [days] days left
This Session: $[current_cost] | Cumulative: $[total_cost]
=================================================================

PERIOD: [period]                        SESSIONS: [count]

--- TOKEN USAGE ---------------------------------------------
                   This Session         Cumulative
Input:             [current_in]         [total_in]
Output:            [current_out]        [total_out]
Total:             [current_total]      [total_total]

I/​O Ratio:         [ratio]:1 (higher = more input-heavy conversations)

--- COST BY MODEL -------------------------------------------
[model]            $[cost]  ([%]%)  [bar]

--- COST BY STORY -------------------------------------------
[story-key]        $[cost]  ([%]%)
(no story)         $[cost]  ([%]%)

--- BUDGET STATUS -------------------------------------------
Spent:     $[total]  /  $[budget]  ([%]%)
[================================--------------------] [%]%

[WARNING] if > 75%: "Approaching budget limit!"
[CRITICAL] if > 90%: "Near budget limit - consider pausing"

--- PROJECTIONS (based on current usage rate) ---------------
Monthly token projection:    [projected] / [limit] ([%]%)
Monthly cost projection:     $[projected_cost]
Avg cost per session:        $[avg_cost]
Avg tokens per session:      [avg_tokens]

--- RECENT SESSIONS -----------------------------------------
[session_id]  [date]  [tokens]  $[cost]  [story or "-"]
[session_id]  [date]  [tokens]  $[cost]  [story or "-"]
[session_id]  [date]  [tokens]  $[cost]  [story or "-"]
(show last 5 sessions)

--- CURRENCIES ----------------------------------------------
$[USD] | E[EUR] | L[GBP] | R$[BRL]
=================================================================

Budget Warnings

Display warnings based on config thresholds:

  • If budget usage > warning_percent (75%): Show [WARNING]
  • If budget usage > critical_percent (90%): Show [CRITICAL]
  • If subscription usage > 80%: Show token limit warning

Notes

  • Format large numbers with K/​M suffixes (e.g., 1.5K, 2.3M)
  • Round costs to 2 decimal places
  • Show percentages to 1 decimal place
  • Use text-based progress bars with = and - characters
  • Current session = most recent session file by timestamp
  • Cumulative = sum of ALL sessions in the billing period
  • If no sessions found, display a message indicating no cost data available
  • Calculate days remaining: billing_period_days - days since first session of period

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View