Token导航 LogoToken导航

Agent Skill · 研究检索

claude-cost-optimization(Claude cost optimization 搜索)

claude-cost-optimization 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

claude-cost-optimization 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证为 MIT,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 42,343。

总安装 1,082周安装 46GitHub Stars 9下载 379核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:claude-cost-optimization(Claude cost optimization 搜索)
来源仓库:https://github.com/adaptationio/skrillz
仓库路径:skills/claude-cost-optimization
安装命令:
npx skills add https://github.com/adaptationio/skrillz --skill claude-cost-optimization
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/adaptationio/skrillz --skill claude-cost-optimization

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

claude-cost-optimization 提供端到端工作流,测量与分析 Claude 部署的 token 开销。重点在于识别低效模式,如冗余上下文、不当模型选择与重复计算,节省 60%-90% 成本。建议结合 telemetry 数据建立基线,再通过 prompt 精简与缓存策略持续优化。

生产环境部署前必须完成成本评估,避免单个代理产生高额意外支出。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

来源仓库内路径:skills/claude-cost-optimization

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/adaptationio/skrillz --skill claude-cost-optim…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

claude-cost-optimization 怎么安装?

在终端执行 npx skills add https://github.com/adaptationio/skrillz --skill claude-cost-optimization。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

claude-cost-optimization 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

claude-cost-optimization 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

claude-cost-optimization 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

claude-cost-optimization 用的人多吗?

公开数据是累计安装 1,082 次,近一周安装 46 次,下载 379 次,GitHub 9 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

claude-cost-optimization 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。
  • 需要许可证清楚、并且有第三方扫描结果的团队项目。

不太适合

  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
claude-cost-optimization

Claude cost optimization 搜索 · 本页

1,0829需要联网MIT通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Claude Cost Optimization

Overview

Cost optimization is critical for production Claude deployments. A single inefficiently-designed agent can cost hundreds or thousands of dollars monthly, while optimized implementations cost 10-90% less for identical functionality. This skill provides a comprehensive workflow for measuring, analyzing, and optimizing token costs.

Why This Matters:

  • Token costs are your largest Claude expense
  • Small improvements compound over millions of API calls
  • Context optimization alone saves 60-90% on long conversations
  • Model + effort selection can reduce costs 5-10x for specific tasks

Key Savings Available:

  • Effort parameter: 20-70% token reduction (same model, different reasoning depth)
  • Context editing: 60-90% reduction on long conversations
  • Tool optimization: 37-85% reduction with advanced tool patterns
  • Prompt caching: 90% reduction on repeated content
  • Model selection: 2-5x cost difference between models

When to Use This Skill

Use claude-cost-optimization when you need to:

  • Track Token Costs: Understand exactly what your Claude implementation costs
  • Identify Expensive Patterns: Find which operations consume the most tokens
  • Measure ROI: Calculate the business value of your Claude integration
  • Optimize for Production: Reduce costs before deploying expensive agents
  • Analyze Cost Drivers: Break down costs by model, feature, endpoint, or time period
  • Plan Budget: Forecast future costs based on growth projections
  • Implement Optimizations: Apply proven techniques (caching, batching, context editing)
  • Set Alerts: Monitor costs and get notified of anomalies or budget overruns

5-Step Optimization Workflow

Step 1: Measure Baseline Usage

Establish your current cost baseline before optimization.

What to Measure:

- Total monthly tokens (input + output)
- Cost breakdown by model
- Top 10 most expensive operations
- Average tokens per request
- Peak usage times and patterns

How to Measure (using Admin API):

from anthropic import Anthropic

client = Anthropic()

# Get monthly usage
response = client.beta.admin.usage_metrics.list(
    limit=30,
    sort_by="date",
)

total_input_tokens = sum(m.input_tokens for m in response.data)
total_output_tokens = sum(m.output_tokens for m in response.data)
total_cost = (total_input_tokens * 0.000005) + (total_output_tokens * 0.000025)
print(f"Monthly cost: ${total_cost:.2f}")

Where to Start: See references/usage-tracking.md for detailed Admin API integration

Step 2: Analyze Cost Drivers

Understand where your costs actually come from.

Identify Expensive Patterns:

  1. Which operations use the most tokens?
  2. Which models cost the most?
  3. Are you using caching effectively?
  4. Are context windows growing unnecessarily?
  5. Are you making redundant API calls?

Create Cost Breakdown (example):

Agent reasoning loops: 45% of costs
File analysis: 25% of costs
Web search: 15% of costs
Classification tasks: 10% of costs
Other: 5% of costs

