tzachbon/claude-model-router-hook

58 stars · Last commit 2026-08-02

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

README preview

<div align="center">

# Claude Model Router Hook

**Effort-first model routing for Claude Code. Heuristics-first, opt-in autoswitch.**

[![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 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

View full repository on GitHub →