Claude Code model router

Gatekeeper

Routes each request to the right AI agent or skill before your AI picks one. Your rules decide what code can; Jev (TypeSafe) makes the typed call. Installs as Claude Code hooks.

Install

From source
git clone https://github.com/AgriciDaniel/gatekeeper.git

From the README

Gatekeeper decides which AI agent or skill should handle a request, before your AI picks one. Commands you type go straight through; the plain requests, where the AI would otherwise guess, get checked by your rules and judged by Jev. Each decision costs a fraction of a cent and takes about half a second.

The engine and rulebooks are tool-neutral. Today it installs as a Claude Code hook.

A gate is a YAML rulebook. Code decides what code can decide (slash commands, keywords, field checks). Jev, TypeSafe's System One model, answers the one semantic question left ("which of these handlers owns this request?") as a typed Choice with a probability for every option. Confidence bands then turn that answer into a verdict:

Every hook decision is logged with the rules that fired, Jev's answers, the band, the cost and the rulebook version, so you tune thresholds from evidence instead of guessing.

See it work

The marketing-team example routes marketing requests across 24 skills owned by 11 roles:

In the second prompt, no single skill is confident, but the skills it could be all belong to one role, so the gate still gives a useful answer. That is rollup: group: Jev picks the fine label and code adds up the probabilities by group.

Two ways to use it

1. Agent selection for Claude Code (gates/agent-selection.yaml). The roster is whatever you have installed: ~/.claude/agents, ~/.claude/skills and your enabled plugins. Two hooks run it:

- UserPromptSubmit judges your prompt and adds the route as context.
- PreToolUse on Agent, Task and Skill denies a call that breaks a confident route or a forbid rule (in enforce mode only).

2. Routing to Markdown procedures (roster.sources: [index]). For setups where the assistant reads a SKILL.md and follows it instead of launching a…
Read the full README on GitHub

Details

Language
Python
License
MIT
Last updated
23 September 2026
Topics
agent-orchestrationagent-routingai-agentsai-routerclaude-codeclaude-code-hooksdeveloper-toolsjevllm-routingmulti-agentpythontypesafe

FAQ

What is Gatekeeper?

Routes each request to the right AI agent or skill before your AI picks one. Your rules decide what code can; Jev (TypeSafe) makes the typed call. Installs as Claude Code hooks. It is a model router for Claude Code, from AgriciDaniel/gatekeeper on GitHub.

How do I install Gatekeeper?

Clone AgriciDaniel/gatekeeper from GitHub and follow the setup steps in its README.

Is Gatekeeper popular?

AgriciDaniel/gatekeeper has 25 GitHub stars and 4 forks. It was last updated on 23 September 2026.

More model routers & proxies

Browse the most popular Claude Code mods, all model routers & proxies, or the skills and MCP server directories.