Key Metrics to Calculate:

  • Cost per transaction
  • Tokens per transaction
  • Cost per business outcome
  • Cost trend (week-over-week)

Step 3: Apply Optimizations

Apply targeted optimizations to your biggest cost drivers.

Effort Parameter (if using Opus 4.5):

  • Complex reasoning: high effort (default)
  • Balanced tasks: medium effort (20-40% savings)
  • Simple classification: low effort (50-70% savings)

Context Editing (for long conversations):

  • Automatic tool result clearing (saves 60-90%)
  • Client-side compaction (saves automatic summarization)
  • Memory tool integration (enables infinite conversations)

Tool Optimization (for large tool sets):

  • Tool search with deferred loading (supports 10K+ tools)
  • Programmatic calling (37% token reduction on data processing)
  • Tool examples (improve accuracy 72% → 90%)

Prompt Caching (for repeated content):

  • Cache system prompts (90% cost reduction on cached portion)
  • Cache repeated files/documents
  • Cache tool definitions

Model Selection:

  • Opus 4.5: $5/M input, $25/M output (complex tasks)
  • Sonnet 4.5: (see references for pricing)
  • Haiku 4.5: (see references for pricing)

Step 4: Track Improvements

Monitor cost reductions and efficiency gains after optimizations.

Metrics to Track:

  • Cost per transaction (before vs after)
  • Total token reduction percentage
  • Quality impact (did results improve or worsen?)
  • Implementation difficulty and time

Measurement Period: Track for 1-2 weeks per optimization to see impact

Example Impact:

Optimization: Client-side compaction on long research tasks
Before: 450K tokens/request, $11.25 cost
After:  180K tokens/request, $4.50 cost
Savings: 60% cost reduction

Step 5: Report ROI

Calculate business value of your optimizations.

ROI Calculation:

Monthly Savings = (Daily Cost × 30) - (Optimized Cost × 30)
Implementation Hours = Time to implement optimizations
Cost per Hour = $100-300 (your eng cost)
Payback Period = (Implementation Hours × Cost per Hour) / Monthly Savings

ROI Example:

Monthly savings: $500/month
Implementation: 8 hours
Cost per hour: $150
Implementation cost: $1,200
Payback period: 2.4 months
First year ROI: 400%

Quick Start - Usage Tracking

Get started with Admin API cost tracking in 5 minutes:

import anthropic
from datetime import datetime, timedelta

client = anthropic.Anthropic()

def get_monthly_costs():
    """Get current month's token costs"""

    # Get usage for last 30 days
    now = datetime.now()
    thirty_days_ago = now - timedelta(days=30)

    response = client.beta.admin.usage_metrics.list(
        limit=30,
        sort_by="date",
    )

    total_input = sum(m.input_tokens for m in response.data)
    total_output = sum(m.output_tokens for m in response.data)

    # Opus 4.5 pricing: $5/M input, $25/M output
    input_cost = total_input * 0.000005
    output_cost = total_output * 0.000025
    total_cost = input_cost + output_cost

    print(f"Last 30 days:")
    print(f"  Input tokens: {total_input:,}")
    print(f"  Output tokens: {total_output:,}")
    print(f"  Input cost: ${input_cost:.2f}")
    print(f"  Output cost: ${output_cost:.2f}")
    print(f"  Total cost: ${total_cost:.2f}")

    return {
        "input_tokens": total_input,
        "output_tokens": total_output,
        "input_cost": input_cost,
        "output_cost": output_cost,
        "total_cost": total_cost
    }

# Run the function
costs = get_monthly_costs()

Quick Start - ROI Calculation

Calculate the business value of your Claude implementation:

def calculate_roi(
    monthly_cost: float,
    monthly_transactions: int,
    cost_before_claude: float = None,
    quality_improvement: float = 1.0
) -> dict:
    """Calculate ROI metrics for Claude implementation"""

    cost_per_transaction = monthly_cost / monthly_transactions

    metrics = {
        "monthly_cost": monthly_cost,
        "monthly_transactions": monthly_transactions,
        "cost_per_transaction": cost_per_transaction,
    }

    # If you had costs before Claude (manual process, previous tool, etc)
    if cost_before_claude:
        savings = cost_before_claude - monthly_cost
        roi_percentage = (savings / cost_before_claude) * 100
        metrics["previous_cost"] = cost_before_claude
        metrics["monthly_savings"] = savings
        metrics["roi_percentage"] = roi_percentage

    # Account for quality improvements
    effective_cost = monthly_cost / quality_improvement
    metrics["quality_adjusted_cost"] = effective_cost

    return metrics

