Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

cost-optimize

Skill by ruvnet

Analyzes recent token usage across agents and models to find waste and recommend cost optimizations. Each recommendation includes an estimated dollar saving. It is for teams running AI agents who want to lower spending.

  • Score 89
  • 83k stars
  • MIT
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install cost-optimize

Built from the published package, never by AI.

git clone --depth 1 https://github.com/ruvnet/ruflo /tmp/ruflo && mkdir -p ~/.claude/skills && cp -r /tmp/ruflo/plugins/ruflo-cost-tracker/skills/cost-optimize ~/.claude/skills/cost-optimize

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install cost-optimize in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

This agent skill reviews token usage across agents and models over the last 7 days, using data from the cost-tracking namespace. It checks whether each agent's model tier fits its task complexity, flags agents with cache hit rates below 60%, and looks for redundant or batchable agent work. For each recommendation it estimates current cost, projected cost, dollar savings, and percentage reduction.

The skill ranks its recommendations and lists quick wins first. It also searches earlier optimization patterns and stores new ones, and it emits model outcome events so the routing system can learn from downgrades. The source is built on ruflo MCP tools and the @claude-flow/cli package. It is aimed at developers and operators who want to reduce the cost of their AI agent workloads.

Written from the project's SKILL.md and checked against it.

What it can do

  • Load usage dataSearches the cost-tracking namespace for the last 7 days of agent usage.
  • Analyze model fitChecks whether each agent's model tier matches the complexity of its tasks.
  • Check cache ratesComputes cache hit rate per agent and recommends prompt caching if it is below 60%.
  • Detect redundancyFinds agents with overlapping tasks or work that could be batched.
  • Estimate savingsCalculates current cost, projected cost, dollar savings and percentage reduction for each recommendation.
  • Search prior patternsSearches stored optimization patterns from earlier runs for reusable advice.
  • Store optimization patternsSaves new cost optimization patterns for later reuse.
  • Emit model outcome eventsRuns outcome.mjs to record success or escalation after a model downgrade.
  • Report ranked recommendationsShows ranked recommendations, total potential savings and implementation priority.

What you need

  • Ruflo MCP tools (ruflo-core plugin)
  • Node.js to run the outcome.mjs script
  • npx access to @claude-flow/cli
  • Existing usage data in the cost-tracking namespace

Try asking

  • Analyze my token usage from the last 7 days and suggest cost savings
  • Check which agents have cache hit rates below 60 percent
  • Find agents running simple tasks on a more expensive model than needed

Good to know

  • Analysis covers the last 7 days of data in the cost-tracking namespace.
  • Savings are estimates calculated from the usage data.
  • Requires the ruflo MCP tools and the @claude-flow/cli package.

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: plugins/ruflo-cost-tracker/skills/cost-optimize/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work

Inside the skill

Allowed tools: mcp__plugin_ruflo-core_ruflo__memory_search mcp__plugin_ruflo-core_ruflo__memory_list mcp__plugin_ruflo-core_ruflo__memory_store mcp__plugin_ruflo-core_ruflo__agentdb_pattern-search mcp__plugin_ruflo-core_ruflo__agentdb_pattern-store mcp__plugin_ruflo-core_ruflo__agentdb_semantic-route mcp__plugin_ruflo-core_ruflo__hooks_model-outcome Bash

  • SKILL.md4 KB

Alternatives to cost-optimize

All alternatives →

Compare with setup-zoom-webhooks, baoyu-post-to-weibo or add-dial-number

cost-optimize: common questions

What data does cost-optimize analyze?

It loads usage data from the cost-tracking namespace for the last 7 days. It looks at model selection, cache utilization, agent redundancy and prompt efficiency.

How does it estimate savings?

For each recommendation it calculates the current cost, the projected cost after optimization, the dollar savings and the percentage reduction.

Does it learn from its recommendations?

For downgrade recommendations it emits hooks_model-outcome events through outcome.mjs, so the router can learn whether the downgrade worked or had to be escalated.

How do I install cost-optimize?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is cost-optimize free?

The code is published under the MIT licence. The service it connects to may have its own pricing.

Is cost-optimize safe to use?

It scores 89 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to cost-optimize?

Similar skills: setup-zoom-webhooks, baoyu-post-to-weibo, add-dial-number, setup-zoom-websockets.

cost-optimize Install

Add to stack

Loading.