Dt Obs Genai
Dynatrace/dynatrace-for-ai
Analyze & debug GenAI/LLM apps: token cost & caching by prompt, model & provider; latency/errors; agent & tool loops/failures; conversations; guardrails; evaluations; OpenTelemetry/dt-evals setup.
Comprehensive cost tracking and optimization for production Claude deployments.
$ npx skills add majiayu000/claude-skill-registry --skill claude-cost-optimization -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install majiayu000/claude-skill-registry claude-cost-optimization --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/majiayu000/claude-skill-registry.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/ai-llm/claude-cost-optimization .claude/skills/claude-cost-optimization && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "claude-cost-optimization" agent skill from https://github.com/majiayu000/claude-skill-registry/tree/main/skills/ai-llm/claude-cost-optimization into .claude/skills/claude-cost-optimization/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "claude-cost-optimization", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/majiayu000/claude-skill-registry/tree/main/skills/ai-llm/claude-cost-optimizationType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add majiayu000/claude-skill-registry --skill claude-cost-optimization -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install majiayu000/claude-skill-registry claude-cost-optimization --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/majiayu000/claude-skill-registry.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/ai-llm/claude-cost-optimization .agents/skills/claude-cost-optimization && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "claude-cost-optimization" agent skill from https://github.com/majiayu000/claude-skill-registry/tree/main/skills/ai-llm/claude-cost-optimization into .agents/skills/claude-cost-optimization/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "claude-cost-optimization", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add majiayu000/claude-skill-registry --skill claude-cost-optimization -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install majiayu000/claude-skill-registry claude-cost-optimization --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/majiayu000/claude-skill-registry.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/ai-llm/claude-cost-optimization .cursor/skills/claude-cost-optimization && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "claude-cost-optimization" agent skill from https://github.com/majiayu000/claude-skill-registry/tree/main/skills/ai-llm/claude-cost-optimization into .cursor/skills/claude-cost-optimization/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "claude-cost-optimization", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/majiayu000/claude-skill-registry.git --path skills/ai-llm/claude-cost-optimization--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add majiayu000/claude-skill-registry --skill claude-cost-optimization -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install majiayu000/claude-skill-registry claude-cost-optimization --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/majiayu000/claude-skill-registry.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/ai-llm/claude-cost-optimization .gemini/skills/claude-cost-optimization && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "claude-cost-optimization" agent skill from https://github.com/majiayu000/claude-skill-registry/tree/main/skills/ai-llm/claude-cost-optimization into .gemini/skills/claude-cost-optimization/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "claude-cost-optimization", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install majiayu000/claude-skill-registry claude-cost-optimizationInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add majiayu000/claude-skill-registry --skill claude-cost-optimization -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/majiayu000/claude-skill-registry.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/ai-llm/claude-cost-optimization .github/skills/claude-cost-optimization && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "claude-cost-optimization" agent skill from https://github.com/majiayu000/claude-skill-registry/tree/main/skills/ai-llm/claude-cost-optimization into .github/skills/claude-cost-optimization/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "claude-cost-optimization", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add majiayu000/claude-skill-registry --skill claude-cost-optimization -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install majiayu000/claude-skill-registry claude-cost-optimization --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/majiayu000/claude-skill-registry.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/ai-llm/claude-cost-optimization .opencode/skills/claude-cost-optimization && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "claude-cost-optimization" agent skill from https://github.com/majiayu000/claude-skill-registry/tree/main/skills/ai-llm/claude-cost-optimization into .opencode/skills/claude-cost-optimization/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "claude-cost-optimization", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
claude-cost-optimizationComprehensive cost tracking and optimization for production Claude deployments.
Claude Cost Optimization is an agent skill from majiayu000/claude-skill-registry. Comprehensive cost tracking and optimization for production Claude deployments. Covers Admin API usage tracking, efficiency measurement, ROI calculation, optimization patterns (caching, batching, model selection, context editing, effort parameter), and cost prediction. Use when tracking costs, optimizing token usage, measuring efficiency, calculating ROI, reducing production expenses, or implementing cost-effective Claude integrations.
Its SKILL.md is about 3.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file (for example `metadata.json`).
It sits in AI & LLM Engineering, covering LLM cost and token optimization, Deployment and Caching. The repository describes itself as: Searchable Claude Code skills catalog with source-linked guides and generated registry artifacts. The licence is MIT.
5 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 000116a. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are python).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Claude Cost Optimization loads about 3.1k tokens when it runs. Until then it costs about 116 tokens; SKILL.md has 819 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from majiayu000/claude-skill-registry at commit 000116a, republished under its MIT licence (© majiayu000). 819 words, ~3,140 tokens.
.claude/skills/claude-cost-optimization/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.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:
Key Savings Available:
Use claude-cost-optimization when you need to:
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 patternsHow 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
Understand where your costs actually come from.
Identify Expensive Patterns:
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 costsKey Metrics to Calculate:
Apply targeted optimizations to your biggest cost drivers.
Effort Parameter (if using Opus 4.5):
Context Editing (for long conversations):
Tool Optimization (for large tool sets):
Prompt Caching (for repeated content):
Model Selection:
Monitor cost reductions and efficiency gains after optimizations.
Metrics to Track:
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 reductionCalculate 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 SavingsROI 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%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()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}%")Current Claude Model Pricing (as of November 2025):
| Model | Input | Output | Best For |
|---|---|---|---|
| Opus 4.5 | $5/M | $25/M | Complex reasoning, agents, coding |
| Sonnet 4.5 | $3/M | $15/M | Balanced performance/cost |
| Haiku 4.5 | $0.80/M | $4/M | Simple tasks, high volume |
Cost Impact of Optimization Techniques:
| Technique | Savings | Implementation Difficulty |
|---|---|---|
| Effort parameter (medium) | 20-40% | Easy (add 2 lines) |
| Effort parameter (low) | 50-70% | Easy (add 2 lines) |
| Context editing | 60-90% | Medium (requires setup) |
| Tool optimization | 37-85% | Medium (architecture change) |
| Prompt caching | 90% | Hard (infrastructure) |
| Model selection | 50-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)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 tasksBefore:
Optimizations (in order of impact):
Timeline: 20-30 hours implementation
Before:
Optimizations:
Timeline: 5-10 hours implementation
For deeper dives into specific optimization areas, see:
For complete optimization strategies, cost prediction models, and ROI measurement frameworks, see references/ directory.
© majiayu000, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 1 other file in skills/ai-llm/claude-cost-optimization of majiayu000/claude-skill-registry.
Open the folder on GitHubat commit 000116a
We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in majiayu000/claude-skill-registry, which our catalogue first saw on October 7, 2026.
Claude Cost Optimization next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Claude Cost Optimization this skillmajiayu000/claude-skill-registry | 666 | 1 repos | ~3.1k | Automated safety check: Pass | MIT | |
| Dt Obs GenaiDynatrace/dynatrace-for-ai | 161 | — | ~4.5k | Automated safety check: Pass | Apache-2.0 | |
| Continue Enable DefaultsOnlyTerp/prompt-cache-skills | 114 | — | ~977 | Automated safety check: Pass | Custom licence | |
| Commandkit Cacheneplexlabs/commandkit | 165 | — | ~506 | Automated safety check: Pass | MIT | |
| LLM Cost Optimizationsickn33/agentic-awesome-skills | 47k | 1 repos | ~2.5k | Automated safety check: Pass | MIT | |
| LLM Gatewaysickn33/agentic-awesome-skills | 47k | 1 repos | ~2.1k | Automated safety check: Pass | MIT |
Dynatrace/dynatrace-for-ai
Analyze & debug GenAI/LLM apps: token cost & caching by prompt, model & provider; latency/errors; agent & tool loops/failures; conversations; guardrails; evaluations; OpenTelemetry/dt-evals setup.
OnlyTerp/prompt-cache-skills
Continue's prompt caching is opt-in via config and off by default.
neplexlabs/commandkit
Implement deterministic caching with @commandkit/cache. An agent skill from neplexlabs/commandkit.
sickn33/agentic-awesome-skills
Reduce LLM API and infrastructure costs through model selection, prompt caching, batching, caching, quantization, and self-hosting strategies.
sickn33/agentic-awesome-skills
Deploy an API gateway for LLM traffic with load balancing, rate limiting, key management, semantic caching, fallback routing, and cost tracking.
microsoft/ai-agents-for-beginners
Take a working agent prototype to a scalable, observable production deployment on Microsoft Foundry.
majiayu000/claude-skill-registry
Multi-source deep research using firecrawl and exa MCPs. An agent skill from majiayu000/claude-skill-registry.
majiayu000/claude-skill-registry
Neural search via Exa MCP for web, code, and company research.
majiayu000/claude-skill-registry
Unified media generation via fal.ai MCP — image, video, and audio.
majiayu000/claude-skill-registry
Search scientific papers and retrieve structured experimental data extracted from full-text studies via the BGPT MCP server.
majiayu000/claude-skill-registry
Perform pairwise sequence alignment using Biopython Bio.Align.PairwiseAligner.
majiayu000/claude-skill-registry
Self-hosted, open-source alternative to Google NotebookLM for AI-powered research and document analysis.
Comprehensive cost tracking and optimization for production Claude deployments. Claude Cost Optimization is an agent skill from majiayu000/claude-skill-registry. Comprehensive cost tracking and optimization for production Claude deployments.
Claude Cost Optimization fits situations like: optimizing token usage; measuring efficiency; calculating ROI; reducing production expenses.
Run `npx skills add majiayu000/claude-skill-registry --skill claude-cost-optimization -a claude-code`. Or copy the skill folder (skills/ai-llm/claude-cost-optimization in majiayu000/claude-skill-registry) into .claude/skills/claude-cost-optimization in your project. Claude Code loads it when a task matches its description.
Run `npx skills add majiayu000/claude-skill-registry --skill claude-cost-optimization -a codex`. Or copy the skill folder (skills/ai-llm/claude-cost-optimization in majiayu000/claude-skill-registry) into .agents/skills/claude-cost-optimization in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add majiayu000/claude-skill-registry --skill claude-cost-optimization -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/claude-cost-optimization, .gemini/skills/claude-cost-optimization, .github/skills/claude-cost-optimization and .opencode/skills/claude-cost-optimization in your project.
SKILL.md names no scripts, command-line tools or credentials: Claude Cost Optimization is instructions for the agent only. Our summary lists: Python 3.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Claude Cost Optimization is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 3.1k tokens (SKILL.md is roughly 13k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Claude Cost Optimization: Dt Obs Genai (Dynatrace/dynatrace-for-ai, 161 stars), Continue Enable Defaults (OnlyTerp/prompt-cache-skills, 114 stars), Commandkit Cache (neplexlabs/commandkit, 165 stars) and LLM Cost Optimization (sickn33/agentic-awesome-skills, 47k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
majiayu000 (a GitHub user) maintains it in majiayu000/claude-skill-registry, which has 666 GitHub stars. The repository holds 971 skills in this directory. The repository was last updated on October 7, 2026.
Source: majiayu000/claude-skill-registry on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.