model-router
by preisnerai · ★ 0 · updated 11 days ago
Cache-aware model and effort routing for Claude Code Desktop: each prompt goes to Haiku, Sonnet or Opus by what it needs, and a cheaper model or effort only when that pays after the prompt-cache re-write. Rules read non-code work too, research is Sonnet at most, !+ and !- nudge the tier, /router-help lists every command, /router why explains the decision, /router-cache shows the cache hit rate...
Install
/plugin marketplace add preisnerai/claude-mods/plugin install model-router@claude-modsThen run /reload-plugins or start a new session. Requires Claude Code 2.1.287+.
What it hooks into
From an automated scan with claude plugin validate, not a security review. Mods run with your permissions; read the code before installing.
- Events
session.startui.rendersession.sendcommand.runprompt.submitturn.startturn.stepturn.completeagent.spawntool.callsession.appendclassic.PostModelSwitchsession.endsession.compactprompt.compose- API calls
$.agent.list$.agent.register$.clock.now$.clock.sleep$.command.list$.command.register$.env.get$.fs.exists$.fs.read$.fs.write$.http.fetch$.model.complete$.process.run$.session.compact$.session.cwd$.session.id$.session.messages$.session.model$.session.usage$.state.get$.state.set$.store.delete$.store.get$.store.set$.ui.open$.ui.resolve$.ui.status- Draws
PaneUserMessageSessionMode- Can see
every promptsubagent spawnsevery tool callclassic hookscompaction- Reach
- level 3 of 3 networkruns processeswrites filesdrives Claudereads filesreads env varsreads the transcriptreads mod statepersists statedraws
Origin
- How it got here
- Automated scan of public GitHub repos, via the CC0 dataset awesome-claude-code-mods (scan of ).
- Repository
- github.com/preisnerai/claude-mods
- Path in repo
model-router- Source commit
5b36fe7the exact code the scan read- Author
- @preisnerai
- License
- MIT
- First published
- Last pushed
- First listed here
Name and description come from the mod's own manifest. We link to the code; we don't host it, and it stays under its author's license.
More from preisnerai/claude-mods
Related mods
Other mods in Panes, close to this one by stars.