t1k:model-router:delegate
| Field | Value |
|---|---|
| Module | model-router |
| Version | 4.0.2 |
| Effort | low |
| Tools | — |
Keywords: cheap model, delegate, glm, intercept, kimi, model-mapping, route, route to cheap, subagent, swap model
How to invoke
Section titled “How to invoke”/t1k:model-router:delegate<agent-name> "<task>" --backend <backend> --model <model>How v2 Works
Section titled “How v2 Works”The kit no longer ships shim agents. The delegation contract is:
bash .claude/scripts/mr-delegate.sh <agent-name> "<task>" --backend <backend> --model <model>The script:
- Discovers
.claude/agents/<agent-name>.md(cwd →CLAUDE_PROJECT_DIR→~/.claude/agents). - Reads frontmatter for
permissionMode/maxTurns/maxBudgetUsd/effort(fallback:plan/ 25 / $5 / no--effortflag).effortmust be one oflow/medium/high/xhigh/max; an invalid value is warned and dropped, never silently passed through.MR_HOP_EFFORTenv overrides a valid frontmatter value. - Runs
claude -p --agent <name> --model <chosen-cheap-model>against the chosen backend. - Returns the agent’s text output.
Primary call path is the Task interceptor (hooks/mr-task-interceptor.cjs), not this skill. The flow:
main session → Task(subagent_type="t1k-unity-dots-core-implementer", prompt="...") ↓ PreToolUse hook reads the agent's `model:` frontmatter ↓ matches modelMapping["sonnet"] → { the hosted backend, deepseek-v4.1-flash } (opus-family keys never get here — they hit the kit passthrough floor first) ↓ hook denies the Task, runs mr-delegate.sh, returns output as systemMessage ↓main session sees the cheap result as if Task had succeededEngine-kit specialization is preserved: the Unity DOTS agent’s full prompt + tools run, just on the routed cheap backend instead of Opus.
Where the hop runs — name a worktree in the CALLER’s repo family
Section titled “Where the hop runs — name a worktree in the CALLER’s repo family”A routed hop inherits the caller’s projectRoot as its cwd. To run it elsewhere, the brief must carry ONE
canonical line, unindented and outside any fence:
worktree: /absolute/path/to/a/marked/lane/worktreemr-lane-worktree.cjs validates it fail-closed (full contract: docs/mr-lane-worktree.md). The refusal
that bites when your task names a DIFFERENT repo is foreign: the directive’s worktree must share its common
git dir with the CALLER’s own repo, so a hop is relocatable only WITHIN the caller’s repo family — never into
a foreign repo’s checkout.
Naming the target repo in PROSE does nothing. With no directive the hop runs at projectRoot (the caller’s
main clone) and cannot reach a target elsewhere: it opens the wrong tree, and any worktree: it then tries to
create is denied — a routed hop may not create repos or worktrees (the spawner does). To route work that
targets another repo, run it in a session whose own projectRoot IS that repo, or have that repo’s family
create a marked lane worktree and pass its path in the directive. The router never crosses repo families.
When to Use the Explicit Form (this skill)
Section titled “When to Use the Explicit Form (this skill)”Most delegation happens automatically via the Task interceptor. Call /t1k:model-router:delegate explicitly only when:
- You’re outside a Task spawn (e.g. running mechanical work from a Bash hook script).
- You want to force a specific (backend, model) that overrides
modelMapping. - You’re debugging — explicit invocation surfaces the full mr-delegate.sh output.
# Force an explicit backend/model, bypassing selection. NOTE: the named model must be# enabled in the model catalog — the routing target is deepseek-v4.1-flash# (see its _comment in the model catalog for the id's own history).bash .claude/scripts/mr-delegate.sh t1k-code-reviewer \ "audit src/auth/ for OWASP Top 10" \ --backend ccs --model deepseek-v4.1-flashModel + Backend Selection
Section titled “Model + Backend Selection”When you call the explicit form, YOU pick (backend, model). When the interceptor fires, the mapping picks for you.
- Read
.claude/model-capabilities.mdfor model strengths/costs. - Read the model catalog (
.claude/) for available backends. - Choose the best (backend, model) for task complexity.
Pass via --backend <backend> --model <model> flags. Both required — no defaults.
Model Quick Reference
Section titled “Model Quick Reference”| Need | Model | Backend | Why |
|---|---|---|---|
| Cheapest possible | deepseek-v4.1-flash | the hosted backend | Only enabled text/tool-use model; the shipped modelMapping default for sonnet and haiku (route ccs) |
| Best balance | deepseek-v4.1-flash | the hosted backend | Sole enabled text target — DeepSeek V4.1 Flash under its real the hosted backend id |
| Best reasoning | deepseek-v4.1-flash | the hosted backend | Same model as “Cheapest possible” — carries the reasoning tag itself, only enabled target |
| Long context | deepseek-v4.1-flash | the hosted backend | Declares long-context, 1M window |
| Vision (image blocks) | deepseek-v4.1-flash | the hosted backend | Carries vision and is FIRST in capabilityPipes.vision — measured on a same-family carry-over, so re-measure before relying on it; images only, no PDFs — see .claude/model-capabilities.md |
| Explicit failover fallback | glm-5.3-flash | glm | failover.pipe is deepseek-v4.1-flash (the pick) then glm-5.3-flash (failover hop 2); glm-5.3-flash is also the video role route |
Every model here is enabled: true in the model catalog. Older names still seen in issues
and archived design docs — qwen3.5-plus, kimi-k2.5, glm-5.1, glm-5.2, kimi-for-coding, deepseek-v4-pro, deepseek-v4-flash and deepseek-flash (superseded; current successor deepseek-v4.1-flash), kimi-k2.6, kimi-k2.7-code-highspeed, gpt-5.4-mini, minimax-m2.7, the
mimo-* family — ship disabled and are not valid --model targets unless a consumer
re-enables them locally.
Full details: read .claude/model-capabilities.md.
Safety
Section titled “Safety”Every delegation enforces:
- Tool whitelist from the agent’s own frontmatter (Claude Code respects
tools:/disallowedTools:). - Permission mode read from agent frontmatter; safe fallback (
plan) if missing. - Max turns from agent frontmatter; default 25 if missing.
- Budget cap from agent frontmatter; default $5 if missing.
- Timeout (5 minutes default).
- No nested delegation (
MR_SPAWNEDguard at both the script and the interceptor). - Write lock (single write-capable agent at a time when
mode=acceptEdits). - Telemetry (events sent to T1K cloud for monitoring).
excludeAgentslist int1k-config-mr.json— any agent here is never intercepted (e.g.t1k-debugger,t1k-plannerfor tasks that genuinely need Opus).
Logs & Telemetry
Section titled “Logs & Telemetry”- Local logs:
~/.model-router/calls.jsonl(carries the agent name). - Tool usage:
~/.model-router/tool-usage.jsonl. - Live hop activity:
bash .claude/scripts/mr-watch.sh— streams the routed hop’s own transcript (text, tool calls, results) in a separate terminal, at zero context cost. Use it when a delegation is running long and you want to see what the cheap model is actually doing; the conversation it was spawned from cannot show this, because the delegation runs inside a synchronousPreToolUsehook. - Worker schema: the existing
rolecolumn carries the agent name (no migration).
See The1Studio/theonekit-model-router#42 for the v2 design rationale and #54 for the v3.3.0 kit-enforced Opus-family passthrough policy.