{"repo":"tzachbon/claude-model-router-hook","free":true,"listed":false,"github":"https://github.com/tzachbon/claude-model-router-hook","clone":"git clone https://github.com/tzachbon/claude-model-router-hook.git","description":"Claude Code hooks that auto-switch model tier based on task complexity","language":"Python","stars":68,"topics":["claude","claude-code","claude-hooks","haiku","opus","oss","sonnet","model-router","ai-tools","anthropic"],"license":"MIT","category":"mcp-servers","readme_excerpt":"Claude Model Router Hook Effort-first model routing for Claude Code. Heuristics-first, opt-in autoswitch. A Claude Code hook system that classifies every prompt into a task class and effort level, then routes it to the right model. Warning is the default; autoswitch is opt-in. Sub-agent routing is enforced at spawn time so spawned agents also land on the right tier. Features - Classifies each prompt into a task class and effort level with a heuristics-first classifier; no API key required - Warns by default; opt-in autoswitch writes the recommended model to /.claude/settings.json for new sessions only - Enforces sub-agent routing at spawn time via a PreToolUse hook, and injects the tier rules into every session via SessionStart - Effort-first routing with boundary damping, so near-threshold prompts warn instead of flipping the model - Prefix any prompt with or lines record a settings write (autoswitch mode); SUGGEST- lines record a warn-mode advisory; OVERRIDE marks a bypassed prompt. A prompt that already matches its tier exits silently and writes no line. Known limitations - Multi-hook updatedInput merge order (A-3): when more than one PreToolUse hook returns an updatedInput for the same tool call, the order in which Claude Code merges them is undocumented platform behavior. The router writes its rewrite defensively, but a competing hook that also rewrites the spawn can win depending on merge order. Credits Based on model-matchmaker by @coyvalyss1. Contributing See CONTRIBU","default_branch":null,"files":null,"tree":[],"storefront":"/r/tzachbon","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/tzachbon/claude-model-router-hook/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}