tgiridhar

Claude Code Jev Smart Router — AI skill for Claude Code

AI community

HTTP proxy for Claude Code that selects the Claude model per request to cut cost and latency.

How to install Claude Code Jev Smart Router

This entry records only its repository, not the path inside it, so there is no exact command to give. Open tgiridhar/claude-code-jev-smart-router and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Claude Code Jev Smart Router does

HTTP proxy for Claude Code that selects the Claude model per request to cut cost and latency. Routes on task phase and the cost of an undetected error, gated by prompt-cache arithmetic. Proof of concept.

Alternatives in AI

  • Adopt AI Properly — Workflow recipe — the org-side AI adoption arc, policy to proof, by chaining 4 skills 1.3k ★
  • Aurora — Aurora - independent community smart home orchestrator 103 ★
  • PDF Proof — Trust, but check 76 ★

README

claude-code-jev-smart-router

An HTTP proxy for Claude Code that selects the Claude model per request, to reduce cost and latency.

Motivation

Claude Code serves a session from one selected model, changing it only at fixed points (see [Routing logic](#routing-logic)) rather than according to what each request requires. That model handles every request in the agentic loop, including the ones that do not need it: file reads, greps, test runs, commit messages.

Routing those requests to a lower tier has three effects:

Effect Mechanism
Cost Lower tiers have lower per-token prices, for input and output both.
Latency Smaller models return sooner. Separately, lower effort reduces the number of agentic turns a step takes.
Usage limits On a Pro, Max or Team subscription there is no per-token bill. Routing consumes less of the plan's allowance instead.

Classification adds one API call per routed request: a fraction of a cent, and well under a second of added latency. That is small enough to sit in the request path, which is what makes per-request routing possible at all. See [The classifier](#the-classifier).

Prompt cache constraint

Prompt caching limits how often switching is worthwhile. Each model has a separate cache, so a mid-conversation switch causes the new model to re-read the conversation prefix at full input price. In a long session that prefix accounts for most of the token volume, so switching on every request can cost more than using a single model throughout.

The proxy prices each switch against the cache rebuild it would cause and applies it only when it pays back within a few turns. See [Cache management](#cache-management).

Savings are unmeasured. Whether routing reduces cost on a given workload depends on that workload. See [Measuring cost impact](#measuring-cost-impact).

How it works

It listens on `ANTHROPIC_BASE_URL`, intercepts `POST /v1/messages`, extracts facts about the session from the request