Claude Router

January 13, 2026 · View on GitHub

Intelligent model orchestration for Claude Code - Automatically routes queries to the optimal Claude model (Haiku/Sonnet/Opus) based on complexity, reducing costs by up to 80% without sacrificing quality.

What Makes This Novel

What ExistsWhat Claude Router Does
Multi-provider routers (OpenRouter, etc.)Intra-Claude optimization (Haiku/Sonnet/Opus)
Manual /model switchingAutomatic routing via UserPromptSubmit hook
Generic LLM complexity scoringCoding-task specific pattern recognition
External API wrapper approachNative Claude Code integration using subagents

Technical Achievements:

  • Zero-latency rule-based classification with LLM fallback
  • Token-optimized agent definitions (3.4k vs 11.9k tokens)
  • Multi-turn context awareness and follow-up detection
  • Persistent knowledge system across sessions

Key Metrics

MetricValue
Classification latency~0ms (rules) or ~100ms (LLM fallback)
Classification cost$0 (rules) or ~$0.001 (Haiku fallback)
Cost savings (simple queries)~80% (Haiku vs Opus)
Cost savings (mixed workload)Est. 50-70%
Additional savings (orchestration)~40% on complex tasks

Installation

# Step 1: Add the marketplace (one-time, per project)
/plugin marketplace add 0xrdan/claude-plugins

# Step 2: Install the plugin
/plugin install claude-router

# Step 3: Restart Claude Code session to activate

That's it! The plugin automatically routes queries - no configuration needed.

# Update
/plugin marketplace update 0xrdan-plugins

# Uninstall
/plugin uninstall claude-router

Migrating from old marketplace? If you previously installed via claude-router-marketplace, run:

/plugin uninstall claude-router@claude-router-marketplace
/plugin marketplace remove claude-router-marketplace

Then follow the installation steps above.

Quick Start

Automatic routing works out of the box:

  • Simple queries → Haiku (fast, cheap)
  • Coding tasks → Sonnet (balanced)
  • Complex analysis → Opus (powerful)

Manual override when needed:

/route opus "Design a microservice architecture"
/route haiku "What is JSON?"

View statistics:

/router-stats

Commands

CommandDescription
/route <model>Override routing for a query
/router-statsView usage statistics
/learnExtract insights from conversation
/knowledgeView knowledge base status
/orchestrateExecute complex tasks with forking
/router-analyticsGenerate HTML dashboard
/retryRetry with escalated model
/router-pluginsManage plugin integrations

See Configuration & Commands for full documentation.

Documentation

DocumentDescription
How It WorksDefault vs Router behavior, cost savings
Routing RulesClassification rules, example output
ConfigurationAll commands and settings
Knowledge SystemPersistent learning across sessions
ArchitectureProject structure, data flow
RoadmapCompleted phases, coming soon
ContributingHow to contribute

How It Works

Claude Router intercepts queries and routes them to the optimal model:

"What is JSON?"        → Haiku   (~\$0.01)  ✓ Fast, cheap
"Fix this typo"        → Haiku   (~\$0.01)  ✓ Fast, cheap
"Run all tests"        → Sonnet  (~\$0.03)  ✓ Balanced
"Design architecture"  → Opus    (~\$0.06)  ✓ Powerful

For complex tasks, the Opus Orchestrator delegates subtasks to cheaper models:

  • Opus handles strategy → expensive reasoning
  • Haiku handles file reads → cheap I/O
  • Sonnet handles edits → balanced implementation

Result: Same quality, ~40% less cost on complex workflows.

See How It Works for detailed comparison.

Contributing

Sharing and Contributions are welcome! See CONTRIBUTING.md for guidelines.

License

MIT License - see LICENSE for details.


Built for the Claude Code community | Report Issues | @dannymonteiro