cost-summary

Generates a single-shot JSON or markdown dump of total spend, per-tier costs, and budget status.

70.1k|8.4k|Updated Jun 2, 2025
One-click install
npx skills add https://github.com/ruvnet/claude-flow --skill cost-summary
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cost-summary
Source: https://github.com/ruvnet/claude-flow/tree/main/plugins/ruflo-cost-tracker/skills/cost-summary
Command: npx skills add https://github.com/ruvnet/claude-flow --skill cost-summary

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It gives scripts, dashboards, and other plugins a stable programmatic way to read all cost-tracker data in one call, without requiring MCP tool registration or manual aggregation of cost-tracking and federation-spend sources.

Core Features & Use Cases

  • Unified cost snapshot: Outputs total spend, per-tier and per-model breakdowns, top session, budget utilization, and federation aggregates in one call.
  • Stable JSON contract: The --format json output is designed for other plugins, dashboards, and Slackbots to shell out and parse reliably.
  • Use Case: A monitoring dashboard needs a one-line cost rollup every hour — it runs summary.mjs --format json, parses total_cost_usd and budget.utilization, and alerts when spending crosses a threshold.

Quick Start

Run the cost summary script with the JSON format flag to get a complete snapshot of current spend, budget status, and federation totals.

Frequently Asked Questions about cost-summary

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I get a JSON summary of Claude API cost spending?

Run the summary.mjs script with the --format json flag to get a stable JSON contract containing total_cost_usd, per-tier and per-model breakdowns, top session, budget utilization, and federation aggregates on stdout.

How to check budget utilization from the command line?

Execute the summary script and read the budget object in the output, which reports budget_usd, spent_usd, utilization as a ratio, and a level indicator such as INFO. Use --format json for programmatic parsing.

Does cost-summary work as an MCP tool?

No, it is intentionally exposed as a script rather than an MCP tool. ADR-0002 deferred MCP tool registration because it would require modifying the @claude-flow/cli source, so the script provides equivalent data via a stdout JSON contract.

Can I change the data namespaces used by the cost summary?

Yes, set the SUMMARY_NAMESPACE and SUMMARY_FED_NAMESPACE environment variables to override the default cost-tracking and federation-spend namespaces. SUMMARY_FORMAT can also replace the --format flag.

What is the difference between cost-summary and cost-export?

cost-summary is pull-style: callers run the script and parse its stdout output. cost-export is push-style, sending cost data to Prometheus or a webhook. Both read from the same underlying cost data.