ClaudeCodeMod

All shelves / Mods / Usage

laya-router

By marcreichel

laya-router is a Claude Code usage mod by marcreichel.

Routes the session once from its first prompt to a model and effort, and draws that route on the status line.

Draws

Install

The marketplace name is laya-router.

In Claude Code
/plugin marketplace add marcreichel/laya-router
/plugin install laya-router@laya-router
Open the repo

It runs inside the Claude Code process. The side panel is only what the author's README names. Read the repo before you install, or run claude plugin validate on the plugin folder.

Version
0.3.0
License
MIT
Repo stars
6
Last change
2026-10-16

What it can reach

  • Draws in the session
  • Reaches the network or an outside service
  • Sees tool calls
  • Calls another program on this machine

Start laya-serve first, for example with docker compose up in this repo. Install asks for layaUrl, default http://localhost:8000, and an optional layaApiKey, which is sent as a Bearer token. Laya classifies the prompt on this machine, and routing costs no tokens. The first prompt is the only one that picks the model, because switching mid-session drops the prompt cache and the whole conversation is re-read at full price. A first prompt under three words stays on /model. A skill call is routed from the typed text plus the first 2000 characters of the skill, or from the typed text alone where that hook is unavailable. Subagents keep the model their definition names. Below a confidence of 0.475, or 0.375 when Fable is enabled, or when laya-serve is unreachable, the request goes out unchanged. Changing /model after routing stops the override for the rest of the session. /effort alone does not, and the mod keeps sending the routed effort. Trivial prompts go to claude-haiku-5-5 at low effort, routine to claude-sonnet-5-5 at medium, hard to claude-opus-5-5 at high, and research to claude-fable-5-1 at xhigh only when enableFable is on, otherwise Opus. enableFable is off by default. Each model's effort is a picker in /config, from low to max, and Claude Code lowers a level the model does not support. Three failed or identical tool calls in a row, or a later prompt read as a harder tier, put one status line asking you to consider a higher /model, once per session. Later prompts are classified in the background, so they do not wait on laya-serve. You decide whether a switch is worth re-reading the conversation uncached. The status line shows the tier and confidence, or unsure, or offline. /model keeps showing the session's own model, because a mod rewrites each request and cannot set the session's model. /laya-log prints the stored routes as JSON lines, the last 1000 entries. The author says the thresholds are the lowest that keep about 90 percent of routed prompts on the expected tier in the repo's eval.

The plugin is the repository. The marketplace name is laya-router. The route on the status line is why this page files it under usage. claude-router picks a model and effort for each turn from a classifier, and draws the tier above the prompt. effortless draws a bar above the prompt with the reasoning effort it picked for this prompt, how full the chat is, and how long the prompt cache stays warm. This one routes once from the first prompt, through Laya on this machine, and keeps that model and effort. Laya is the classifier the README names, and laya-serve is that classifier running on this machine. With layaUrl left at localhost the call stays on this machine. A different URL is where the prompt and the optional key go. The status text is set when a tier is chosen, when the classifier is unsure or offline, and when a harder tier is suggested. The tool-call handler only counts failures toward that suggestion. A routing failure lets the prompt through.

Demo

The How it behaves section of the laya-router README: routing from the first prompt only, skill calls, the main thread only, falling back to /model, /model winning, and the status-line suggestion when a task outgrows its model.
Screenshot of the author's GitHub page.

What it hooks into

  • session.startWhen a session starts
  • command.runWhen you run its slash command/laya-log
  • session.endWhen a session ends
  • prompt.submitWhen you send a prompt
  • skill.promptA Claude Code event
  • turn.stepAt each step of a turn
  • tool.callAround a tool call, where it can hold one

Read from the on() calls in its hook modules. Open its source under Files to check what each one does.

Slash commands 1

  • /laya-logShow what laya-router routed and what happened after, as JSON lines

Files

The author's README and source, 4 files. They load when you open them.

Facts

Author
marcreichel
Category
Usage
Marketplace
laya-router
Repo
marcreichel/laya-router
Version
0.3.0
License
MIT
Repo stars
6
Last change
2026-10-16
Language
TypeScript
Files
17

Other mods in Usage

cache-clockray-amjadDraws a line above the prompt with the time until the prompt cache goes cold, the context fill, and a subagent clock, and has Claude write a handoff first.antiburnantiburnDraws the five-hour and weekly limits above the prompt with reset times and even-pace markers, in the terminal and the desktop Code tab.context-metermidudevDraws how full the context window is at the right end of the band above the prompt: gray, then yellow from 50 percent, then red from 75.sub-metermidudevDraws your 5-hour and weekly subscription usage at the bottom right, on the permission mode's line, with a bar and the time until it resets.token-metermidudevEnds the hint line under the prompt with the last turn's input, output, and cache tokens, and the session's running total, in color.use-haikumidudevRuns a prompt that starts with _ on Haiku, subagents included, and shows it as you type, while it runs, and under the answer.agent-usage-guardrbartoliHolds a commandAsks before a subagent starts, a heavy prompt is sent, or a tool loop runs on, from the 5-hour and weekly usage, and refuses when nobody can answer.optim-jevOqura-aiHas TypeSafe's Jev drop stale tool calls and their output when the session compacts, keeping the rest word for word, and draws a dashboard above the prompt.secondwindorchetronCompresses Bash output of 512 bytes or more through the local secondwind binary, keeps the full text one call away, and draws a pane of the net tokens saved.session-hudbradtraversyDraws a strip above the prompt with the git branch, warned on main, context used against a target you set, and weekly usage, and a Details pane of the rest.time-blamekaranb192Splits each turn's time between Claude, each tool, your approvals, and the rest, under the answer, and /blame opens a panel of the whole session's split.subagent-tunerKruhlikauHolds a commandPicks each subagent's model and effort by asking you in a pane, from a recommendation for the task, or from your saved default, with a band above the prompt.
All 183 in Usage