[Show and Tell] Vex — intelligent model routing skill (cut API costs 40-70%)
Not a bug — sharing a skill I built.
Vex
Claude Code skill that picks the cheapest model that can handle each task. Typo fix? Haiku. Auth refactor? Opus. Docstrings? Why waste Opus on boilerplate?
Two modes:
- Cloud — Opus thinks, Sonnet builds, Haiku does the boring stuff. No local setup.
- Hybrid — Claude plans, your local Ollama models execute for free.
Result: 40–70% less API spend. Same quality.
How it works
9-step pipeline on every task:
- Classify the task (trivial → architectural) with a confidence score
- Estimate blast radius via grep + git
- Score risk from file types and change patterns
- Estimate context size
- Route to the cheapest capable model
- Execute with optimized prompts
- Detect failures → escalate automatically (Haiku → Sonnet → Opus)
- Log the outcome
- Learn — adjust routing based on actual success rates in your codebase
The adaptive learning is the key differentiator. Most "use cheaper models" advice is static. Vex logs every routing decision and adjusts thresholds based on real data. After a week of use, it knows which models actually work for your repo.
Quick start
git clone https://github.com/yusufdxb/vex.git
cp -r vex/ ~/.claude/skills/vex/
Edit the config at the top of SKILL.md:
ROUTING_MODE: cloud
TIER_1: claude-haiku-4-5
TIER_2: claude-sonnet-4-5
TIER_3: claude-opus-4-6
Triggers automatically on every coding task. Or run /vex to see the routing audit:
ROUTING AUDIT
─────────────
Mode: cloud
Task class: SINGLE_FILE (confidence: 0.85)
Impact: LOW (1 downstream file)
Risk: 1 → MEDIUM
Route: haiku
Historical: haiku 4/5 = 80% for SINGLE_FILE
Cloud mode routing table
| Task | Low risk | Med risk | High+ |
|---|---|---|---|
| Trivial | Haiku | Haiku | Sonnet |
| Mechanical | Haiku | Haiku | Sonnet |
| Single file | Haiku | Sonnet | Sonnet |
| Multi file | Sonnet | Opus | Opus |
| Refactor | Sonnet | Opus | Opus |
| Architectural | Opus | Opus | Opus |
Repo: https://github.com/yusufdxb/vex
License: MIT
Feedback welcome — especially on routing thresholds and anyone running Ollama alongside Claude Code.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