My Claude Code setup grew the way most do. I'd install a skill pack, then another, then copy a few
community skills into ~/.claude/skills. One day I counted: five skills that review code, three that debug,
a handful that plan.
When I said "review this PR before I merge it", Claude picked one of the five. Which one depended on a
one-line description in each skill's frontmatter, and I couldn't predict it. Sometimes it picked none and
did the review itself.
So I built Switchboard, a Claude Code plugin that does one thing: when several installed skills fit the
task in front of you, it shows you the best two or three, each with a one-line reason, and lets you pick.
It's local only: Python standard library, no network calls, no API keys, no telemetry. MIT licensed.
Repo: https://github.com/surenganne/switchboard
This post covers installing it, your first routed skill, and how the ranking actually decides, with the real
scoring code.
Who this is for (and who it isn't)
It's for you if you've installed several skill or plugin packs and they overlap. If you have a handful of skills
that each do something different, Switchboard has nothing to rank and stays silent. You don't need it.
1. Install
You need Claude Code and python3 3.9 or newer on your PATH.
claude plugin marketplace add surenganne/switchboard claude plugin install switchboard@switchboard Restart Claude Code so the plugin's hooks load.
2. Profile your skills (one time)
Inside Claude Code, run:
/switchboard:profile At session start, Switchboard has already scanned your user, project and enabled-plugin skills, commands
and subagents, and fingerprinted each one. Now Claude reads each skill's full files, not just the
one-liner, and writes a short profile in a fixed format: category, role, what it works on, focus, depth,
cost and stack.
Profiling costs tokens, so it tells you the count and a rough estimate and asks before it starts:
Switchboard has 12 skills to profile (~36k tokens, one subagent per batch of about 20). ● Profile all 12 ○ Not now (Your numbers will differ. This is the format.)
Each profile is a small JSON file in ~/.switchboard/profiles/. Here's a real one for a debugging skill:
{ "id": "superpowers:systematic-debugging", "categories": ["debugging"], "does": "Four-phase debugging process that requires finding the root cause before any fix: investigate, compare patterns, test a hypothesis, then fix.", "targets": ["files", "repo"], "focus": ["correctness", "reliability"], "depth": "thorough", "cost": "single-pass", "stack": ["any"], "best_for": ["bugs and test failures", "flaky tests and unexpected behavior", "after failed quick fixes"], "not_for": ["new feature design", "code review"] } A validator accepts only known fields, values from fixed lists and short text, so a skill's own wording
can't steer the router. You only pay this cost once. Later sessions re-profile only skills whose text has
changed, for example after a plugin update.
To see what it found:
/switchboard:status Switchboard knows 160 entries (86 skills, 4 commands, 70 agents): 160 profiled, 0 waiting. Task areas with overlapping skills: code-review, debugging, docs, planning, testing, ui-design. 3. Your first routed skill
Now just work normally. Ask:
review this PR before I merge it
With three code reviewers installed, you get something like this (Claude words it in its own way):
Several installed skills fit this. Which one? 1. review (recommended) Pre-landing PR review for SQL safety, trust boundaries and side effects. You chose this last time. 2. ecc:code-review Broad quality, security and maintainability pass over the diff. 3. ponytail:ponytail-review Flags over-engineering and code that should not exist. There's also a "no skill, do it directly" option if you'd rather Claude just do it.
Pick one and Claude runs that skill. Your pick is saved to ~/.switchboard/choices.jsonl as one line of
task features and skill ids. Your prompt is never stored:
{"date": "2026-11-12", "category": "code-review", "targets": ["pr"], "focus": ["correctness", "security"], "stack": ["python"], "depth": null, "cost": null, "offered": ["user:review", "ecc:code-review", "ponytail:ponytail-review"], "chosen": "user:review"} Three things worth knowing:
- It only asks when it matters. If one skill clearly fits, Claude uses it and tells you which.
- Typing the skill yourself skips it. If your message contains
/review, Switchboard never routes or blocks that skill. - It holds the Skill tool until you've chosen. A PreToolUse hook blocks the Skill tool until a choice is recorded. It does this at most twice per 10 minutes, so an agent that can't ask you never gets stuck.
4. How the ranking decides
This is the part I cared most about getting right, so here it is in detail.
When Claude is about to use a skill in an area where several profiled skills overlap, it describes the task
in the same fixed format (category, role, targets, focus, stack) and calls Switchboard's local route tool.
From there it's plain Python in switchboard/route.py.
Step 1: filter. Only skills whose profile lists the task's category, such as code-review.
Step 2: group. Skills whose role matches the task go first. The default role is performs, meaning the
skill does the task. assists is for help around a task, such as answering review comments. Within each role
group, a skill built only for other languages sorts below the rest. A Kotlin reviewer won't beat a general
reviewer on a Python task.
Step 3: score. Fixed weights:
W_TARGET, W_FOCUS, W_STACK, W_DEPTH, W_COST = 3, 2, 1, 1, 1 Targets and focus are scored as the share of the task's tags the skill covers, so a skill that matches part
of the task ranks below one that matches all of it. A profile that lists more than three tags in a field has
that field scaled down, so stuffing tags can't buy a top rank:
def _fit(task_vals, prof_vals) -> float: task, prof = set(_list(task_vals)), set(prof_vals or []) if not task or not prof: return 0.0 return len(task & prof) / len(task) * min(1.0, FULL_TAGS / len(prof)) Stack, depth and cost add 1 each when they match.
Step 4: break ties. Your past picks come right after score in the sort key. That means they only break
ties between equal scores and never lift a weaker fit above a better one. After that, the lighter skill
(single-pass before multi-agent) and the more focused skill win.
route returns up to 10 candidates. Claude offers the best 2–3 by their best_for / not_for.
Try it yourself
You don't need Claude Code to see the ranker work. From a checkout:
git clone https://github.com/surenganne/switchboard.git && cd switchboard python3 - <<'EOF' from switchboard.route import route def p(targets, focus, stack, depth="thorough"): return {"categories": ["code-review"], "role": "performs", "targets": targets, "focus": focus, "stack": stack, "depth": depth, "cost": "single-pass"} profiles = { "user:review": p(["pr", "diff"], ["security", "correctness"], ["any"]), "ecc:code-review": p(["diff", "files"], ["correctness", "security", "maintainability"], ["any"]), "ponytail:ponytail-review": p(["diff"], ["simplicity"], ["any"], depth="quick"), "kt:kotlin-review": p(["pr", "diff"], ["correctness", "security"], ["kotlin"]), } inventory = {k: {"source": k.split(":")[0], "name": k.split(":")[1], "kind": "skill"} for k in profiles} task = {"category": "code-review", "targets": ["pr"], "focus": ["correctness", "security"], "stack": ["python"]} for c in route(task, profiles, inventory, past=[{"chosen": "user:review"}])["candidates"]: print(f'{c["id"]:28} score={c["score"]} past_choices={c.get("past_choices", 0)}') EOF Output:
user:review score=6.0 past_choices=1 ecc:code-review score=3.0 past_choices=0 ponytail:ponytail-review score=1.0 past_choices=0 kt:kotlin-review score=5.0 past_choices=0 Here's why that order is right:
-
user:reviewcovers the task'sprtarget (3) and both focus tags (2), and fits any stack (1). Total 6. -
ecc:code-reviewdoesn't listpr, so it gets 0 for targets. It covers both focus tags (2) and fits any stack (1). Total 3. -
kt:kotlin-reviewscores 5, higher thanecc, but it's Kotlin-only on a Python task, so it sorts to the bottom of its role group.
The profiles above are hand-written for the demo. In real use Claude writes them from each skill's files.
What's deterministic and what isn't
I want to be precise here. The ranking is deterministic: the same profiles and the same task description
always give the same order. But Claude still writes the profiles and describes each task, so what goes into
the ranker can vary. And you make the final pick. I'd call it "predictable ranking you can inspect", not
"deterministic routing".
5. Keeping it honest over time
Two commands I use weekly:
-
/switchboard:auditlists task types where you keep passing over the top pick, so you can see which profiles are probably wrong:
- debugging · files · correctness: top pick passed over 3 times; you chose superpowers:systematic-debugging. -
/switchboard:hygienesuggests plugins you haven't used (once 30 days are logged) and estimates the context tokens each costs in the skill listing. It doesn't turn anything off. You do that with/plugin.
There's also /switchboard:report, which writes a self-contained HTML report of your picks to
~/.switchboard/report.html, and /switchboard:forget to delete your history.
Limits (read these before you install)
- Claude Code only, for now.
- It can't force Claude to call it. The hook holds the Skill tool (and, in the optional
primarymode, the first Edit/Write/Agent call) until a choice is recorded. -
Bashisn't gated. - Deciding whether a prompt falls in an overlapping area is a keyword guess.
- MCP tools and hooks aren't routed. Only skills, commands and subagents are.
- Profiling spends tokens once, plus a little each time a skill changes.
Privacy
Everything lives in ~/.switchboard/ (directories 0700, files 0600). No prompt text and no code are stored.
There are no network imports in the plugin. To stop recording, put {"record_choices": false} in
~/.switchboard/settings.json.
Uninstall
claude plugin uninstall switchboard@switchboard rm -rf ~/.switchboard If you have overlapping skills and try it, I'd like to hear where it ranks the wrong skill first. That's the
most useful bug report. Repo, issues and the full README: https://github.com/surenganne/switchboard