Getting it into your agent
This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.
/plugin marketplace add kochetkov-ma/claude-brewcode/plugin install brewtoolsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/kochetkov-ma/claude-brewcode/agent-router-setup)<a href="https://agentmods.dev/skills/kochetkov-ma/claude-brewcode/agent-router-setup"><img src="https://agentmods.dev/badge/skills/kochetkov-ma/claude-brewcode/agent-router-setup/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/kochetkov-ma/claude-brewcode/agent-router-setup"><img src="https://agentmods.dev/badge/skills/kochetkov-ma/claude-brewcode/agent-router-setup.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00052 | $0.09890 |
| Opus 5.5 | $0.00021 | $0.03956 |
| Sonnet 5.5 | $0.00010 | $0.01978 |
| Haiku 4.5 | $0.00005 | $0.00989 |
Grade B, and why
agent-router-setup scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Reads agent configuration directoriesmediumAgent snooping
.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.
> Current state: agent-router not installed; `.claude/agents/` holds 4 project agents. Plan: copy `agent-router.mjs` into `<repo>/.claude/hooks/`, write `<repo>/.claude/brewtools/agent-router.json` with `level: "fast"`, How it starts
The opening of the file, as written. The whole thing — 420 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Agent Router
EXPERIMENTAL. Installs one self-contained PreToolUse hook on the
Agenttool. When the main loop spawns a generic agent although a real expert owns the task — a project agent from.claude/agents/, or an installed brewcode specialist — the hook denies the spawn and names the expert; an uncertain fit is only a nudge. Runtime behavior lives in the hook file and a JSON config; this skill resolves mode and level, then delegates the file work to thebrewcode:hook-creatoragent, which follows the runbook.
Prompt contract
$ARGUMENTS is one free-form RU/EN prompt; mode tokens and flags (--unattended) may sit anywhere in it.
- Mode: strip
--unattendedfirst: a flag, never a mode, level or name (Modes, Unattended). Then an explicit mode token wins outright; else the most distinct whole-word keyword hits (table in Step 2). Tie with a destructive mode (purge) or ofinstallwith a removal mode (uninstall) ->AskUserQuestion; withstatus->status; of two other mutating modes -> the keyword that comes first. No hit or empty ->status. - Scope: prose that is not a mode/id/path is still input: take the id, path or target from it.
- Ask: at most ONE
AskUserQuestion(max 4 questions) to resolve mode and scope, before any work, only when the answer changes what gets written. A read-only run asks nothing.--unattendedasks nothing: an open question there ends inRESULT skipped(Modes, Unattended).
Print once, before the first action (labels literal, values in the conversation language):
PLAN — brewtools:agent-router-setup
INPUT: <arguments verbatim, or "(empty)">
MODE: <resolved> — <explicit | matched keyword: X | default>
SCOPE: <resolved paths / target / level / flags>
DO: <2-5 imperative bullets>
RESULT: <what the user ends up holding>
What the hook does (informational — skill does NOT implement)
| Tier | hooks.PreToolUse entry (timeouts in seconds) |
Behavior |
|---|---|---|
| 1 — always on | matcher Agent: {"type":"command","command":"node","args":["<PD>/.claude/hooks/agent-router.mjs"],"timeout":5}, where <PD> is the dollar-brace CLAUDE_PROJECT_DIR token, stored unexpanded (written out here it would be replaced by a path at load) |
deterministic, <100 ms incl. node startup, zero tokens |
2 — opt-in (level strict) |
matcher Agent: {"type":"agent","prompt":"<inlined judge-prompt.md>","timeout":30,"statusMessage":"agent-router: checking agent fit"}. No model key: Claude Code then runs its default small model (claude-haiku-5-5 on 2.1.296), and any explicit model is reported as drift |
an LLM judges a generic spawn against the project roster |
| heartbeat — with tier 2 | matcher StructuredOutput: the tier-1 command handler again |
counts the judge's verdicts for --judge-health |
What ships with it
7 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago Changed · +17 lines 2281e9565ac8
- 1mo ago Changed · +10 lines c79036a572fa
- 1mo ago Changed · -59 lines 2b69d1746038
- 2mo ago Changed · -13 lines c2c30bc89d2c
- 3mo ago First seen · 465 lines · 52 tokens per session scan B c4d55a77bb41
agent-router-setup is a skill published in the GitHub repository kochetkov-ma/claude-brewcode (41 stars, last pushed yesterday), licensed MIT. It adds 52 tokens to every session and 9,890 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
agent-router-setup compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| agent-router-setupkochetkov-ma/claude-brewcode | Skill | 41 | yesterday | MIT | B | 52 | Claude Code |
| doc-digestegorfedorov/claude-context-optimizer | Skill | 137 | 7d ago | MIT | A | 75 | Claude Code |
| token-checkegorfedorov/claude-context-optimizer | Skill | 137 | 7d ago | MIT | A | 66 | Claude Code |
| sharpen-promptegorfedorov/claude-context-optimizer | Skill | 137 | 7d ago | MIT | A | 47 | Claude Code |
| skill-creator-plusyaniv-golan/skill-creator-plus | Skill | 8 | 19d ago | MIT | A | 147 | Claude Code |
| cpp-reinforcement-learningAznatkoiny/zAI-Skills | Skill | 10 | 23d ago | MIT | A | 131 | Claude Code |
| deep-researchyachi/claude-skills | Skill | 3 | 1mo ago | MIT | A | 164 | Claude Code |