Model-Matchmaker Hook Setup — AI skill for Claude Code
Set up the model-matchmaker hook system in your global Claude Code config.
How to install Model-Matchmaker Hook Setup
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open tzachbon/claude-model-router-hook and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Model-Matchmaker Hook Setup does
Set up the model-matchmaker hook system in your global Claude Code config. ---
Alternatives in AI
- Manifest — Real-time cost observability for OpenClaw agents — track tokens, costs, messages, and model usage 4.1k ★
- J Space Cognition Suite V3.7 — J-Space Cognition Suite V3.7 - AI cognitive-enhancement Skills based on Anthropic's J-space global workspace r 3k ★
- Model Config — /model-config — Choose the model you follow 705 ★
README
Model-Matchmaker Hook Setup
Set up the model-matchmaker hook system in your global Claude Code config.
Step 1 — Create the hooks directory
mkdir -p ~/.claude/hooks
Step 2 — Create `~/.claude/hooks/session-init.sh`
Write the content below, then run `chmod +x ~/.claude/hooks/session-init.sh`.
#!/bin/bash
# Session init hook: injects model-tier guidance into every conversation,
# including mandatory rules for sub-agent model selection.
# Adapted from model-matchmaker (https://github.com/coyvalyss1/model-matchmaker)
INPUT=$(cat)
MODEL=$(echo "$INPUT" | python3 -c "
import sys, json
try:
data = json.load(sys.stdin)
print(data.get('model', 'unknown'))
except:
print('unknown')
" 2>/dev/null)
MODEL_LOWER=$(echo "$MODEL" | tr '[:upper:]' '[:lower:]')
TIER_HINT=""
if echo "$MODEL_LOWER" | grep -q "opus"; then
TIER_HINT=" You are currently on Opus. For simple tasks (git ops, renames, formatting), mention that Haiku or Sonnet would be cheaper."
elif echo "$MODEL_LOWER" | grep -q "haiku"; then
TIER_HINT=" You are currently on Haiku. For deep analysis or architecture work, mention that Opus would produce better results."
elif echo "$MODEL_LOWER" | grep -q "sonnet"; then
TIER_HINT=" You are currently on Sonnet. For simple mechanical tasks Haiku is cheaper; for architecture or deep analysis Opus is better."
fi
cat << EOF
{
"hookSpecificOutput": {
"hookEventName": "SessionStart",
"additionalContext": "## Model Tier Rules\n\nThese rules apply to YOU and to every sub-agent you spawn.\n\n### Sub-agent model selection (MANDATORY)\nWhen calling the Agent tool, you MUST set the model parameter based on task complexity:\n- **haiku** — simple mechanical tasks: file searches, grep, glob, reading a handful of files, git status/log, listing directories, quick lookups. Default for Explore agents unless deep reasoning is required.\n- **sonnet** — standard implementation: writing/editing code, debugging, creating components, running tests, most general-purpose agents.\n- **opus** — architecture decisions, deep multi-file analysis, complex refactors, plan-mode agents, anything requiring sustained reasoning across large context.\n\nNever default all sub-agents to Opus. Match the model to the work.\n\n### Your own tier${TIER_HINT}\n- Haiku: git ops, renames, formatting, simple edits.\n- Sonnet: feature work, debugging, planning.\n- Opus: architecture, deep analysis, multi-system reasoning.\n\n### Configuration\nIf the user wants to customize routing (keywords, patterns, thresholds), offer to create a config file at \`~/.claude/model-router.json\` (global) or \`.claude/model-router.json\` (project-level). Project config overrides global.\n- **thresholds**: \`opus_word_count\` (default 200), \`opus_question_word_count\` (default 100), \`haiku_max_word_count\` (default 60)\n- **Per tier** (opus/sonnet/haiku): \`mode\` (extend|replace), \`keywords\`, \`patterns\`, \`remove_keywords\`, \`remove_patterns\
Related Skills
MyEconomicClaude
Token-efficient Claude Code setup: global CLAUDE.md (clean code rules + best practices), RTK hook (60-90% toke
AI Agent Guardrails Windows Guide
Verified guide: a global guardrail that blocks catastrophic shell commands from AI agents on Windows (Claude C
Claude Code Global Config
Production-ready global CLAUDE.md template for Claude Code CLI - Anthropic's AI coding assistant. Clean Archit
Unify Agents Md
Make AGENTS.md the canonical guide every AI coding CLI follows; reduce CLAUDE.md/GEMINI.md to @import pointers
Trustline
Trusted baseline + auto-rollback for AI agent config files (.claude/, AGENTS.md, .mcp.json). Detects prompt-in
Unpick
Vet AI agent skills, MCP servers, plugins and rules files before you install them. Catches hidden instructions
Related Agents
Config Manager
Owns the global Claude Code setup and its self-improvement loop. Use via the /update-config skill (or directly
Opus Low
Fixed-tier executor (claude-opus-5-5, low effort). Use per the global routing matrix — never inherits the orch
Gaia System
Use when building, modifying, or auditing Gaia's own machinery — agents, skills, hooks and hook modules, routi