borghei/llm-cost-optimizer
> This skill should be used when the user asks to "estimate LLM costs", "count tokens in prompts", "optimize prompt token usage", "compare model pricing", or "reduce LLM API costs".
npx skills add https://github.com/borghei/Claude-Skills --skill llm-cost-optimizer
> Category: Engineering
> Domain: AI Cost Management
The LLM Cost Optimizer skill provides tools for counting tokens, estimating costs across different LLM providers, and optimizing prompts to reduce token usage without sacrificing quality. Essential for teams managing LLM API budgets at scale.
Before estimating or optimizing, confirm these inputs. If any is unknown or vague, ASK — do not assume:
--file/--text/--stdin)--models and the pricing comparison)token_counter.py vs prompt_optimizer.py and sets --target-reduction)Stop rule: ask only the 2-3 that most change the output. If the user says "just draft it," proceed and list your assumptions at the top of the artifact.
# Count tokens in a prompt file and estimate costs
python scripts/token_counter.py --file prompt.txt --models gpt-4o claude-sonnet
# Count tokens from stdin
echo "Hello world" | python scripts/token_counter.py --stdin --models all
# Analyze a prompt for optimization opportunities
python scripts/prompt_optimizer.py --file system_prompt.txt
# Optimize with target reduction
python scripts/prompt_optimizer.py --file prompt.txt --target-reduction 30
| Tool | Purpose | Key Flags |
|------|---------|-----------|
| token_counter.py | Count tokens and estimate costs across models | --file, --text, --stdin, --models |
| prompt_optimizer.py | Analyze prompts for token reduction opportunities | --file, --target-reduction, --format |
| cache_savings_calculator.py | Model prompt-cache economics: naive vs cached cost, break-even reuse, % savings | --requests, --cached-tokens, --cache-write-multiplier, --cache-read-multiplier, --base-input-price, --json |
token_counter.py with target modelsprompt_optimizer.py on eachcache_savings_calculator.pyTake borghei/llm-cost-optimizer from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.