Model Hierarchy Skill — AI skill for Claude Code
Cost-optimized model routing based on task complexity.
How to install Model Hierarchy Skill
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open zscole/model-hierarchy-skill and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Model Hierarchy Skill does
Cost-optimize AI agent operations by routing tasks to appropriate models based on complexity.
Alternatives in AI
- Oh My Claudecode — 32 specialized agents and 7 execution modes for Claude Code, with smart model routing and automatic paralleliz 10.9k ★
- Codeburn — Free, local tool to track AI coding token usage and cost across 37 tools and agents (Claude Code, Cursor, Code 9.7k ★
- Ante — Ghost in your shell 1.9k ★
README
model-hierarchy-skill
Cost-optimize AI agent operations by routing tasks to appropriate models based on complexity.
The Problem
Most AI agents run everything on expensive models. But 80% of agent tasks are routine: file reads, status checks, formatting, simple Q&A. You're paying $15-75/M tokens for work that $0.14/M tokens handles fine.
The Solution
A skill that teaches agents to classify tasks and route them to the cheapest model that can handle them:
| Task Type | Model Tier | Cost | Examples |
|---|---|---|---|
| Routine (80%) | Cheap | $0.14-0.50/M | File ops, status checks, formatting |
| Moderate (15%) | Mid | $1-5/M | Code gen, summaries, drafts |
| Complex (5%) | Premium | $10-75/M | Debugging, architecture, novel problems |
**Result: ~10x cost reduction** with equivalent quality on the tasks that matter.
Quick Start
OpenClaw
# Copy SKILL.md to your skills directory
cp SKILL.md ~/.openclaw/skills/model-hierarchy/SKILL.md
# Restart gateway to pick up the skill
openclaw gateway restart
Claude Code / Codex
Add to your `CLAUDE.md` or project instructions:
## Model Routing
Before executing tasks, classify complexity:
- ROUTINE (file ops, lookups, formatting) → Use cheapest model
- MODERATE (code, summaries, analysis) → Use mid-tier model
- COMPLEX (debugging, architecture, failures) → Use premium model
When spawning sub-agents, default to cheap models unless task requires more.
Other Agent Systems
See [SKILL.md](SKILL.md) for the full classification rules and integration examples.
Cost Math
Assuming 100K tokens/day:
| Strategy | Monthly Cost |
|---|---|
| Pure Opus | ~$225 |
| Pure Sonnet | ~$45 |
| Hierarchy (80/15/5) | ~$19 |
Testing
# Run classification tests
python -m pytest tests/ -v
# Test specific scenarios
python tests/test_classification.py
Files
model-hierarchy-skill/
...
Related Skills
Cost Optimizer
git clone https://github.com/fullstackcrew-alpha/skill-cost-optimizer Save 60-80% on AI token costs with smart
Mod Squad
Claude Code mods: small plugins for live panes, cost-aware model routing, and safety guards. Install from the
Agentic Engineering
Operate as an agentic engineer using eval-first execution, decomposition, and cost-aware model routing.
Cab
One local gateway for every coding agent. Cost-aware LLM model routing for Claude Code, Codex, OpenCode, and m
Klaatcode
Open-source AI coding agent for the terminal. Claude Code-grade accuracy with smart model routing — uses the r
Crew
CodeCrew - Multi-agent orchestration with intelligent model routing. Subcommands: init, task, status, reindex
Related Agents
LLM FinOps Architect
LLM FinOps Architect specializing in model-tier routing, cost-envelope governance, burn-rate monitoring, per-p
Heavy Task
Executes complex tasks (architecture, multi-file implementation, refactors, deep debugging) delegated by the m
Debug Model Agent
Diagnostic subagent — reports which model is actually executing (verifies agent model: frontmatter routing). U