Skip to content

Runs Claude Code

Alexander Kurganov edited this page Nov 26, 2026 · 8 revisions

Runs of model-router in Claude Code. Newest first. Home holds the entry template.

2026-11-26 · Whether the text a tool.describe hook adds reaches the model in the Agent description

Claude Code 2.1.332 · branch claude/brief-text-9d30c8 at 25c5cb4 · live

Question. With a tool.describe hook for Agent that adds a text after the description, does the main agent see the description end with that text, and what does a subagent see?

Verdict. The main agent quotes the added text, word for word, as the last three sentences of the Agent description. A general-purpose subagent has an Agent tool too, and it finds the first sentence of the text in that tool's description.

Command

# Run from an empty folder, with the plugin folder of a checkout at the commit.
# --setting-sources project left the user's settings out of the run.
claude -p "<prompt>" --plugin-dir <checkout>/plugins/model-router --setting-sources project \
  --strict-mcp-config --model haiku --max-turns 4 --output-format stream-json --verbose \
  --debug-file <log> < /dev/null

# The prompt:
# Do exactly two things and nothing else.
# 1. Quote word for word the last three sentences of the description of your Agent tool, inside <main> tags.
# 2. Call the Agent tool once with subagent_type general-purpose and this prompt, unchanged: "Answer
#    from what you can see and use no tools. First list the names of all tools you have. Then, apart
#    from this message, quote word for word every sentence you can see that contains the word
#    model-router, or write NONE." Then print the subagent's reply unchanged inside <child> tags.

Observed

# The debug log, with its time stamp cut:
[DEBUG] hooks module model-router@inline loaded (worker, environment 1, tier user); events: agent.offer,tool.call,tool.describe,agent.spawn,turn.step,turn.complete,session.start,command.run

# The main agent, on claude-haiku-5-5:
<main>When model-router routes a subagent, it picks the model from this brief. Say what is already decided. If nothing is left to decide, say that nothing is; otherwise name what you leave to the subagent.</main>

# The subagent's reply, cut after its first item. The other items were the plugin's skills.
**Tools I have:** Agent, Artifact, Bash, Edit, ListAgents, Read, ReportFindings, Skill, ToolSearch, Write.
**Sentences containing "model-router":**
1. From the Agent tool description: "When model-router routes a subagent, it picks the model from this brief."

# The result event: "num_turns":2, "is_error":false, one subagent spawned.

2026-11-22 · Whether a subagent call routes by the provider the person has just set

Claude desktop app 6.28899.6, Code tab, Agent SDK 0.3.330 · plugin 0.25.0 · live

Question. In an open session, after the person sets provider with /model-router:provider <value>, does the next subagent call route by that value, and does its line name who answered, for typesafe, openai and google on the direct path?

Verdict. Yes for all three. The next subagent call after each command was scored by the provider just set, with no /reload-plugins between the command and the call, and its line names that provider. For the one task the three providers gave the same level, model and effort. The plugin was the installed one, loaded from the versioned cache.

Command

# One open interactive session. The plugin was installed from its marketplace, updated with
# `claude plugin update model-router@model-router`, and loaded by /reload-plugins.
# gateway was direct and scope was extended throughout.
# A check is one Agent call with no subagent_type, no model and no name, and the prompt
# "Reply with the single word ok." The subagent answered ok each time.
# Before each check the plugin's config tool was called with no input. Its scope line and its
# key line are left out below.
# The routing lines are the lines the session showed for the three checks.
# Typed at the prompt, in this order:
/reload-plugins
#   config tool, check
/model-router:provider openai
#   config tool, check
/model-router:provider google
#   config tool, check
/model-router:provider typesafe

Observed

provider: typesafe
gateway: direct (typesafe)
model-router L0 haiku · medium · p=0.97/1.00 · typesafe jev-1.14.0 · 678/30 tok
model-router: provider: openai
provider: openai
gateway: direct (openai)
model-router L0 haiku · medium · p=0.71/0.76 · openai gpt-6-luna · 560/0 tok
model-router: provider: google
provider: google
gateway: direct (google)
model-router L0 haiku · medium · p=0.87/0.91 · google · 487/0 tok
model-router: provider: typesafe

