mcpField
C
cco-tools

cco-tools

github.com/egorfedorovAgent workflows12551 installsUpdated 1d ago
Repository

About cco-tools

cco-tools tracks measured token costs for tool results and reports usage by tool name. It helps users of MCP-heavy Claude sessions identify where context budget is spent and which estimates need more samples.

Key features

  1. 01Measured average and worst-case cost per tool
  2. 02Cumulative spend and call counts
  3. 03Flags estimates with fewer than three samples
  4. 04Reset learned cost history

Use cases

  1. 01Find tools consuming the most context budget
  2. 02Spot unpredictable tools and narrow their queries
  3. 03Refresh measurements after changing MCP configuration

MCP support

It measures the token cost of MCP and Agent tool results; it does not provide an MCP server.

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/egorfedorov/claude-context-optimizer --skill cco-tools

After installing, type/cco-toolsin Claude Code to confirm it loaded.

Details

From the project README

CCO Tools — what your tools really cost

MCP and Agent token costs used to be constants picked once (mcp__* ≈ 200 in, Agent ≈ 500). Real results vary by orders of magnitude — a "list all issues" query and a one-row lookup are the same tool name and nowhere near the same cost. On MCP-heavy sessions the budget meter was guessing at its biggest line item.

CCO now measures every tool result and learns the average per tool name.

Run from the plugin root:

show (or no arguments)

node ${CLAUDE_PLUGIN_ROOT}/src/tool-costs.js

Prints the learned table: calls, average, worst case, and cumulative total per tool, sorted by total spend.

When reading it back to the user, the useful observations are:

  • The top row by total is where their context budget actually goes. It is frequently an MCP server rather than file reads.
  • A row marked · has fewer than 3 samples and is still using the built-in constant — its estimate isn't trustworthy yet.
  • A large gap between avg and max means that tool is unpredictable; suggest narrowing its queries (filters, limits, pagination) rather than dropping it.

Pair with /cco-overhead mcp — that shows which servers are configured but never called; this shows what the called ones actually cost.

reset

node ${CLAUDE_PLUGIN_ROOT}/src/tool-costs.js reset

Clears the learned table and returns every tool to its built-in constant. Useful after changing MCP servers or their configuration, when past measurements no longer describe the current setup. Confirm before running — the history isn't recoverable.

Comments

Markdown supported