Claude Router

    by Rohit Gampa

    1

    Claude Code plugin that sorts each prompt into simple, medium or complex, then picks the Claude model, thinking effort and validator for it, so your subscription goes further.

    Free

    Security scanned

    Works with the AI Agents you already use

    Claude Router

    Example session with this skill installed

    Migrate the auth module from server-side sessions to JWT across the API and the React frontend, keep refresh tokens working, and update the tests. #validate

    • Read your context and instructions
    • Compiled the claude router

    Summary

    Claude Router classified the prompt before it ran and routed it to the

    complex tier. #validate was stripped from the prompt and turned the validator on for the session.

    Status line after the prompt:

    router: complex/mid · opus:high → sonnet:high · val fable:high
    

    How the prompt was routed

    StepWhat happened
    ClassifierHaiku rated it a multi-file change with design decisions, not just a question, and with no bug report or reproduction steps
    Tiercomplex (mid band)
    Main loopOpus at high effort plans the migration and delegates
    ExecutorsSonnet subagents at high effort make the edits and run the tests
    ValidatorOn (forced by #validate); reviews the result and ends with VERDICT: PASS or FAIL
    LogOne counts-only line appended to ~/.claude-router/log.jsonl

    The same session, later prompts

    PromptStatus line
    now add tests for token expiry (6 words)router: complex/mid (kept) · opus:high → sonnet:high · val fable:high (tier kept, so the cache survives; no classifier call)
    /clear then what does the refresh endpoint return?router: simple/low · haiku:low · val off
    Fix: login returns 500 when email has a plus sign. Steps: ...router: medium/mid · haiku:medium → haiku:medium · val off. A bug report with steps to reproduce is never routed to complex; Opus takes over only if an executor reports STATUS: FAILED or a test fails

    Next steps

    • Watch the status line for a few sessions; add #complex or #simple when you disagree with a call.
    • Run node eval/catch-rate.mjs to see how often the router caught a failed cheap attempt.
    • Tune the cut-offs in logic.ts (TIERS, EFFORT, CUTS) if your work skews hard or easy.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Most prompts don't need your biggest model. Claude Router is a Claude Code plugin (installed as router) that reads each prompt before it runs, sorts it into simple, medium or complex, and picks which Claude model does the work, how hard it thinks, and whether a validator checks the result.

    What it does

    • Haiku classifier: before each prompt, Claude Haiku answers three questions: how much effort the request needs, whether it is only a question, and whether it includes an error or steps to reproduce. Fixed cut-offs turn the answers into a tier. Cost: up to about $0.001 of your own usage per prompt.
    • Keyword fallback: if the Haiku call fails, a simple keyword check decides.
    • Tiers: simple runs on a small model alone; medium has Haiku orchestrate Haiku subagents, with Opus taking over after a caught failure; complex has Opus orchestrate Sonnet executors with a validator.
    • Sticky tiers: switching models mid-conversation throws away the prompt cache, so the tier only moves down while a conversation is short. Follow-ups of six words or fewer keep the current tier.
    • Status line: shows tier, models and effort after every prompt.
    • Manual override tags: #simple #medium #complex force a tier; #validate / #novalidate / #autovalidate control the validator. Tags are stripped before the model sees the prompt.
    • Private, counts-only log at ~/.claude-router/log.jsonl (no prompt text). Set ROUTER_LOG=0 to turn it off.

    What it saves

    On 500 SWE-bench issues (Claude 4.5 models, API prices), routing cost 16–32% less than always using Opus while solving 1.1–5.6 points fewer; against always-Sonnet the saving was 3–22%. Orchestration overhead isn't in that data, so expect real savings to be lower.

    Install

    /plugin install router --marketplace gamparohit/claude-router
    

    Answer y to add the marketplace, pick user scope, start a new session. Nothing else to install.

    Status

    Early release. The hooks are tested against Claude Code's plugin test kit with stubbed model calls, but haven't yet been verified in a live session. Reports from real use, including "it worked", are very welcome on GitHub. MIT licensed.

    Adds approximately $0.001 cost and short latency per prompt. Haiku evaluator has not been verified in a live session.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Free to use

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 12 days ago

    • Free with an Agensi account

    Accounts
    Claude subscription
    orAnthropic API access
    Software
    Claude Code
    Optional
    Node.js (only for the eval/ scripts)

    Permissions

    Terminal / Shell
    Network Access
    Read Files
    Write Files
    Environment Variables

    Hooks read each prompt to classify it with a small Claude Haiku request (your own Claude usage, up to ~$0.001/prompt). The only file written is a counts-only log at ~/.claude-router/log.jsonl (no prompt text); set ROUTER_LOG=0 to disable.

    Listed12 days ago

    What's inside

    Creator

    Rohit Gampa

    Rohit Gampa

    Frequently Asked Questions

    This skill automates the selection of the most cost-effective Claude model for every prompt, preventing you from wasting budget on expensive reasoning for simple tasks like basic syntax checks or file lookups.

    The skill is purpose-built for Claude Code; once installed via the /plugin command, it operates natively within your terminal environment to route prompts dynamically.

    The full plugin source: the TypeScript routing logic and Claude Code hooks, an HTML explainer with diagrams, and the Node.js/Python evaluation scripts used for the SWE-bench savings estimate. The SWE-bench data itself is not included.

    It adds one small Claude Haiku call before each prompt. Measured through the claude CLI that took about 5 s, of which the model call was about 0.75 s; the plugin calls Haiku directly at low effort, which should be faster but has not yet been timed in a live session. Short follow-ups of six words or fewer skip the call entirely.

    Yes, you can manually override the automatic classification by using tags like #complex for high-stakes tasks or #simple for quick queries to force a specific model tier.

    New in LLM Ops

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for LLM Ops.

    Free