By 0xrdan
Route queries to optimal Claude models (Haiku/Sonnet/Opus) based on complexity, manage a persistent project knowledge base, execute complex tasks via forked Opus contexts with delegate agents, and monitor usage statistics and cost savings.
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
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
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
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
npx claudepluginhub 0xrdan/claude-router --plugin claude-routerPersistent project knowledge for Claude Code - captures patterns, quirks, and decisions
Automatic model switching for Claude Code based on prompt complexity. No API calls.
Claude Code workflow patterns: prompting, CLAUDE.md maintenance, multi-agent orchestration
Claude Code skill pack for Anthropic (30 skills)
Delegate plan execution to Codex CLI via ASP. Part of cc-multi-cli-plugin. Requires the `multi` plugin.
Recursive Language Model integration for Claude Code - intelligent multi-provider routing and unbounded context handling
Multi-model consensus engine integrating OpenAI Codex CLI, Gemini CLI, and Claude CLI for collaborative code review and problem-solving.