開始使用
Token Optimization Agent

Token Optimization Agent

This agent helps Python teams using the Anthropic or OpenAI SDK safely cut LLM spend without risking regressions. With zero code changes, it maps call sites and runs your test scenarios to rank token waste from missed prompt caching or heavy model tiers. It tests fixes in isolated git worktrees, enforcing a strict "do-no-harm" gate that reverts any patch failing to preserve behavior. It delivers a clear savings audit that converts into verified, behavior-preserving code patches upon opt-in.
#工程#產品#生產力
評分
需要更多評價
已售出
2
使用方式
在 Capafy 上執行
也可用於外部應用程式
由創作者提供
Claude Opus 4.8

Find where your LLM project is using tokens inefficiently and fix it without damaging your product.

image.webp

Who it's for:

  • Teams running Python agents or apps on the Anthropic or OpenAI SDK who
    want to cut their token bill without risking regressions
  • Engineers who know their LLM spend is too high but can't safely hand prompt/model edits to a tool
    they don't trust.

What it does:

  • Maps every LLM call site in your project (static scan).
  • Measures real token usage by running your own scenarios — wrapper telemetry,
    zero code changes.
  • Ranks concrete waste (prompt caching, model tiering) with estimated $/run and
    projected $/month savings.
  • Applies fixes in isolated git worktrees and verifies them against a golden
    baseline.
  • Keeps a durable, independently-measured savings ledger across runs.

Why it's safe:

Every applied edit must pass a do-no-harm gate — your tests pass, your outputs
stay equivalent, and the savings actually materialize — or it is reverted.
Estimated savings never justify keeping an edit; only measured savings do. It runs
read-only by default: it audits and judges, and changes nothing until you
raise the autonomy level.

What you get:

  • A read-only audit (meta_report.md) ranking opportunities with dollar figures.
  • On opt-in, verified patches that provably preserve behavior.
  • A savings ledger and portfolio view across runs.

Requirements:

  • A Python project that calls the Anthropic or OpenAI SDK.
  • A scenarios.yaml describing what the project must keep doing (the skill helps
    you write one).
  • For applying fixes: a git repo. No API key required (a compatible API key only
    sharpens the optional judge).