2026-11-22 · Whether the provider and gateway commands write, and when the mod gets the value

Claude Code 2.1.318 · branch integration/decision-providers at bb0aee2 · live

Question. Does /model-router:gateway <value> or /model-router:provider <value> write the option, and does the mod get the written value in the same session?

Verdict. A command typed at the prompt of an interactive session writes the option under pluginConfigs. Claude Code then reloads the hooks module in the same session and runs session.start again, and a later command prints the written values. The same command given as the prompt of claude -p reaches the command hook, prints the current value and writes nothing. No model turn ran, so the run shows neither the dialogs of the config tool nor a routed spawn after a write.

Command

export CLAUDE_CONFIG_DIR=<copy>
claude -p "/model-router:gateway openrouter" --plugin-dir plugins/model-router --model haiku --max-turns 1 \
  --output-format stream-json --verbose --debug-file <log>
claude -p "/model-router:provider openai" --plugin-dir plugins/model-router --model haiku --max-turns 1 \
  --output-format stream-json --verbose --debug-file <log>
# Then one interactive session in a pseudo-terminal, started in an empty folder whose
# folder-trust dialog was accepted, and driven by a one-off script that is not in the repository:
claude --plugin-dir plugins/model-router --model haiku --debug-file <log>
# Typed at its prompt, in this order. After each command the script printed the plugin's
# entry of pluginConfigs in <copy>/settings.json.
/model-router:gateway openrouter
/model-router:provider openai
/model-router:gateway auto
/model-router:provider google
/model-router:gateway
/exit
# The capture of the interactive screen drops the spaces that terminal codes stand for, so the
# four reply lines of that session are shown below with the spacing of the print-mode line.
# The debug log lines are shown without their timestamps, and the two result lines without
# the last field the script prints.

Observed

