Claude Code. Any Model. The most powerful AI coding agent now speaks every language.
docs(mcp): document per-model effort, needs_effort and bare model names
Jack Rudenko7518d4adcf64
diff --git a/CLAUDE.md b/CLAUDE.mdindex c3bbb1d4..e22492a7 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -9,8 +9,8 @@ lives in `ROADMAP.md`.## Where the rationale lives — all files below are in `ai-docs/architecture/`-- `routing.md` — `provider@model` syntax, every provider prefix, catalog-gathered route candidates and their tier order, `defaultProvider` as the fallback position, the derived picker provider list, `SUBSCRIPTION_PROVIDERS`, local models-- `wire.md` — every request built from the connection's catalog `wire` + route registry (no model-name rules anywhere); clamp / borrow-and-drop / try-in-turn; the first-run refusal trap; `+pro` vs the `+` chain separator; custom endpoints' declared wire; read before touching `connection-*.ts`, `wire-*.ts`, step 5w, or any limit/reasoning field+- `routing.md` — `provider@model` syntax, every provider prefix, why MCP tools remove an unrequested `provider@` (`user_required_provider`), catalog-gathered route candidates and their tier order, `defaultProvider` as the fallback position, the derived picker provider list, `SUBSCRIPTION_PROVIDERS`, local models+- `wire.md` — every request built from the connection's catalog `wire` + route registry (no model-name rules anywhere); clamp / borrow-and-drop / try-in-turn; the first-run refusal trap; `+pro` vs the `+` chain separator; custom endpoints' declared wire; recommended effort (the efforts sidecar, shown by MCP `list_models`; a call with no effort answers `needs_effort`; the calling agent passes one effort per model); read before touching `connection-*.ts`, `wire-*.ts`, step 5w, or any limit/reasoning field- `adapters.md` — Layers 1–3, stream parsers, error classification and retry, the 400 remap, why Gemini tool schemas need `items` on every array; Codex zero-delta tool calls, the `parallel` wrapper, the Responses leg/turn split with in-turn retry and the 150 s stall guard, and the non-streamed SSE-error contract (`x-claudish-stream-failure`); the signing-value registry (exact-value redaction of the credentials a request signed with, its leases and the sink table) and an internal call's abort signal and every reach point. Read before adding any log or client-body sink of upstream text- `code-mode.md` — `--code-mode` for `openai-codex`: one `exec` tool running JavaScript in a QuickJS sandbox, nested calls relayed as `tool_use` blocks; the decision order, lite/classic shapes and the lite → classic fallback, step 5r resume and tombstones, the input builder, store byte caps, and the sandbox limits (a 32 MiB heap limit does NOT bound wasm memory). Read before editing `code-mode/`, step 5d/5r, or the leg parser's exec handling- `network-recovery.md` — the two-tier connection hold: the DERIVED deadline (`API_TIMEOUT_MS`, not adiff --git a/ai-docs/architecture/routing.md b/ai-docs/architecture/routing.mdindex 593ae980..b2d60206 100644--- a/ai-docs/architecture/routing.md+++ b/ai-docs/architecture/routing.md@@ -61,6 +61,25 @@ Claudish supports local models via:Local APIs report `prompt_tokens` as the FULL conversation context on every request, not anincrement — see `ai-docs/architecture/context-window.md`.+## MCP callers pass bare names: an unrequested `provider@` is removed (2026-10-23)++The agent that calls the MCP tools often writes a `provider@` the user never asked for: it+copies one from the `list_models` Access line, or guesses. That spec bypasses the user's+routing (configured providers, subscription first, preferences, manual overrides). Measured in+the `recommended-effort` bench run1: the agent sent `oai@gpt-6-luna` from the Access line,+was billed on the metered API and got `credit_balance_exhausted`, while `cx@` (the+subscription) would have served the bare name.++So `team` (`models`, `judges`), `create_session` and `run_prompt` remove the provider+(`stripUnrequestedProvider`, `mcp-server.ts`) unless the caller lists the spec in+`user_required_provider` (the user named the provider). Only a single `provider@model` whose+model part is exactly a canonical model id of the cloud models catalog is changed; markers+(`+pro`, `#fast`) stay. Unchanged: chains, local providers, `custom-url`, legacy syntax, and a+wire id that is not a catalog model id (`kc@k3`), since its bare form may not route. The+answer names every removal (`provider_note` / `note`) and the MCP log records it.+`compare_models` is not changed: it is a debug tool, where comparing providers can be the+point.+## Which names reach `route()`**One gate: `proxyRouteDecision`** (`providers/native-route.ts`). The proxy's step 2c asks itdiff --git a/ai-docs/architecture/wire.md b/ai-docs/architecture/wire.mdindex c7c68585..606bf2e0 100644--- a/ai-docs/architecture/wire.md+++ b/ai-docs/architecture/wire.md@@ -68,6 +68,50 @@ wire overwrote it. With no wire the adapter now fills from the same catalog fiel(`lookupModelMaxOutputTokens`), or leaves the field out. On generation`g-20261016053727894-8a743761` 6 of 58 Messages connections had no model `maxOutputTokens`, `minimax-m3` among them.+## Recommended effort++models-index publishes `data.recommendations.efforts[modelId][taskType] = {effort, basis,+sendableOn, ...}` on `?catalog=recommended` (2.3.0). The value is a canonical level (`low` …+`max`). `getRecommendedModels` writes it, normalised, to+`~/.claudish/cloud-models-catalog-v3.efforts.json` (`providers/effort-recommendations.ts`) for the+generation it read, before the `top100` fetch, so a `top100` failure cannot lose it.++**claudish does not choose a task type.** The agent that calls the claudish MCP tools already+knows its task, so it chooses (Jack, 2026-10-22):++1. `list_models` appends the newest generation's table: a row per canonical model id, a column+ per task type.+2. The caller maps its task to a column and takes the cell for each model it runs. The models+ can come from the user or be fixed by the task; the lookup is the same.+3. It passes one effort per model: `team` `efforts: {"<model>": "<level>"}` (keys exactly as in+ `models`), `create_session` `effort`, `run_prompt` `effort`.+4. `team` and `create_session` append claudish's own `--effort-override <level>` to the child's+ flags (after `claude_flags`, so it wins). The child's proxy pins that level on every request,+ as the flag always did. `run_prompt` sends `output_config.effort`, the field Claude Code+ sends, and step 5w maps it onto the connection's published levels.++A model with no entry keeps Claude Code's own effort, which is the behaviour from before.++A call with NO effort at all, while one of its models has a row, starts nothing and answers+`needs_effort:` with those rows (`effortClarification`, `mcp-server.ts`); `efforts: {}` or+`effort: "default"` keeps Claude Code's own level on purpose. Measured why (bench+`recommended-effort` run9, 2026-10-23): with exact model ids the calling agent went straight+to `team` / `create_session` in 16/16 sessions, never opened the `claudish-usage` skill (0/8+with the new skill) and passed no effort; the `efforts` parameter description alone did not+change that (run2, 0/6). When the user named only a family, it read `list_models` and matched+the table 8/8. `list_models` names no provider: its old Access line (`[email protected]`) was+copied into calls and bypassed routing (2 of 3 run9 failures). On a+bare Claude name the effort is ignored: the native passthrough and `run_prompt`'s print path+never reach step 5w.++Rejected (built and removed on 2026-10-22): a task classifier inside the proxy that labelled+each user turn with one call to a lightweight model, plus `--task`, MCP `task_type` and plan-mode+and slash-command rules. It added about 1.7 s (median, 10 calls on `cx@gpt-6-luna`) before the+first request of every unlabelled turn, and it needed demotion rules, a timeout and user-set+effort detection. It guessed a fact that the calling agent already had. The work is kept in the+gitignored session `dev-feature-recommended-effort-20261021-101332-a05a`, under+`backup-before-rework-*`.+## Traps- **Older claudish erases the registry.** Releases before 10.5.0 rewritediff --git a/docs/usage/mcp-server.md b/docs/usage/mcp-server.mdindex a83026b5..46b8993f 100644--- a/docs/usage/mcp-server.md+++ b/docs/usage/mcp-server.md@@ -67,6 +67,8 @@ routing straight to the provider's API.- `model` (required) - Model name or model spec. A bare name auto-routes to the best provider (e.g., `kimi-k3`, `glm-5.3`); `provider@model` pins the provider (e.g., `google@gemini-4-argon`, `or@x-ai/grok-4.7`).- `prompt` (required) - The prompt to send- `system_prompt` (optional) - System prompt for context+- `user_required_provider` (optional) - `true` when you, the user, named the provider: the `provider@model` spec is sent as given. Without it, a `provider@` on a cloud catalog model is removed so claudish routing picks the provider from your setup; the answer names what was removed. Local providers, custom URLs and chains are never changed+- `effort` (optional) - Reasoning effort for this request (`none` … `max`). Take it from the `list_models` effort table; `default` keeps Claude Code's own. Omitted while the model has a row in the table, nothing runs and the answer is `needs_effort:` with that row. Sent as `output_config.effort` and mapped onto the levels the model's connection publishes; ignored for a bare Claude nameThere is no output-limit parameter. The request carries no `max_tokens`, so the provider appliesits own default.@@ -118,6 +120,11 @@ List recommended models with pricing and capabilities.- Context window- Capabilities (Tools, Reasoning, Vision)+After the models, a **Recommended effort by task type** table from the cloud models catalog: a+row per model, a column per task type (`planning`, `implementation`, `code_review`, …). The+calling agent picks the column for its task and passes each model's cell as `team` `efforts` or+`create_session` / `run_prompt` `effort`. claudish never guesses the task type itself.+---### `search_models`@@ -172,6 +179,8 @@ interactive Claude Code session in its own headless magmux pane (see "Requiremen- `mode` (required) - One of: `run`, `status`, `list`, `capture`, `cancel`, `resize`, `judge`, `run-and-judge`- `path` - Session directory path (must be within current working directory). Required by every mode except `list`- `models` - Model IDs to run (required for `run` and `run-and-judge`). Native Claude names (`opus`, `sonnet`, `haiku`, `internal`) are runnable slots too+- `user_required_provider` - The `models` / `judges` entries whose provider you, the user, named, exactly as written there. A `provider@` on a cloud catalog model is removed so claudish routing picks the provider from your setup; the answer names what was removed. Local providers, custom URLs and chains are never changed+- `efforts` - Reasoning effort per model, e.g. `{"gpt-6-luna": "high", "kimi-k3": "max"}`. Keys must match a `models` entry exactly. Take each level from the `list_models` effort table. The slot pins it on every request (`--effort-override`); a model without an entry keeps Claude Code's own effort. Omitted while a model has a row, nothing starts and the answer is `needs_effort:` with the rows; `{}` keeps Claude Code's own effort for every model- `judges` - Model IDs to use as judges (default: same as runners)- `input_file` - Path to a file holding the task prompt (preferred for anything longer than a sentence)- `input` - Task prompt as inline text. If neither is given, an `input.md` already in the session directory is used@@ -339,6 +348,8 @@ is interactive and waits for `send_input`.- `timeout_seconds` (optional) - Session timeout in whole seconds, 1-3600 (default: 600). A fractional value is rounded and an out-of-range one clamped, so `spawn.json` always carries an integer in that range- `agent` (optional) - Claude Code subagent the session runs as, e.g. `dev:reviewer`- `claude_flags` (optional) - Other Claude Code / claudish flags and their values, space-separated, never positional text (write `--allowedTools Read,Bash`; a value after a Claude Code switch, as in `--brief now`, would be the session's first prompt and is refused). Flags the pane owns (`-p`, `--resume`, `--model`, …) and print-mode-only flags (`--max-turns`, `--max-budget-usd`, …) are refused+- `user_required_provider` (optional) - `true` when you, the user, named the provider. A `provider@` on a cloud catalog model is removed so claudish routing picks the provider from your setup; the answer names what was removed. Local providers, custom URLs and chains are never changed+- `effort` (optional) - Reasoning effort for the whole session, from the `list_models` effort table. Pinned on every request (`--effort-override`), over one in `claude_flags`. `default` keeps Claude Code's own; omitted while the model has a row, nothing starts and the answer is `needs_effort:`- `work_dir` (optional) - Working directory for the session (default: current directory)- `setup_from` (optional) - Directory whose `.claude/settings.json` and `settings.local.json` the session inherits, so a session in another `work_dir` keeps your project's plugins and agents. Default: your project directory, when `work_dir` differs from it. `null` keeps the session on `work_dir`'s own settings onlydiff --git a/packages/cli/skills/claudish-usage/SKILL.md b/packages/cli/skills/claudish-usage/SKILL.mdindex d32f1fe5..a559271d 100644--- a/packages/cli/skills/claudish-usage/SKILL.md+++ b/packages/cli/skills/claudish-usage/SKILL.md@@ -45,6 +45,43 @@ Does user say "directly" or "in main context"? → YES → Run in main context (Find appropriate agent or create one → Delegate to sub-agent (default)```+### 🏷️ Model Names++claudish routing picks the provider from the user's setup: their configured providers,+subscriptions first, their preferences and manual overrides. Do not choose it yourself.++1. **Pass bare names** (`gpt-6.1-sol`, `minimax-m3`), never `provider@model`, unless the+ user named the provider. A `provider@` on a catalog model is removed by the MCP tools,+ and their answer says so.+2. **User named the provider** ("run Kimi on OpenRouter"): pass the spec and list it in+ `user_required_provider` (`team`: an array of those `models`/`judges` entries;+ `create_session` / `run_prompt`: `true`).+3. **User named exact models:** pass them as given. No `preflight` or `search_models`+ call is needed to check them: claudish routes and checks them. You still read+ `list_models` once for their efforts (next section).+4. **User named only a family or vendor** ("a GPT model", "minimax", "latest Grok"): call+ `list_models` and take the newest model of that family from it, as a bare name.++### 🎚️ Reasoning Effort per Model++Before `team`, `create_session` or `run_prompt` on an external model:++1. Call `list_models`. Its last section, **Recommended effort by task type**, has a row per+ model and a column per task type.+2. Map YOUR task to one column (planning, implementation, code_review, debugging, …). You+ know the task; claudish does not guess it.+3. For each model you run, take its cell. This works the same when the models were chosen+ with the user and when the task already fixed them.+4. Pass it: `team(..., models: [...], efforts: {"<model>": "<level>"})` with keys exactly+ as in `models`, or `create_session(..., effort: "<level>")`, or+ `run_prompt(..., effort: "<level>")`.++A model with no row, or `-` in your column, gets no entry: it keeps Claude Code's own effort.++If you call without any effort while a model has a row, nothing starts: the tool answers+`needs_effort:` with each model's levels by task type. Pick your column and call again. To keep+Claude Code's own level on purpose, pass `efforts: {}` (`team`) or `effort: "default"`.+## 🤖 Agent Selection Guide### Step 1: Find the Right Agent@@ -167,14 +204,12 @@ Claudish (Claude-ish) is a proxy tool that:## Model Routing-| Prefix | Backend | Example |-|--------|---------|---------|-| _(none)_ | OpenRouter | `openai/gpt-5.3` |-| `g/` `gemini/` | Google Gemini | `g/gemini-2.0-flash` |-| `oai/` `openai/` | OpenAI | `oai/gpt-4o` |-| `ollama/` | Ollama | `ollama/llama3.2` |-| `lmstudio/` | LM Studio | `lmstudio/model` |-| `http://...` | Custom | `http://localhost:8000/model` |+| You write | claudish does | Example |+|-----------|---------------|---------|+| bare name | routes through the user's setup (subscription first) | `gpt-6.1-sol` |+| `provider@model` | that provider only (MCP tools: only with `user_required_provider`) | `or@moonshotai/kimi-k3` |+| `ollama@` `lmstudio@` | a local model, never stripped | `[email protected]` |+| `http://...` | a custom endpoint, never stripped | `http://localhost:8000/model` |**Use Cases:**- Run tasks with different AI models (Grok for speed, GPT-5.3 for reasoning, Gemini for large context)