--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
1---2name: costs3description: View cost dashboard and spending analytics (project)4---56# Cost Dashboard Skill
78Display Devflow cost tracking and spending analytics by reading session data directly.
910## Usage
1112```
13/costs [options]
14```
1516## Options
1718| Option | Description |
19|--------|-------------|
20| --period day | Show today's costs only |
21| --period week | Show this week's costs |
22| --period month | Show this month's costs (default) |
23| --history N | Show last N sessions |
24| --story KEY | Filter by story key |
2526## Prompt
2728You are displaying the Devflow cost dashboard.
2930**Arguments:** $ARGUMENTS
3132### Step 1: Read Configuration
3334Read the configuration file:
35- Path: `tooling/.automation/costs/config.json`
3637This contains:
38- `budget_dev`: Development budget (USD)
39- `subscription_plan`: Current plan (free/pro)
40- `subscription_token_limit`: Monthly token limit
41- `subscription_billing_period_days`: Days in billing period
42- `display_currencies`: Currencies to show
43- `currency_rates`: Exchange rates
4445### Step 2: Find Session Files
4647Find all session files:
48- Path pattern: `tooling/.automation/costs/sessions/*.json`
4950### Step 3: Read and Aggregate Session Data
5152For each session file, extract:
53- `session_id`: Session identifier
54- `start_time` / `end_time`: Timestamps
55- `story_key`: Associated story (if any)
56- `entries[]`: Array of cost entries with `model`, `input_tokens`, `output_tokens`, `cost_usd`
57- `totals`: Aggregated totals for the session
5859Identify the most recent session as the "current session".
6061### Step 4: Calculate Metrics
6263Calculate:
641. **Current session tokens/cost**: From the most recent session
652. **Cumulative tokens**: Sum of all tokens across ALL sessions this billing period
663. **Cumulative cost**: Sum of all `cost_usd` across ALL sessions
674. **Cost by model**: Group costs by model (opus, sonnet, haiku)
685. **Cost by story**: Group costs by story_key
696. **Budget usage**: (cumulative_cost / budget_dev) * 100
707. **Subscription usage**: (cumulative_tokens / subscription_token_limit) * 100
718. **Average cost per session**: cumulative_cost / session_count
729. **Average tokens per session**: cumulative_tokens / session_count
7310. **Input/output ratio**: total_input_tokens / total_output_tokens
7411. **Days remaining**: Calculate from billing period start
7512. **Projected monthly cost**: (cumulative_cost / days_elapsed) * 30
7613. **Projected token usage**: (cumulative_tokens / days_elapsed) * 30
7778### Step 5: Apply Filters
7980Based on $ARGUMENTS:
81- `--period day`: Filter sessions from today only
82- `--period week`: Filter sessions from last 7 days
83- `--period month`: Filter sessions from last 30 days (default)
84- `--history N`: Show only last N sessions
85- `--story KEY`: Filter sessions matching story_key
8687### Step 6: Format Output
8889Display the dashboard using this format:
9091```
92=================================================================
93 DEVFLOW COST DASHBOARD
94=================================================================
95Plan: [plan] | Tokens: [cumulative]/[limit] ([%]%) | [days] days left
96This Session: $[current_cost] | Cumulative: $[total_cost]
97=================================================================
9899PERIOD: [period] SESSIONS: [count]
100101--- TOKEN USAGE ---------------------------------------------
102 This Session Cumulative
103Input: [current_in] [total_in]
104Output: [current_out] [total_out]
105Total: [current_total] [total_total]
106107I/O Ratio: [ratio]:1 (higher = more input-heavy conversations)
108109--- COST BY MODEL -------------------------------------------
110[model] $[cost] ([%]%) [bar]
111112--- COST BY STORY -------------------------------------------
113[story-key] $[cost] ([%]%)
114(no story) $[cost] ([%]%)
115116--- BUDGET STATUS -------------------------------------------
117Spent: $[total] / $[budget] ([%]%)
118[================================--------------------] [%]%
119120[WARNING] if > 75%: "Approaching budget limit!"
121[CRITICAL] if > 90%: "Near budget limit - consider pausing"
122123--- PROJECTIONS (based on current usage rate) ---------------
124Monthly token projection: [projected] / [limit] ([%]%)
125Monthly cost projection: $[projected_cost]
126Avg cost per session: $[avg_cost]
127Avg tokens per session: [avg_tokens]
128129--- RECENT SESSIONS -----------------------------------------
130[session_id] [date] [tokens] $[cost] [story or "-"]
131[session_id] [date] [tokens] $[cost] [story or "-"]
132[session_id] [date] [tokens] $[cost] [story or "-"]
133(show last 5 sessions)
134135--- CURRENCIES ----------------------------------------------
136$[USD] | E[EUR] | L[GBP] | R$[BRL]
137=================================================================
138```
139140### Budget Warnings
141142Display warnings based on config thresholds:
143- If budget usage > `warning_percent` (75%): Show [WARNING]
144- If budget usage > `critical_percent` (90%): Show [CRITICAL]
145- If subscription usage > 80%: Show token limit warning
146147### Notes
148149- Format large numbers with K/M suffixes (e.g., 1.5K, 2.3M)
150- Round costs to 2 decimal places
151- Show percentages to 1 decimal place
152- Use text-based progress bars with = and - characters
153- Current session = most recent session file by timestamp
154- Cumulative = sum of ALL sessions in the billing period
155- If no sessions found, display a message indicating no cost data available
156- Calculate days remaining: billing_period_days - days since first session of period
Run npx skillmds add majiayu000/costs in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
View cost dashboard and spending analytics (project) It is listed under Data & Analytics on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Capability flags: reads secrets. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
majiayu000 (@majiayu000) published this skill. Their other Agent Skills are listed on their SkillMD profile.