== claude version
2.1.318 (Claude Code)
== stored before any turn
pluginConfigs: none
== turn 1: the gateway command with a value
turn 1: prompt=/model-router:gateway openrouter; claude exit status 0
event kinds: {"assistant/None": 1, "result/success": 1, "system/init": 1}
result: is_error=False subtype=success turns=0 cost_usd=0
result text (first 300 chars): model-router: gateway: direct (typesafe)
-- debug log lines that name the mod (first 12, cut to 240 chars)
[DEBUG] Loaded inline content command from plugin model-router: model-router:provider
[DEBUG] Loaded inline content command from plugin model-router: model-router:gateway
[DEBUG] hooks module model-router@inline loaded (worker, environment 1, tier user); events: agent.offer,tool.call,agent.spawn,turn.step,turn.complete,session.start,command.run
[DEBUG] hooks module model-router@inline session.start settled in 238.4ms (worker hop, next() included)
[DEBUG] model-router (user) answered command.run without next() in 0.4ms; nothing beneath it ran for this dispatch
[DEBUG] hooks module model-router@inline command.run settled in 0.9ms (worker hop, next() included)
-- stored after turn 1
pluginConfigs: none
== turn 2: the provider command with a value
turn 2: prompt=/model-router:provider openai; claude exit status 0
event kinds: {"assistant/None": 1, "result/success": 1, "system/init": 1}
result: is_error=False subtype=success turns=0 cost_usd=0
result text (first 300 chars): model-router: provider: typesafe
-- debug log lines that name the mod (first 12, cut to 240 chars)
[DEBUG] Loaded inline content command from plugin model-router: model-router:provider
[DEBUG] Loaded inline content command from plugin model-router: model-router:gateway
[DEBUG] hooks module model-router@inline loaded (worker, environment 1, tier user); events: agent.offer,tool.call,agent.spawn,turn.step,turn.complete,session.start,command.run
[DEBUG] hooks module model-router@inline session.start settled in 209.6ms (worker hop, next() included)
[DEBUG] model-router (user) answered command.run without next() in 0.4ms; nothing beneath it ran for this dispatch
[DEBUG] hooks module model-router@inline command.run settled in 0.6ms (worker hop, next() included)
-- stored after turn 2
pluginConfigs: none
== the interactive session
stored before: pluginConfigs: none
/model-router:gateway openrouter
gateway: openrouter (openrouter)
pluginConfigs[model-router@inline].options (provider, gateway, scope only): {"gateway": "openrouter"}
/model-router:provider openai
provider: openai
pluginConfigs[model-router@inline].options (provider, gateway, scope only): {"gateway": "openrouter", "provider": "openai"}
/model-router:gateway auto
gateway: auto (openai, then openrouter)
/model-router:provider google
provider: google
pluginConfigs[model-router@inline].options (provider, gateway, scope only): {"gateway": "auto", "provider": "google"}
/model-router:gateway
gateway: auto (google, then openrouter)
-- debug log lines that name the mod, from the start of the session through the second write
[DEBUG] plugin model-router: no pluginConfigs["model-router" or "model-router@inline"].options in user, --settings or managed settings (project settings are not read); every option is its default
[DEBUG] hooks module model-router@inline loaded (worker, environment 1, tier user); events: agent.offer,tool.call,agent.spawn,turn.step,turn.complete,session.start,command.run
[DEBUG] hooks module model-router@inline session.start settled in 108.2ms (worker hop, next() included)
[DEBUG] hooks module model-router@inline reloaded in 4.0ms; events: agent.offer,tool.call,agent.spawn,turn.step,turn.complete,session.start,command.run
[DEBUG] [model-router] $.ui.log: options changed — reloaded (7 hooks: agent.offer, tool.call, agent.spawn, turn.step, turn.complete, session.start, command.run)
[DEBUG] model-router (user) answered command.run without next() in 50.9ms; nothing beneath it ran for this dispatch
[DEBUG] hooks module model-router@inline command.run settled in 52.5ms (worker hop, next() included)
[DEBUG] hooks module model-router@inline session.start settled in 12.0ms (worker hop, next() included)
[DEBUG] hooks module model-router@inline reloaded in 3.3ms; events: agent.offer,tool.call,agent.spawn,turn.step,turn.complete,session.start,command.run
[DEBUG] [model-router] $.ui.log: options changed — reloaded (7 hooks: agent.offer, tool.call, agent.spawn, turn.step, turn.complete, session.start, command.run)
[DEBUG] model-router (user) answered command.run without next() in 38.7ms; nothing beneath it ran for this dispatch
[DEBUG] hooks module model-router@inline command.run settled in 40.0ms (worker hop, next() included)
[DEBUG] hooks module model-router@inline session.start settled in 3.3ms (worker hop, next() included)

2026-11-21 · A stored option value across a manifest update

Claude Code 2.1.318 · a test plugin, no model-router build · live

Question. Does a stored option value that the new manifest's options list no longer holds reach the mod unchanged, and does a never-stored option reach it with its manifest default?

Verdict. A stored value outside the new options list reached the mod as the manifest default, as did a never-stored option; the settings file kept the stored value. Both turns ended in a sign-in error, and each debug log held the mod's load and its session.start hook.

Command

export CLAUDE_CONFIG_DIR=<copy>
claude plugin marketplace add <scratch>/run/options-probe-market
claude plugin install options-probe@options-probe-market --config provider=auto
claude -p "Reply with the single word ok." --model haiku --max-turns 1 \
  --output-format stream-json --verbose --debug-file <scratch>/run/debug-A.log
# replace the plugin folder with the second version, then:
claude plugin marketplace update options-probe-market
claude plugin update options-probe@options-probe-market
claude -p "Reply with the single word ok." --model haiku --max-turns 1 \
  --output-format stream-json --verbose --debug-file <scratch>/run/debug-B.log

Observed

