tzachbon

Claude Code hooks that auto-switch model tier based on task complexity

20
0
89% credibility
Found Mar 09, 2026 at 13 stars -- GitGems finds repos before they trend. Get early access to the next one.
Sign Up Free
AI Analysis
Python
AI Summary

This project adds automatic model selection to Claude Code by classifying prompts and switching between Haiku, Sonnet, or Opus models for optimal cost and performance.

How It Works

1
🔍 Discover the smart model switcher

While using your AI coding assistant Claude Code, you find this handy tool that automatically picks the right AI 'brain' size for your questions to save money and get better results.

2
📥 Install with one click

Run a simple download command or add it as a plugin, and it places the helper files in your personal folder.

3
⚙️ Link it to your AI assistant

Add a couple of lines telling Claude Code to use these helpers at the start of chats and before sending messages.

4
🔄 Restart and go

Restart Claude Code, and now every new chat gets smart rules for picking models, feeling seamless and ready.

5
💬 Type your prompt

As you ask for git fixes or big architecture plans, it checks the task and switches to the perfect AI model automatically – or suggests if needed, saving you time and cash.

Smarter, cheaper coding

Now your AI always uses the best fit: quick and cheap for simple jobs, powerful for tough ones, with logs to see it working wonderfully.

Sign up to see the full architecture

4 more

Sign Up Free

Star Growth

See how this repo grew from 13 to 20 stars Sign Up Free
Repurpose This Repo

Repurpose is a Pro feature

Generate ready-to-use prompts for X threads, LinkedIn posts, blog posts, YouTube scripts, and more -- with full repo context baked in.

Unlock Repurpose
AI-Generated Review

What is claude-model-router-hook?

Claude-model-router-hook delivers bash hooks for the Claude Code CLI that auto-switch between Haiku, Sonnet, and Opus models based on prompt complexity, using keyword patterns to classify tasks like git ops or architecture planning. It updates your settings.json instantly on mismatches, injects sub-agent model rules into every session, and logs decisions for review—all without API calls or config tweaks. Users get seamless claude code pricing optimization and consistent performance across claude code sessions.

Why is it gaining traction?

Zero-config auto-switch beats manual model commands, with plugin marketplace install or curl one-liner for claude code install, plus ~ prefix to override. It enforces smart tiering for sub-agents, slashing claude code subscription waste on simple prompts while logging everything transparently. Stands out for claude github integration users avoiding claude github connector not working headaches in code review workflows.

Who should use this?

DevOps folks chaining claude code cli for git commits and deploys, or architects doing claude github code review and multi-file analysis who track claude code preis. Suited for teams on claude code subscription building claude code skills via claude github plugin, especially if toggling models disrupts flow.

Verdict

Worth the quick claude code download for heavy Claude Code CLI users—excellent docs and free setup outweigh 13 stars and 0.9% credibility score. Early maturity means tweak patterns yourself, but it delivers real cost wins now.

(178 words)

Sign up to read the full AI review Sign Up Free

Similar repos coming soon.