Intelligent model orchestration for Claude Code - routes queries to optimal Claude model (Haiku/Sonnet/Opus) based on complexity. It also includes many more features. If this project is working well for you and would like to support me, just help spread the word. Thanks!
git clone https://github.com/0xrdan/claude-router.gitClaude Router is a native Claude Code plugin that intelligently routes queries to the most cost-effective Claude model for the task at hand. It uses zero-latency rule-based classification with LLM fallback to determine whether a query is best handled by Haiku, Sonnet, or Opus, automatically optimizing for both performance and cost. Simple queries route to Haiku for ~80% cost savings, while complex analysis escalates to Opus. The plugin includes manual override commands, usage statistics, a persistent knowledge system, and an Opus Orchestrator that delegates subtasks to cheaper models, delivering estimated 40% additional savings on complex workflows. Installation is one-command via the Claude Code plugin marketplace with no configuration required.
1. **Identify the Task**: Clearly define the task you need to accomplish, including its scope, complexity, and output requirements. Use specific criteria like 'depth of analysis,' 'speed,' or 'output quality' to guide the router. 2. **Run the Router**: Paste the task description into your Claude Code environment or chat interface with the claude-router skill enabled. Specify any additional criteria (e.g., 'prioritize speed over depth') to refine the recommendation. 3. **Review the Recommendation**: The router will suggest the optimal model(s) and a step-by-step breakdown. Verify that the justification aligns with your needs. Adjust criteria if the recommendation doesn't fit. 4. **Execute the Task**: Use the recommended model(s) for each step. For multi-step tasks, delegate subtasks to the appropriate models (e.g., Opus for analysis, Haiku for formatting). 5. **Optimize Iteratively**: After completing the task, review the output. If the results are suboptimal, tweak the criteria (e.g., 'prioritize visual quality') and rerun the router to refine the approach.
Reduce API costs on simple coding queries by routing to Haiku instead of Opus
Balance cost and quality for typical coding tasks by automatically routing to Sonnet
Optimize complex architecture design and analysis with smart delegation between models
View usage statistics and cost breakdowns per query and model
No install command available. Check the GitHub repository for manual installation instructions.
git clone https://github.com/0xrdan/claude-routerCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
Act as a claude-router for [TASK_DESCRIPTION]. Analyze the complexity of this task and recommend the optimal Claude model (Haiku/Sonnet/Opus) to handle it. Justify your recommendation based on [CRITERIA: e.g., depth of analysis, speed requirements, output quality]. If the task involves multiple steps, specify how to break it down across models for efficiency.
For the task of 'Analyze the Q3 financial performance of Acme Corp and draft a 10-page report with visualizations,' I recommend using **Claude Opus** for the following reasons:
1. **Depth of Analysis**: The task requires synthesizing financial data, identifying trends, and generating insights—all of which demand Opus's advanced reasoning capabilities. Haiku would struggle with the nuance, and Sonnet might lack the depth for a comprehensive report.
2. **Output Quality**: Opus excels at structured, high-quality outputs, which is critical for a 10-page report. It can handle complex formatting, integrate visualizations (e.g., charts, tables), and ensure coherence across sections.
3. **Efficiency Breakdown**:
- **Step 1 (Opus)**: Parse and analyze the financial data (balance sheets, income statements, cash flow). Identify key metrics like revenue growth, profit margins, and debt-to-equity ratios.
- **Step 2 (Sonnet)**: Draft the initial report structure, including executive summary, key findings, and recommendations.
- **Step 3 (Haiku)**: Generate visualizations (e.g., bar charts for revenue trends, pie charts for expense breakdowns) and format the final document.
**Why not Sonnet?** While Sonnet is capable, it may not deliver the same level of detail or handle the full scope of the task without additional iterations. Haiku is too limited for this use case.
**Pro Tip**: If you're using this in Claude Code, pre-load the financial data into a variable (e.g., `financial_data = load_csv('q3_financials.csv')`) to speed up the analysis phase.Auto-transcribe meetings and generate action items
AI assistant built for thoughtful, nuanced conversation
Get more done every day with Microsoft Teams – powered by AI
Automate your spreadsheet tasks with AI power
Agentic AI Workflow platform
Connected workspace for docs, wikis, and projects
Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan