tzachbon/claude-model-router-hook

34 stars · Last commit 2026-03-13

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

README preview

<div align="center">

# Claude Model Router Hook

**Automatic model switching for Claude Code. No API calls, no config.**

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
![Platform](https://img.shields.io/badge/platform-macOS%20%7C%20Linux-lightgrey)
![Shell](https://img.shields.io/badge/shell-bash-blue)

<video src="docs/slides/public/model-router.mov" width="887" controls></video>

</div>

A Claude Code hook system that classifies every prompt by task complexity and switches your active model automatically. Sub-agent model rules are injected into every session so spawned agents also use the right tier.

## Features

- Classifies prompts by complexity using keyword and pattern matching (zero API calls)
- Warns on tier mismatch by default; optionally auto-switches `settings.json` (`action: "autoswitch"`)

View full repository on GitHub →