== claude version
2.1.318 (Claude Code)
== step 1: marketplace, v1 tree, install with provider=auto
Adding marketplace…✔ Successfully added marketplace: options-probe-market (declared in user settings)
Installing plugin "options-probe@options-probe-market"...✔ Successfully installed plugin: options-probe@options-probe-market (scope: user)
== step 2: stored value after the install
pluginConfigs[options-probe@options-probe-market]: {"options": {"provider": "auto"}}
== step 3: control turn A
turn A: claude exit status 1
[DEBUG] hooks module options-probe@options-probe-market loaded (worker, environment 1, tier user); events: session.start
[DEBUG] hooks module options-probe@options-probe-market session.start settled in 232.8ms (worker hop, next() included)
turn A failed or showed a sign-in marker, but the mod's line is in the log; the run goes on
log A: options-probe 1.0.0 {"provider":"auto"}
version=1.0.0 provider='auto' gateway='<absent>' option keys=['provider']
control A: valid, the stored auto reached the mod
== step 4: v2 tree, marketplace update, plugin update
Updating marketplace: options-probe-market...Validating local marketplace
✔ Successfully updated marketplace: options-probe-market
marketplace update exit status: 0
Checking for updates for plugin "options-probe@options-probe-market"…
✔ Plugin "options-probe" updated from 1.0.0 to 2.0.0 for scope user. Restart to apply changes.
plugin update exit status: 0
== step 5: turn B
turn B: claude exit status 1
[DEBUG] hooks module options-probe@options-probe-market loaded (worker, environment 1, tier user); events: session.start
[DEBUG] hooks module options-probe@options-probe-market session.start settled in 2.4ms (worker hop, next() included)
turn B failed or showed a sign-in marker, but the mod's line is in the log
log B: options-probe 2.0.0 {"provider":"typesafe","gateway":"direct"}
version=2.0.0 provider='typesafe' gateway='direct' option keys=['gateway', 'provider']
turn B: the copy ran version 2.0.0
== step 6: stored value after the update
pluginConfigs[options-probe@options-probe-market]: {"options": {"provider": "auto"}}

2026-11-20 · The first spawn routes with the scoring call on the engine clock

Claude Code 2.1.308 · branch claude/shared-harness-parts-13c4af at ffd3e0e · evals

Question. With the scoring call waiting on a clock the adapter builds on $.clock.after, and with the routing limit, the outcome and the key rule taken from the core, does the first subagent spawn of a headless Claude Code session get routed by a real scoring call?

Verdict. The spawn is routed: the scoring call returns a decision, and the line names the level, the model, the effort, both probabilities, the provider, the Jev model and the token counts.

Command

gh workflow run evals.yml --ref claude/shared-harness-parts-13c4af
# The claude job builds the bundles, installs the plugin from the checkout and runs:
node scripts/evals.ts run --client claude --out "$RUNNER_TEMP/results"

Observed

case: claude-first-spawn-routed
model: haiku
spawns: 1
routed: true
line: L0 haiku · medium · p=0.97/0.99 · typesafe jev-1.14.0 · 710/30 tok
reply: eval-subject
passed: true

2026-11-19 · The first spawn routes through the plugin's own transport

Claude Code 2.1.308 · branch claude/own-transport-d96ec0 at f631cf1 · evals

Question. With the scoring request sent by the plugin's own transport and no TypeSafe SDK, does the first subagent spawn of a headless Claude Code session get routed by a real scoring call?

Verdict. The spawn is routed: the scoring call returns a decision, and the line names the level, the model, the effort, both probabilities, the Jev model and the token counts.

Command

gh workflow run evals.yml --ref claude/own-transport-d96ec0
# The claude job builds the bundles, installs the plugin from the checkout and runs:
node scripts/evals.ts run --client claude --out "$RUNNER_TEMP/results"

Observed

case: claude-first-spawn-routed
model: haiku
spawns: 1
routed: true
line: L0 haiku · medium · p=0.94/0.98 · jev jev-1.14.0 · 712/30 tok
reply: eval-subject
passed: true