Help us improve
Share bugs, ideas, or general feedback.
Share bugs, ideas, or general feedback.
Share bugs, ideas, or general feedback.
By 0xrdan
Routes Claude Code queries to the optimal model (Haiku/Sonnet/Opus) based on complexity to reduce costs, with persistent knowledge base learning, context forking for multi-step tasks, and detailed usage analytics
npx claudepluginhub 0xrdan/claude-router --plugin claude-routerDisplay knowledge base status and recent learnings
Disable continuous learning mode
Enable continuous learning mode for automatic insight extraction
Clear the knowledge base and start fresh
Extract and persist insights from the current conversation to the knowledge base
Display knowledge base status and recent learnings
Disable continuous learning mode
Enable continuous learning mode for automatic insight extraction
Clear the knowledge base and start fresh
Extract and persist insights from the current conversation to the knowledge base
Uses power tools
Uses Bash, Write, or Edit tools
Share bugs, ideas, or general feedback.
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge.
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge.
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
Automatic model switching for Claude Code based on prompt complexity. No API calls.
Cost-conscious mode for Claude Code. Saves 30-60% on costs through concise responses, model routing, and efficient workflow patterns.
Model routing and workflow patterns for Claude Code. Subagents on Sonnet/Haiku for execution work, hooks for security, slash commands for workflow.
Claude Code workflow patterns: prompting, CLAUDE.md maintenance, multi-agent orchestration
Recursive Language Model integration for Claude Code - intelligent multi-provider routing and unbounded context handling
Claude Code skill pack for Anthropic (30 skills)
Persistent project knowledge for Claude Code - captures patterns, quirks, and decisions
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 Exists | What Claude Router Does |
|---|---|
| Multi-provider routers (OpenRouter, etc.) | Intra-Claude optimization (Haiku/Sonnet/Opus) |
Manual /model switching | Automatic routing via UserPromptSubmit hook |
| Generic LLM complexity scoring | Coding-task specific pattern recognition |
| External API wrapper approach | Native Claude Code integration using subagents |
Technical Achievements:
| Metric | Value |
|---|---|
| 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 |
# 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-marketplaceThen follow the installation steps above.
Automatic routing works out of the box:
Manual override when needed:
/route opus "Design a microservice architecture"
/route haiku "What is JSON?"
View statistics:
/router-stats
| Command | Description |
|---|---|
/route <model> | Override routing for a query |
/router-stats | View usage statistics |
/learn | Extract insights from conversation |
/knowledge | View knowledge base status |
/orchestrate | Execute complex tasks with forking |
/router-analytics | Generate HTML dashboard |
/retry | Retry with escalated model |
/router-plugins | Manage plugin integrations |
See Configuration & Commands for full documentation.
| Document | Description |
|---|---|
| How It Works | Default vs Router behavior, cost savings |
| Routing Rules | Classification rules, example output |
| Configuration | All commands and settings |
| Knowledge System | Persistent learning across sessions |
| Architecture | Project structure, data flow |
| Roadmap | Completed phases, coming soon |
| Contributing | How to contribute |
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:
Result: Same quality, ~40% less cost on complex workflows.
See How It Works for detailed comparison.
Sharing and Contributions are welcome! See CONTRIBUTING.md for guidelines.
MIT License - see LICENSE for details.
Built for the Claude Code community | Report Issues | @dannymonteiro