# Example: Research agent replacing manual research
result = calculate_roi(
    monthly_cost=500,          # Claude costs
    monthly_transactions=1000,  # Requests processed
    cost_before_claude=3000,   # Manual research was $3k/month
    quality_improvement=1.5    # Claude results are 50% better
)

print(f"Cost per transaction: ${result['cost_per_transaction']:.4f}")
print(f"Monthly savings: ${result['monthly_savings']:.2f}")
print(f"ROI: {result['roi_percentage']:.0f}%")

Pricing Overview

Current Claude Model Pricing (as of November 2025):

ModelInputOutputBest For
Opus 4.5$5/M$25/MComplex reasoning, agents, coding
Sonnet 4.5$3/M$15/MBalanced performance/cost
Haiku 4.5$0.80/M$4/MSimple tasks, high volume

Cost Impact of Optimization Techniques:

TechniqueSavingsImplementation Difficulty
Effort parameter (medium)20-40%Easy (add 2 lines)
Effort parameter (low)50-70%Easy (add 2 lines)
Context editing60-90%Medium (requires setup)
Tool optimization37-85%Medium (architecture change)
Prompt caching90%Hard (infrastructure)
Model selection50-75%Hard (architecture change)

Example Cost Comparison (1M transactions/month):

Scenario: Classification task

Opus 4.5, high effort:
- Input: 50M tokens @ $5/M = $250
- Output: 10M tokens @ $25/M = $250
- Total: $500/month

Opus 4.5, low effort:
- Input: 50M tokens @ $5/M = $250
- Output: 5M tokens @ $25/M = $125
- Total: $375/month (25% savings)

Haiku 4.5, high effort:
- Input: 50M tokens @ $0.80/M = $40
- Output: 10M tokens @ $4/M = $40
- Total: $80/month (84% savings)

Optimization Decision Tree

START: Have high costs?
  ↓
  Q1: Do you know what's causing the costs?
    NO → Go to Step 2: Analyze Cost Drivers
    YES → Q2: Have you tried effort parameter (Opus 4.5)?
            NO → Apply effort parameter (medium/low)
                 Expect 20-70% savings, 2-4 hours implementation
            YES → Q3: Do you have long conversations (>50K tokens)?
                    NO → Q4: Do you have 10+ tools in your agents?
                            NO → Q5: Can you cache repeated content?
                                    YES → Implement prompt caching
                                          Expect 90% savings on cached
                                    NO → Consider model selection
                                         Expect 2-5x cost reduction
                            YES → Implement tool search + deferred loading
                                  Expect 85% context savings
                    YES → Implement context editing
                          Expect 60-90% savings on long tasks

Common Optimization Scenarios

Scenario 1: Reducing Agent Costs 50%

Before:

  • Opus 4.5 with high effort
  • Long reasoning loops
  • All 20+ tools always loaded
  • Monthly cost: $2,000

Optimizations (in order of impact):

  1. Effort Parameter: Switch to medium effort → 30% savings ($600)
  2. Tool Optimization: Use tool search + deferred loading → 20% savings ($400)
  3. Context Editing: Clear old tool results → 10% savings ($200)
  4. Total: 60% cost reduction to $800/month

Timeline: 20-30 hours implementation

Scenario 2: Reducing Classification Costs 80%

Before:

  • Opus 4.5 high effort (overkill for classification)
  • Simple yes/no decisions
  • Monthly cost: $1,000

Optimizations:

  1. Model Selection: Switch to Haiku 4.5 → 80% savings ($800)
  2. Effort Parameter: Use low effort → Additional 20% on Haiku
  3. Prompt Caching: Cache classification rules → 90% savings on cache
  4. Total: 85% cost reduction to $150/month

Timeline: 5-10 hours implementation

Related Skills

For deeper dives into specific optimization areas, see:

  • claude-opus-4-5-guide: Effort parameter trade-offs and Opus 4.5 capabilities
  • claude-context-management: Context editing strategies (60-90% savings on long conversations)
  • claude-advanced-tool-use: Tool optimization patterns (37-85% efficiency gains)
  • anthropic-expert: Admin API reference and prompt caching basics

For complete optimization strategies, cost prediction models, and ROI measurement frameworks, see references/ directory.

平台分布

github-copilot

30.3%
按下载量换算115

Claude Code

24.38%
按下载量换算92

mcpjam

18.35%
按下载量换算70

moltbot

12.74%
按下载量换算48

windsurf

7.62%
按下载量换算29

zencoder

3.33%
按下载量换算13

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

继续浏览同类 Skills