By laran
Cost analytics, budget alerts, and tier-rollup reporting on top of Claude Code's official OpenTelemetry. Reads claude_code.cost.usage (USD-attributed by Claude Code itself), joins to agent-telemetry's session_context events for branch/issue/tier dimensions, and provides /cost-report, /cost-budget-check, and a Haiku-tier cost-analyst agent. Pricing.yml is fallback / override only — Claude Code's metric is authoritative.
npx claudepluginhub laran/claude-agent-costCheck current spend against budgets defined in config/budgets.yml. Emits an alert ladder (info / warning / critical / hard_stop) and exits non-zero when hard_stop is tripped. Use when investigating a cost spike, before launching a parallel-fanout dispatch, or as a cron / pre-commit gate.
Print a cost rollup table by branch / issue / tier / agent / model / day / session, joining Claude Code's claude_code.cost.usage metric with agent-telemetry's session_context events. Use when investigating where Claude Code spend is going, comparing dispatch costs across PRs / issues / tiers, or producing a periodic spend summary.
Uses power tools
Uses Bash, Write, or Edit tools
Share bugs, ideas, or general feedback.
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge.
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge.
Sign in to claimComprehensive .NET development skills for modern C#, ASP.NET, MAUI, Blazor, Aspire, EF Core, Native AOT, testing, security, performance optimization, CI/CD, and cloud-native applications
Comprehensive skill pack with 66 specialized skills for full-stack developers: 12 language experts (Python, TypeScript, Go, Rust, C++, Swift, Kotlin, C#, PHP, Java, SQL, JavaScript), 10 backend frameworks, 6 frontend/mobile, plus infrastructure, DevOps, security, and testing. Features progressive disclosure architecture for 50% faster loading.
The most comprehensive Claude Code plugin — 48 agents, 182 skills, 68 legacy command shims, selective install profiles, and production-ready hooks for TDD, security scanning, code review, and continuous learning
Upstash Context7 MCP server for up-to-date documentation lookup. Pull version-specific documentation and code examples directly from source repositories into your LLM context.
Binary reverse engineering, malware analysis, firmware security, and software protection research for authorized security research, CTF competitions, and defensive security
Comprehensive startup business analysis with market sizing (TAM/SAM/SOM), financial modeling, team planning, and strategic research
Cost analytics, budget alerts, and tier-rollup reporting on top of Claude Code's official OpenTelemetry.
A query-time consumer of telemetry the substrate already produces:
claude_code.cost.usage
metric — USD-attributed per API request by Claude Code itself, with
query_source ∈ main|subagent|auxiliary. We do not duplicate this.agent.session_context events from
claude-agent-telemetry — link claude.session.id →
workflow.branch / workflow.issue_number.tiers.yml (shared with agent-telemetry) maps
subagent_type → haiku|sonnet|opus for cross-model bucketing.| Path | Purpose |
|---|---|
bin/cost-report.sh | Joins cost metric + session_context + tier mapping; prints markdown table by branch / issue / tier / agent / model / day / session |
bin/cost-budget-check.sh | Alert-ladder check against config/budgets.yml; exits 1 on hard_stop |
bin/cost-export.sh | Periodic Prometheus textfile export of cost rollups |
config/pricing.yml | Fallback / override pricing — only used when CC's cost.usage is unavailable or for what-if analysis |
config/budgets.yml | Budget definitions (empty by default — opt-in) |
skills/cost-report | /cost-report --by <dim> [--since <duration>] |
skills/cost-budget-check | /cost-budget-check [--budget <name>] |
agents/cost-analyst | Haiku-tier read-only analyst — surfaces tier mismatches, cache outliers, fan-out outliers, budget pacing |
docs/SETUP.md | End-to-end setup, including PreToolUse hook integration for budget gating |
docs/QUERIES.md | PromQL / LogQL / TraceQL reference for cost analysis |
/plugin marketplace add laran/claude-methodology
/plugin install agent-telemetry@claude-methodology # required substrate
/plugin install agent-cost@claude-methodology
Then docs/SETUP.md.
# Cost split by query_source over the last day
bin/cost-report.sh --by tier --since 24h --filter query_source=subagent
# Cost per branch over the last week
bin/cost-report.sh --by branch --since 7d
# Budget check (after editing config/budgets.yml)
bin/cost-budget-check.sh --format json
┌──────────────────────────────────────────┐
│ Claude Code's official OTel │
│ claude_code.cost.usage (USD) │
│ claude_code.token.usage{type, model, │
│ query_source} │
└─────────────────┬────────────────────────┘
│
┌─────────────────┴──────────────────────┐
│ │
▼ ▼
Prometheus Loki (agent.session_context
(cost / token metrics) events from agent-telemetry)
│ │
└────────────────┬───────────────────────┘
▼
bin/cost-report.sh
bin/cost-budget-check.sh
│
▼
/cost-report, /cost-budget-check,
cost-analyst agent
tiers.yml is shared with
agent-telemetry.agent-orchestration.cost-budget-check.sh exits non-zero;
it doesn't kill dispatches itself. The CALLER (a hook, cron, CI) is
responsible for halting work.--by agent falls back to --by model granularity; precise
per-subagent_type rollup needs to join cost with the trace-level
subagent_type attribute. Tracked for v1.1.--by day does not bucket per-day; use Grafana time-series panels
for daily breakdowns. Tracked for v1.1.query_source. tier,
branch_pattern, model planned for v1.1.MIT.