AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Cost Breakdown

skill-hoangsonww-claude-code-agent-monitor-cost-breakdown · by hoangsonww

>

No reviews yet
0 installs
16 views
0.0% view→install

Install

$ agentstack add skill-hoangsonww-claude-code-agent-monitor-cost-breakdown

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-hoangsonww-claude-code-agent-monitor-cost-breakdown)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
1mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Cost Breakdown? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Cost Breakdown

Detailed cost analysis from the Agent Monitor's pricing engine.

Input

The user provides: $ARGUMENTS

This may be: "today", "this week", "last 30 days", a session ID, or "budget $50/week".

Data Sources

| Endpoint | Returns | |----------|---------| | GET /api/pricing | { pricing: [{ model_pattern, display_name, input_per_mtok, output_per_mtok, cache_read_per_mtok, cache_write_per_mtok }] } | | GET /api/pricing/cost | Total cost: { total_cost, breakdown: [{ model, input_tokens, output_tokens, cache_read_tokens, cache_write_tokens, cost, matched_rule }] } | | GET /api/pricing/cost/{sessionId} | Per-session cost with same breakdown shape | | GET /api/sessions?limit=200 | Sessions list — each includes inline cost field (bulk pricing) | | GET /api/analytics | Token totals (totalinput, totaloutput, totalcacheread, totalcachewrite — baselines pre-summed), daily trends |

How costs are calculated

The pricing engine matches model names against model_pattern using SQL LIKE (e.g. claude-sonnet-4-5% matches claude-sonnet-4-5-20250514). Longest pattern wins for specificity. Cost per model:

cost = (input_tokens / 1M) × input_per_mtok
     + (output_tokens / 1M) × output_per_mtok
     + (cache_read_tokens / 1M) × cache_read_per_mtok
     + (cache_write_tokens / 1M) × cache_write_per_mtok

Token counts are effective totals = current + baseline (baselines preserve pre-compaction tokens that would otherwise be lost when the transcript JSONL is rewritten).

Default pricing tiers (seeded on first run)

| Family | Input $/Mtok | Output $/Mtok | Cache Read $/Mtok | Cache Write $/Mtok | |--------|-------------|--------------|-------------------|-------------------| | Opus 4.5/4.6 | $5 | $25 | $0.50 | $6.25 | | Sonnet 4/4.5/4.6 | $3 | $15 | $0.30 | $3.75 | | Haiku 4.5 | $1 | $5 | $0.10 | $1.25 |

Report Sections

1. Cost by Model

Table from /api/pricing/cost breakdown — each model with 4 token counts + cost. Highlight which pricing rule matched.

2. Cost by Session (Top 10 Most Expensive)

From sessions list with inline cost — sort descending. Show session name, model, duration, cost.

3. Daily Cost Trend

Cross-reference daily_sessions with per-session costs to compute daily spend. Show 7/30-day trend with direction arrows.

4. Token Efficiency Analysis

  • Cache hit rate: total_cache_read / (total_cache_read + total_input) × 100 — higher = more efficient
  • Compaction baseline recovery: Tokens preserved via baseline columns (tokens not lost to compaction)
  • Output/input ratio: Balanced ratio indicates good prompt efficiency

5. Cost Optimization Opportunities

  • Sessions where cachewrite >> cacheread (poor cache reuse)
  • Expensive models used for simple tasks (check subagent_type vs model)
  • Sessions with many compactions (context overflow = wasted tokens)

Output

Structured Markdown with tables. Currency as USD to 4 decimal places. Include total and per-model subtotals.

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.