claude

ruflo-cost-tracker

Token usage tracking, model cost attribution per agent, budget alerts, and optimization recommendations

81,589 on GitHubby ruvnetv0.31.3MITupdated today
/

Plugin ruflo-cost-tracker from marketplace ruflo in ruvnet/ruflo. Commands read from the repo's manifest — today.

This plugin runs code on your machine — its hooks fire automatically on events like tool use. The exact commands are listed below; read them before installing.

What it installs

Skills (24)

  • cost-advise

    Optimisation findings from your own Claude Code and Codex logs — low cache hit ratio, 1-hour cache writes that did not pay back, sub-agents on a top-tier model, Codex reasoning share, bloated sessions — each with evidence and a what-if saving. Use when asked how to cut spend or why it is high.

  • cost-anomaly

    MAD-based outlier detection on session spend: lists anomalous sessions with modified-z scores, with an optional --alert-on-outliers exit code for CI. Use when asked which individual session is the cost outlier; cost-burn covers the aggregate trend.

  • cost-benchmark

    Run the corpus benchmark — booster locally, optional Gemini/Sonnet/Opus baselines — and persist a verifiable measured-vs-claimed table

  • cost-booster-edit

    Apply a simple code transform via agent-booster's WASM engine — sub-millisecond, deterministic, $0 (no LLM call). Companion to cost-booster-route.

  • cost-booster-route

    Route tasks through hooks_route, partition by Agent Booster availability, and report Tier 1 bypass utilization with $0 cost

  • cost-budget-check

    Read accumulated cost-tracking spend + budget config, compute utilization, emit 50/75/90/100% alert ladder

  • cost-burn

    Burn-rate trend over time with optional drift-alert exit code. Bins session spend into buckets, surfaces window-over-window delta, and can exit 1 when latest bucket exceeds prior mean by a configurable %. Distinct from `cost-trend` (benchmark drift); this tracks PRODUCTION spend trajectory.

  • cost-compact-context

    Wrap getTokenOptimizer().getCompactContext() to retrieve compacted ReasoningBank context for cost-analysis queries; report bridge-reported tokensSaved

  • cost-conversation

    Per-conversation cost view — list every session in cost-tracking with started-at, message count, top model, and total cost

  • cost-counterfactual

    Multi-baseline counterfactual cost analysis. Compares actual session spend to hypothetical always-haiku / always-sonnet / always-opus routing baselines. Answers "is the routing earning its keep?" Negative savings flag over-escalation; positive savings quantify the router's win.

  • cost-diff

    Snapshot delta between two cost-summary JSON outputs. PR-level cost regression detection — answers "what changed between these two specific snapshots?". Pairs with cost-summary's stable JSON contract.

  • cost-export

    Export cost-tracking telemetry in Prometheus textfile or webhook JSON formats — for external observability (Grafana, Datadog, custom dashboards)

  • cost-federation

    Consumer-side wiring for ADR-097 Phase 3 federation_spend events — per-peer rolling windows + suspension-threshold check

  • cost-health

    Composite CI gate — runs cost-budget-check + cost-burn + cost-anomaly + cost-projection in parallel and surfaces a single combined health status with max exit code. The operationally-useful entry point — one shell-out covers all four alert ladders.

  • cost-ledger

    One cost view across Claude Code, Codex and Grok on this machine — spend, tokens, cache hit ratio per provider and model, with unpriced models flagged. Use when asked "what did I spend", "how much did Codex cost", or to compare providers. Local logs only, nothing is sent.

  • cost-local

    Cost per million tokens on hardware you own (Ollama, llama.cpp, vLLM, LM Studio) from watts, electricity price, hardware price and measured tokens/second, and the utilisation at which local beats a hosted model. Use for local-vs-API break-even questions.

  • cost-openrouter

    OpenRouter real spend — key limit and usage today/week/month, one request's billed cost by generation id, account credits. Use when asked what OpenRouter charged or whether a key is near its limit. Network and API key: asks first.

  • cost-optimize

    Analyze token usage patterns and recommend cost optimizations with estimated savings

  • cost-projection

    Forward-looking spend extrapolation. Computes a USD-per-day rate from the recent measurement window, projects to 7d/30d/90d/365d horizons, and surfaces "days until budget exhausted" when a budget is configured. Predictive counterpart to `cost-budget-check` (reactive).

  • cost-report

    Generate a cost report showing token usage and USD costs by agent and model

  • cost-session

    Per-message cost breakdown within a single session. The drill-down companion to cost-anomaly — when an outlier session is flagged, this surfaces the specific expensive messages so operators can see whether the cost came from output tokens, cache writes, or model escalations.

  • cost-summary

    Single-shot programmatic dump of all cost data — total spend, per-tier, top session, budget status, federation aggregate. JSON or markdown.

  • cost-track

    Auto-capture per-session token usage from the Claude Code session jsonl and persist to the cost-tracking namespace

  • cost-trend

    Read every docs/benchmarks/runs/*.json and surface drift in win rate, latency, escalation rate, and LLM-baseline cost over time

Slash commands (1)

  • /ruflo-cost-tracker:ruflo-cost

    Cost tracking operations — generate reports, view breakdowns, set budgets, and get optimization recommendations

Subagents (1)

  • cost-analyst

    Tracks token usage per agent and model, computes cost attribution in USD, monitors budgets, and recommends optimizations

Hooks (2)

  • SessionStart

    node -e "require(require('path').join(process.env.CLAUDE_PLUGIN_ROOT,'scripts','_secret-env.cjs')).bridge({openrouterApiKey:'OPENROUTER_API_KEY'})"

  • Stop

    node -e "require(require('path').join(process.env.CLAUDE_PLUGIN_ROOT,'scripts','ruflo-hook.cjs'))"

View source on GitHub cognitum.one

More from ruvnet/ruflo

All 52 plugins →

Agentic QE (external: maintained in proffesor-for-testing/agentic-qe, pinned to v3.15.17): a quality-engineering fleet with 11 QE agents, 9 skills, 9 commands, the agentic-qe MCP server pinned to the plugin version, and the aqe-mod guard that refuses destructive operations on AQE learning data

9 skills · 9 commands · 11 agents · 1 MCP server

81,589

Tenant-isolated AI teams that plan work, coordinate tasks, recall approved context, and return evidence-backed results

6 skills · 6 commands · 4 agents · 1 MCP server

81,589

Agent runtimes — local WASM-sandboxed agents (rvagent) + Anthropic Claude Managed Agents (cloud); one interface, local-vs-cloud backends

5 skills · 2 commands · 9 agents

81,589

MetaHarness integration — surfaces score/genome/mint/mcp-scan/threat-model via skills; pairs with @metaharness/router (ADR-148/149) for cost-optimal model routing; honors ADR-150 optional-augmentation constraint

13 skills · 1 command · 1 agent · hooks

81,589

Visual workflow automation with templates, orchestration, and lifecycle management

5 skills · 8 commands · 3 agents

81,589

Neural trading strategies — self-learning LSTM/Transformer/N-BEATS models with Rust/NAPI backtesting

9 skills · 1 command · 4 agents

81,589

Similar plugins

Skill: add headroom-ai compress() to a Python or TypeScript app to cut LLM input tokens (tool outputs, logs, JSON, chat history). No API key.

1 skill

headroomlabs-ai/headroom 79,508

mem0

claudecodex

Cross-session memory and token savings for coding agents.

6 skills · 1 agent · 1 MCP server · hooks

mem0ai/mem0 68,893

azure

claude

Transform Claude into an Azure expert. This plugin integrates the Azure MCP server and specialized Azure skills to move beyond generic advice. It enables Claude to perform real-world tasks: listing resources, validating deployments, diagnosing infrastructure issues, and optimizing costs across 50+ Azure services.

44 skills · 1 MCP server

anthropics/claude-plugins-official 47,076

ifixai

claudecodex

Independent auditing for AI agents, open source. Claude discovers your setup, confirms the cost, and audits your agent against the one question other tools skip: is it doing the job it's supposed to do, given your business rules and org structure? Test any model (Anthropic, OpenAI, Gemini, Azure, Bedrock, …) graded by self, one independent judge, or a cross-vendor panel; each provider is billed to its own account via a key in your settings, never the command line. Results render as an interactive artifact (with a static-report fallback).

1 skill · hooks

ifixai-ai/iFixAi 45,158

Cloud architecture design for AWS/Azure/GCP/OCI, Kubernetes cluster configuration, Terraform infrastructure-as-code, hybrid cloud networking, and multi-cloud cost optimization

8 skills · 7 agents

wshobson/agents 42,461

Adspirer

claude

Cross-platform ad management for Google Ads, Meta Ads, TikTok Ads, and LinkedIn Ads. 91 tools for keyword research, campaign creation, performance analysis, and budget optimization.

15 skills · 5 commands · 1 agent · 1 MCP server

anthropics/knowledge-work-plugins 35,601

Maintain ruflo-cost-tracker?

This page updates itself from your repo. Add the badge to your README, or get it Featured to pin it above the organic results with a followed link to your site.

claude & codex plugins52 plugins