Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Run automatically on Claude Code events. Claude doesn't decide.
No risk signals detected
Nothing flagged in this plugin's hooks, MCP servers or commands. Other components are not analyzed.
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
LunaRoute is a Claude Code plugin for mid-session model routing. Users type #!sonnet (or any model name) to set a sticky route tag for the current session. Every subsequent API request — including requests made by subagents — carries a [LUNAROUTE:sonnet] marker injected into the conversation context. An external proxy reads this marker and routes the request to the appropriate LLM backend. Use #!clear to remove the tag and return to default routing.
Via plugin install:
claude plugin install github.com/<owner>/lunaroute-cc-plugin
Via ~/.claude/settings.json:
{
"extraKnownMarketplaces": {
"lunaroute-marketplace": {
"source": {
"source": "github",
"repo": "<owner>/lunaroute-cc-plugin"
}
}
}
}
| Command | Effect |
|---|---|
#!sonnet | Set route to sonnet |
#!gpt-4o | Set route to gpt-4o |
#!claude-3-haiku | Set route to claude-3-haiku |
#!clear | Clear the active route |
The tag can be standalone or inline with a message:
#!sonnet rewrite this function
Confirmation is shown after each command:
[Route set: sonnet]
[Route cleared]
Subagents automatically inherit the session's active route tag. To override routing for a specific subagent, include a #!model tag in the subagent's prompt directly.
#!sonnet → main session → sonnet
├── subagent A (no override) → inherits sonnet
├── subagent B (prompt has #!haiku) → routes to haiku
└── subagent C (no override) → inherits sonnet
Critical: The proxy receives the full conversation history, not just the latest message. When a user changes routes mid-session, earlier messages carry stale markers. The proxy must extract the route from the last user message only.
function extractRoute(requestBody) {
const messages = requestBody.messages || [];
// Find the last user message
for (let i = messages.length - 1; i >= 0; i--) {
if (messages[i].role !== 'user') continue;
const content = messages[i].content;
const text = typeof content === 'string'
? content
: content.map(b => b.text || '').join('\n');
const match = text.match(/\[LUNAROUTE:([a-zA-Z0-9._-]+)\]/);
if (match) return match[1];
break; // Only check the last user message
}
return null; // No route — use default model
}
UserPromptSubmit hook — detects #! tags in user input, persists state to /tmp/lunaroute-{session_id}, and injects [LUNAROUTE:model] into subsequent requests via additionalContext.PreToolUse hook (Agent matcher) — injects the active route marker into subagent prompts via updatedInput, enabling inherited routing without user intervention.#!model tag remains visible in the prompt text. Hooks can add context but cannot modify the prompt text itself.#!/usr/bin/env node are correctly ignored. The regex requires whitespace before #! to distinguish route commands from shell shebangs.Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
Generated from the plugin's indexed repository (erans/lunaroute-cc-plugin) — no native marketplace selected
npx claudepluginhub p/erans-lunaroutePlugins from other owners that cover similar ground