Claude Code hook

Model Matchmaker

Local hook that routes each prompt to a suitable model tier to save cost.

168 stars 15 forksHooks Source

Install

From source
git clone https://github.com/coyvalyss1/model-matchmaker.git

From the README

Model Matchmaker

Stop paying Opus prices to rename files. Stop waiting 20 seconds for responses that should take 3.

A local hook for Cursor and Claude Code that classifies every prompt before it's sent and recommends the right model. Saves money (cloud APIs), speeds up your workflow (everyone), reduces resource usage (local models). No proxy, no API calls, no dependencies. Three files, two minutes to set up.

What It Does

Before each prompt is sent, Model Matchmaker reads what you're asking and which model you're on, then makes a call:

- Step-down: You're on Opus asking to git commit? Blocked. "Switch to Haiku, same result, 90% cheaper."
- Step-up: You're on Sonnet asking about architecture tradeoffs? Blocked. "Switch to Opus, you need the horsepower."
- Pass-through: You're on the right model? Prompt goes through instantly.

Override anytime by prefixing your prompt with !.

Auto-Switch (Optional)

Enable automatic model switching (v2+):

When Model Matchmaker blocks a prompt, it now automatically switches the model and submits your message via keyboard automation:
1. Opens the model dropdown (Cmd+/)
2. Types the model name to search
3. Presses Enter 3 times (select model, confirm, submit message)
4. Terminal window flashes briefly, then closes
5. Your message is sent with the correct model (~3-4 seconds total)

Check status:

Disable anytime with off. Uses macOS Accessibility permissions + Terminal.app proxy for safe, reliable switching.

Mode Support:
Auto-switch adapts to Cursor's different modes (Agent, Plan, Debug, Ask). In Plan mode, Haiku is unavailable, so Model Matchmaker automatically switches to Sonnet instead. To log your current mode:

This ensures correct dropdown navigation for each mode.

How It Works

Three layers work together:

1.…
Read the full README on GitHub

How hooks work

  • Hooks are shell commands Claude Code runs at fixed points: before or after a tool call, when you submit a prompt, when Claude stops, on notifications and at session start.
  • They are set in the hooks section of ~/.claude/settings.json (or .claude/settings.json for a project), or come bundled in a plugin.
  • A hook can block a tool call, add context, or run a formatter or test. Read the scripts before you install them: they run on your machine with your permissions.
Claude Code docs

Details

Type
Hooks
Language
Shell
License
MIT
Last updated
22 September 2026

FAQ

What is Model Matchmaker?

Local hook that routes each prompt to a suitable model tier to save cost. It is a hook for Claude Code, from coyvalyss1/model-matchmaker on GitHub.

How do I install Model Matchmaker?

Clone coyvalyss1/model-matchmaker from GitHub and follow the setup steps in its README.

Is Model Matchmaker popular?

coyvalyss1/model-matchmaker has 168 GitHub stars and 15 forks. It was last updated on 22 September 2026.

More hooks

Browse the most popular Claude Code mods, all hooks, or the skills and MCP server directories.