How to Use

Try in Chat

Quick

Paste into any AI chat for instant expertise. Works in one conversation -- no setup needed.

Preview prompt
You are an expert Llm Cost Optimizer (Engineering domain).

Estimates LLM token counts and per-request cost across models, flags wasteful prompt text, and models prompt-cache break-even. Use when budgeting LLM spend, comparing models on cost, or trimming prompt tokens.

The agent turns "what will this cost?" into a number with its assumptions shown: estimated tokens, cost per request and per 1,000 requests by model, savings from caching, and prompt text that costs tokens without changing the result. The built-in price table is an illustrative snapshot, not verified

## Your Key Capabilities
- Cost Estimation for New Project
- Prompt Optimization Sprint
- Token Reduction Techniques
- Cost-Effective Model Selection

## How to Help
When the user asks for help in this domain:
1. Ask clarifying questions to understand their context
2. Apply the relevant framework or workflow from your expertise
3. Provide actionable, specific output (not generic advice)
4. Offer concrete templates, checklists, or analysis

For the full skill with Python tools and references, visit:
https://github.com/borghei/Claude-Skills/tree/main/llm-cost-optimizer

---
Start by asking the user what they need help with.
# Add to your project
cs install engineering/llm-cost-optimizer ./

# Or copy directly
git clone https://github.com/borghei/Claude-Skills.git
cp -r Claude-Skills/engineering/llm-cost-optimizer your-project/
# The skill is available in your Codex workspace at:
.codex/skills/llm-cost-optimizer/

# Reference the SKILL.md in your Codex instructions
# or copy it into your project:
cp -r .codex/skills/llm-cost-optimizer your-project/
# The skill is available in your Gemini CLI workspace at:
.gemini/skills/llm-cost-optimizer/

# Reference the SKILL.md in your Gemini instructions
# or copy it into your project:
cp -r .gemini/skills/llm-cost-optimizer your-project/
# Add to your .cursorrules or workspace settings:
# Reference: engineering/llm-cost-optimizer/SKILL.md

# Or copy the skill folder into your project:
git clone https://github.com/borghei/Claude-Skills.git
cp -r Claude-Skills/engineering/llm-cost-optimizer your-project/
# Clone and copy
git clone https://github.com/borghei/Claude-Skills.git
cp -r Claude-Skills/engineering/llm-cost-optimizer your-project/

# Or download just this skill
curl -sL https://github.com/borghei/Claude-Skills/archive/main.tar.gz | tar xz --strip=1 Claude-Skills-main/engineering/llm-cost-optimizer

Run Python Tools

python engineering/llm-cost-optimizer/scripts/tool_name.py --help

Quick Start

# Count tokens and estimate costs. Built-in prices are illustrative; real numbers come from --prices FILE
python3 scripts/token_counter.py --text "Summarize the attached contract in five bullets." --models claude-opus-5-5 claude-sonnet gpt-4o-mini

# Count tokens from stdin
echo "Hello world" | python3 scripts/token_counter.py --stdin --models all

# Costs from your own price file (copy current rates from the providers' pricing pages)
python3 scripts/token_counter.py --file assets/sample_prompt.txt --prices assets/sample_prices.json

# Analyze a prompt: three findings, one per line (role preamble, CoT scaffold, all-caps emphasis)
python3 scripts/prompt_optimizer.py --file assets/sample_prompt.txt
**Exit codes:** 0 report produced; 2 unusable input (missing file, empty input, invalid numbers, unreadable `--prices`).

Related Skills in Engineering

View on GitHub