Overview
WorkWeave Router is a smart model routing layer that sits directly inside Claude Code, Codex CLI, and Cursor to automatically select the cheapest model capable of handling each request. The project gained 216 points on Hacker News. Rather than being a separate service, it hooks into the agent CLI directly: install once, save on every subsequent request. Request complexity is classified heuristically (and with LLM-based classification for ambiguous cases), then routed across Anthropic, OpenAI, Google Gemini, DeepSeek, and OpenRouter. Users report 5-10x cost reduction on typical coding workflows, with a policy file (.workweave.yaml) for per-repo routing overrides.
Features
- ✓Direct CLI integration: Claude Code, Codex CLI, Cursor
- ✓Automatic complexity classification (heuristic + LLM)
- ✓Multi-provider: Anthropic, OpenAI, Gemini, DeepSeek, OpenRouter
- ✓Per-session and per-project cost dashboard
- ✓Automatic fallback chains on provider failure
- ✓Zero-config sensible defaults
- ✓Per-repo routing policies via .workweave.yaml
Installation
npm install -g @workweave/routerPros
- +Real, measurable cost savings
- +Drop-in CLI integration
- +Transparent routing
- +Budget controls
- +Policy-file based per-repo routing
- +Popular on HN (216 points)
Cons
- −Heuristic classification not always perfect
- −CLI-specific, doesn't work with HTTP APIs directly
- −Young project, single maintainer
- −Savings depend on workload mix
- −Request content is inspected for routing
Alternatives
Documentation
WorkWeave Router
Overview
WorkWeave Router is a smart model routing layer that sits directly inside Claude Code, Codex CLI, and Cursor to automatically select the cheapest model capable of handling each request. The project gained 216 points on Hacker News, the highest of the batch, signaling real developer appetite for model-routing infrastructure.
The problem: developers using Claude Code, Codex, or Cursor typically pin to one model (often Opus or GPT-5) and pay full price for every token, even on trivial tasks like ls or single-line edits. WorkWeave Router inspects each request, classifies complexity, and routes to the smallest model that will get the job done — typically a 3–10x cost reduction.
The design is deliberately thin: rather than being a separate service, it hooks into the agent CLI directly. Install once, save on every subsequent request.
Features
- Direct CLI integration: native plugins for Claude Code, Codex CLI, and Cursor
- Automatic complexity classification: heuristic + LLM-based routing
- Multi-provider support: routes across Anthropic, OpenAI, Google Gemini, DeepSeek, OpenRouter
- Cost dashboard: track per-session and per-project savings
- Fallback chains: automatic retry on provider failure
- Zero-config defaults: sensible routing policies out of the box
- Policy file: override routing with a
.workweave.yamlin your repo
Installation
# Global install
npm install -g @workweave/router
# Claude Code integration
workweave install --agent claude-code
# Codex CLI integration
workweave install --agent codex
# Cursor integration
workweave install --agent cursor
Configuration
Create .workweave.yaml:
providers:
primary: anthropic
fallback:
- openai
- gemini
routing:
simple:
model: claude-haiku-4-5
match:
- "file search"
- "list files"
- "simple edit"
medium:
model: claude-sonnet-4-6
match:
- "multi-file edit"
- "code review"
complex:
model: claude-opus-4-7
match:
- "architecture"
- "complex refactor"
- "security review"
budget:
daily_limit_usd: 5.00
per_session_usd: 1.00
Usage
Once installed, you just use your normal CLI — the router is transparent:
# Claude Code, as usual
claude "Fix the bug in auth.ts"
# Router automatically picks:
# - claude-haiku-4-5 for file lookup
# - claude-sonnet-4-6 for the edit
# - claude-opus-4-7 only for verification
Cost Dashboard
workweave stats
Sample output:
Session: 2026-08-28 10:34
Requests: 47
Total cost: $0.83
Without router: $6.14
Savings: 86.5%
Breakdown:
haiku-4-5: 24 requests ($0.09)
sonnet-4-6: 20 requests ($0.51)
opus-4-7: 3 requests ($0.23)
Pros
- ✅ Real, measurable savings: users report 5–10x cost reduction on typical coding workflows
- ✅ Drop-in CLI integration: install once, no workflow changes
- ✅ Transparent routing: you can see what was chosen per request
- ✅ Budget controls: daily and per-session USD limits
- ✅ Policy-file based: reproducible routing per repo
- ✅ Popular on HN: 216 points, active community
Cons
- ❌ Heuristic classification: not always perfect, occasional over/under-routing
- ❌ CLI-specific: doesn't work with HTTP APIs directly
- ❌ Young project: ~150 GitHub stars, single maintainer
- ❌ Cost savings depend on workload: trivial-heavy workflows see 10x savings, complex-only workloads see none
- ❌ Privacy consideration: request content is inspected for routing decisions
When to Use
Use WorkWeave Router when:
- You use Claude Code, Codex, or Cursor daily and want to slash token costs
- Your workloads are heterogeneous — mixes of trivial and complex tasks
- You're budget-conscious but unwilling to compromise on model quality for complex tasks
- You want an opinionated default with tunable overrides
Prefer alternatives when:
- You're hitting API directly (Python/TypeScript SDKs) — use a gateway like OpenRouter or OmniRoute
- You need complex orchestration — a router alone won't replace LangGraph
- You want fully offline routing — WorkWeave's classifier calls the API
