Cost awareness and token efficiency for agentic coding sessions. Provides model pricing references, task cost estimation heuristics, model selection guidance, and efficiency patterns to reduce token waste.
45:Te3f,
This skill brings cost and token awareness to agentic coding sessions. Claude Code does not expose token counts or cost metrics to plugins directly, so this skill works through estimation heuristics, behavioral nudges, and reference data.
Claude Code does not provide:
This means the plugin cannot measure actual usage. Instead, it provides the tools to reason about cost before, during, and after work.
Before starting a task, estimate its token cost using heuristics from references/task_cost_heuristics.md. Given a task description and an understanding of the codebase, estimate the number of file reads, tool calls, and output tokens required, then calculate a cost range for each model tier using .
references/pricing_table.mdGiven a task description, recommend the right model tier (Opus, Sonnet, or Haiku) based on task complexity, reasoning requirements, and cost tradeoffs. Use the decision tree and capability matrix from references/model_capabilities.md.
The PreToolUse hook on Read provides a soft reminder to use offset and limit parameters instead of reading entire files. The efficiency patterns in references/efficiency_patterns.md document 8 token-saving techniques for Claude Code tool usage.
The PreCompact hook fires before context compression and prompts a brief audit of token efficiency in the session. It writes findings to .claude/token-efficiency.md as a persistent reference. The /cost-audit command provides on-demand auditing without waiting for compression.
Load these from ${CLAUDE_PLUGIN_ROOT}/skills/cost-reasoning/references/:
| File | Purpose |
|---|---|
pricing_table.md | Current model pricing per million tokens |
model_capabilities.md | What each model tier is good and bad at, with decision tree |
task_cost_heuristics.md | Token estimates by task type with cost formulas |
efficiency_patterns.md | 8 token-saving patterns for Claude Code tool usage |
/cost-estimate)task_cost_heuristics.md to map task type to token rangespricing_table.md for current model pricing/model-pick)model_capabilities.md for the decision treepricing_table.md/cost-audit).claude/token-efficiency.md (written by PreCompact hook)pricing_table.md includes a "last updated" date. Verify against Anthropic's official pricing page for critical decisions.