Harness x plan x rewrite-honored matrix
Downshift by Tiago Vilas Boas. Updated . Source on GitHub
Historical snapshot: The page header says it was updated on 3 November 2026; some sections cite different dates. Details may have changed. Check the linked source on GitHub and the current harness matrix before relying on compatibility claims.
Downshift by Tiago Vilas Boas https://github.com/tiagovilasboas/downshift-ai
Status per harness
OpenCode update: The rows below describe an older snapshot. The current harness matrix reports live verification on OpenCode 2.2.5 of routing, the honored model chain, shell rewrite, child end and per-child token usage. Retry fallback and a go test rewrite through the plugin remain unverified live.
Each harness carries exactly one of four status words (owner decision 2026-10-17; Beta added 2026-10-18); the table below it keeps the per-plan facts.
- Completed: rewrite observed honored on a real child, usage and child end recorded, plugin and session policy.
- Functional: the hook emits the rewrite on a real spawn and passes the shared conformance suite; observation is partial (honored is inferred or unconfirmed, no child usage).
- Beta: first-class integration under active development — adapter, route wire and shared conformance in the repository and green; the harness-side plugin and the first live observation are still ahead, so no live spawn is observed yet and there is no production claim (owner decision 2026-10-18).
- Experimental (proof of concept): policy mode or one observed child on one build; shipped, but no production claim.
cmd/downshift/conformance_test.go drives the same 8 routing scenarios against every registered hook, so each harness below, whatever its status, computes every feature (layering rule); the status says how much has been verified on the real harness, not how much code it runs.
| harness | status | why | evidence |
|---|---|---|---|
| claude-code | Completed | Rewrite observed honored (2026-10-06, API-reported child model); usage tokens read from the child transcript at SubagentStop; child end recorded; plugin and session policy ship. Failure payload is still GAP-CHILD-FAILURE (see "Child end" below). |
rewrite honored, billing audit, routing A/B |
| codex | Functional | Rewrite emitted on a real spawn; honored is inferred from the next spawn, not observed; child end parser unverified, no usage source. | codex rewrite |
| cursor | Functional | Rewrite emitted on a real spawn; the child executor model is absent from the transcript, so honored is unconfirmed (discarded on Free and legacy Pro); end parser unverified, no usage; native quota collector blocked on Cursor 3.24.9. | cursor rewrite, gap diagnostic |
| kirocrew | Experimental | Policy mode: block and retry observed once on Kiro CLI 2.29.0, no in-place rewrite; child end via postToolUse (unverified: needs real payload). | native hook |
| antigravity | Experimental | One observed child on desktop 2.21.1 (requested pro, executed flash_lite); the overwrite envelope is not a documented vendor field; no child end recorded; quota mapping unresolved. |
executor ack, runtime source |
| opencode | Beta | First-class integration under active development (owner decision 2026-10-18): adapter, route wire v1 and shared conformance in the repository; the forwarding plugin is in development and no live spawn is observed yet. Route answers, fail-open paths and observation parsing are covered by adapter tests and the shared conformance suite. No child end recorded yet; usage seam not proven. | adapter tests, conformance |
| grok | Config only | No hook rewrite; reasoning is pinned in config.toml. |
install.md |
| claude-desktop-chat | Experimental | Chat spawns no model-carrying subagent and has no shell tool, so model_rewrite, compaction and mid_session_routing are none; the six information MCP tools (providers, status, playbook, apply, plan, retrieve) answer over stdio, while delegate/collect/cancel/diff/send/steer/release fail with ErrNoVerifiedMode only when the worker mode is off (on Windows, or when the owner turns it off); on macOS and Linux they run read-only by default. Not a hooked harness: it has no row in the per-plan, child-end or discovery tables. | F2-chat-mcp |
| claude-desktop-cowork | Experimental | The Claude Desktop local agent runs in a Linux arm64 VM that shares only granted folders over virtiofs; host hooks, the plugin, ~/.claude and the macOS binary never reach the guest, so model_rewrite, compaction, token_counts, mid_session_routing and savings_estimation are none and MCP reachability is unverified. Not a hooked harness: it has no row in the per-plan, child-end or discovery tables. | F3-cowork-vm |
Claude Code, 12 of 14 inferred honored (2026-10-29, counts only, no prompts): one miss was a genuine ignored rewrite, a Haiku rewrite whose linked resolved record, 93 ms later, reported Opus with rewrite_honored: false. It matches the CLAUDE_CODE_SUBAGENT_MODEL_FORCE override described in the CHANGELOG (doctor now fails on it); routing is unchanged. The other had no resolved, child_ended or later spawn in its session, so it is unobserved, not refuted. Two more shifts without a session id are outside the count. doctor now reports these apart: seen: 12 of 14 rewrites (1 refuted: ...; 1 not observed: ...).
"Rewrite honored" means the harness executor applied the hook's model rewrite to the child subagent, not just that downshift emitted one. outcome: "rewrite_emitted" proves emission only (docs/reference/session-models.md:17).
| harness | plan / build | rewrite honored? | evidence / limit |
|---|---|---|---|
| claude-code | paid: Pro / Max / Teams / API | Yes, 2026-10-06 (two spawns; API-reported model in the child transcript) | updatedInput.model must be a family name (haiku/sonnet/opus/fable); a full id is rejected and blocks the spawn. The catalog native_name supplies it. Write-up: docs/evidence/claude-code-rewrite-honored-2026-10-06.md. There is no built-in agent-type table (owner decision O8): the orchestrator chooses the model per subagent, and the downshift-orchestrator playbook carries the defaults. Setup does not write CLAUDE_CODE_SUBAGENT_MODEL_FORCE, so a per-call model from the orchestrator is honoured. The payload carries no session list; without one (payload, discovery or session-models.json) the catalog session_candidates below the current model stand in for it (SessionFromCatalog, downshift only, never above the current model); a list is needed only to allow upshifts. |
| claude-code | Free | No: no real subagents | Sandboxed, no egress; subagents need paid (README.md:728) |
| cursor | Free | No: silently discarded | updated_input.model ignored, known issue (README.md:734) |
| cursor | Pro legacy (request-based) | No: silently dropped | Task model takes only "fast" (README.md:735) |
| cursor | Pro / Ultra usage-based | Unconfirmed | Actual child-model proof remains P1.6. Separately, Cursor 3.24.9 blocks the external native quota collector before transport; see diagnostic. |
| codex | multi_agent_v2 + hooks on | Yes, inferred (2026-10-02) | Inferred, not observed: same-session follow-up: spawn requested gpt-5.6-terra after hook emitted Terra (docs/evidence/codex-rewrite-honored-2026-10-02.md). Payload >1MB still fail-open. Schema still evolving upstream. |
| kirocrew | Kiro CLI 2.29 native spec hook; MCP spawn_run with explicit task + model, or spawn_run with tasks[] (each entry {task, model, reasoning_effort}) |
Policy/block + retry observed 2026-10-10; no in-place rewrite | Persistent agent.kiro_hooks.preToolUse + executable wrapper; no updated_input channel. Native use_subagent without child model is outside coverage. hooks.json tool-call hooks are informational and do not enforce blocks. Native evidence; setup and limits. spawn_run tasks[]: each entry is routed on its own, with one decision and one telemetry row per entry; a block names every entry to respawn and the whole call is blocked (KiroCrew cannot rewrite one entry). Batch rows carry no top-level model, so their telemetry FromModel is unknown. A top-level spawn_run without tasks routes as before. spawn_sub_agents is not routed (passes through unchanged). Shape verified in the KiroCrew 2.29 backend source (validation.py SPAWN_SUB_AGENTS_SCHEMA, mcp_tools/spawn.py), not a captured payload: agents: [{agent_or_mode, prompt}] with no per-entry model; the handler forwards only task, agent and context flags, so the child model is set by the named agent. Downshift cannot route it. The postToolUse matcher stays spawn_run. Table tests: internal/adapters/kirocrew/batch_test.go. |
| antigravity | desktop 2.21.1, invoke_subagent |
Yes, observed 2026-10-09 | One exact child: original pro, executed flash_lite, native executor/generation model gemini-3.5-flash-lite. Evidence and QA. Manual read-only, build-specific sensor; quota/picker/alias mapping remains unresolved. |
| opencode | zen models (no published list price) | Not observed yet | Adapter and conformance only (the forwarding plugin is phase 2). The route answer carries the target model; the observation side reports a resolved model only from an arrival-ordered switch chain (switch_attempt ok, then model_selected, then the first child_context) compared against the decision target. Usage seam not proven: no cost recorded. |
| grok | any (single model grok-4.6) | No hook rewrite: config only | PreToolUse is allow/deny; pin reasoning_effort in config.toml (README.md:520-531) |
Packaging note: the plugin (.claude-plugin/, hooks/hooks.json, agents/) loads only on Claude Code. Every other harness gets the same hooks through downshift setup or the manual sections of install.md; the skills under skills/ are plain SKILL.md files any harness can read. downshift setup also copies the read-only downshift-audit skill into ~/.claude/skills and ~/.codex/skills (the SkillsDir field of the setup target); a harness without that field gets no skill from setup and can read skills/ directly. Setup skips the copy when the plugin is active, and --undo removes only files that still carry the ownership phrase.
"Inferred" means a later spawn in the same session asked for the model the hook had written (rewrite_honored_inferred in stats --export). It is correlation, not a read of the child's actual model. Only applied rewrites (outcome rewrite_emitted, no guardrail correction) count; allow, blocked and held events never do.
Per-harness measurement (what is observed, what blocks per-token figures, which catalog prices apply, and catalog anomalies): value-per-harness.md.
Decision linkage (current model and post-spawn cost)
OpenCode update: The rows below describe an older snapshot. The current harness matrix reports live verification on OpenCode 2.2.5 of routing, the honored model chain, shell rewrite, child end and per-child token usage. Retry fallback and a go test rewrite through the plugin remain unverified live.
Observed on claude-code 2026-10-12: the PreToolUse payload carries tool_use_id and transcript_path but no session model.
- Current model. A Task call without
model(agent type empty,general-purpose,claude, and the built-inExploreandPlan) runs on the session model. The adapter reads it from the last assistant message in the tail oftranscript_path(1 MiB, model id only). Any other type is decided by its definition (2026-10-19): a built-in that runs on its own model (statusline-setupon Sonnet,claude-code-guideon Haiku) and an agent file whosemodel:names one are a known baseline that routing leaves alone (AGENT_PINS_MODEL); an agent file with nomodel:orinherit(project.claude/agents, useragents, or an installed plugin'sagents, found throughinstalled_plugins.jsonfor aplugin:agenttype) inherits likegeneral-purpose. A type with no definition found staysunknown.Explorealso staysunknownwhen the session model is Fable: Claude Code may run it on Opus (subscription, Console, gateway) or keep it on the main model (cloud providers), and a hook cannot tell which. Until 2026-10-15ExploreandPlanwere left out, so every spawn of those types was held asHELD_UNCONFIDENT_UNKNOWN_MIDand never routed. - Claude Code: parallel Agent calls in the first assistant message. The hook gets the session model from the last assistant message in the transcript, and Claude Code only writes a message to the transcript when it has finished streaming. When one message carries several Agent calls and no earlier assistant message exists (a headless run whose first action is to delegate), the hooks of all but the last call see an empty transcript. Measured in 3 runs of 5 parallel Agent calls: 4 of 5 spawns per run had no baseline and were held (
HELD_UNCONFIDENT_UNKNOWN_MID). The 400 ms wait added for the write race does not help, because the message closes only after all its tool-use blocks have streamed, andSessionStartdoes not carry the model inclaude -peither (checked 2026-10-15). Now, for an agent type that inherits the session model, when the transcript has no model the adapter falls back to the model the session is configured to use:ANTHROPIC_MODEL, thenmodelin<cwd>/.claude/settings.local.json,<cwd>/.claude/settings.jsonand the usersettings.json(CLAUDE_CONFIG_DIRhonoured), first one that sets it. A full id passes through,opusplanis Opus underpermission_modeplanand Sonnet otherwise,sonnet,opus,haikuandfablemap to the catalog's model of that family, anddefaultor anything unrecognised stays unknown. The decision carriesBASELINE_FROM_SETTINGS. The result is an inference: the--modelflag and a mid-session/modelare not visible to a hook, so a session started with--modelor switched with/modelcan be routed against the wrong baseline. To keep that guess from turning into a hidden upshift, a downshift on this baseline is written only to the small tier; a downshift to the mid tier is held. A model found in the transcript always wins,Exploreunder a Fable setting stays unknown, and agent types that do not inherit get no fallback. The native route remains theagent.spawnmod event, which hands overparentModel. - Baseline still unknown on Antigravity; Cursor
inherituses the parent when present. A spawn with an explicit model is known. Antigravity'sinherithas no parent model in the payload. Cursor sends no transcript path (58 of 144 captured Task payloads, 2026-10-09/10). When a Cursor call has notool_input.modelor it isinherit, the parent'smodel_id(then payloadmodel) is the baseline, and a downshift on it is written only to the small tier: a child can run on Composer or a fast variant, so a mid target could be an upshift. Withoutmodel_id,inheritlogs asunknown. - Upshift ranking, all harnesses. Downshift never raises a tier on its own: the only
UPSHIFTverdict is an operator tier-floor lift. Serving it, Downshift ranks the session ids by catalog tier, not list position, never goes below the current model's tier, and lands on the least model at the floored tier; when nothing reaches the floored tier it takes the strongest id at or above the current model's tier, still never below the floor. The legacyexplicit_upshiftopt-in that once let a lift reach anexplicit_onlymodel was removed 2026-10-31; anexplicit_onlyid is never selected in any direction. The rule and its fallback are in session-models.md. - Cost linkage. Every decision records
tool_use_hash. PostToolUse repeats the id, soresolved,child_endedand, through the agent id,usageattach to the exact decision even with parallel spawns, including held and allow decisions (norewrite_honoredclaim for those), and paused decisions (outcome: baseline): before 2026-10-19 the linker treatedbaselineas a cost record and skipped it, so no baseline spawn had an end record. Lines written before this field fall back to the session heuristic. - One spawn, two harnesses (all harnesses). Cursor runs the Claude Code hooks in
~/.claude/settings.jsonwhen its third-party configs are on (Cursor docs), so one Cursor spawn reaches both the cursor hook and the claude-code hook. Each harness declaresPayloadMarkers(top-level keys only it sends; Cursor:cursor_version,conversation_id,generation_id,workspace_roots), and the shared hook, honor, usage and end runners leave a payload carrying another harness's marker to that harness's own hook: allowed unchanged, nothing recorded, one stderr line. Before 2026-10-19 the copy was routed and logged as a claude-code decision with Cursor'sinheritand lowercase agent types: all 79 claude-code decisions labelledagent_type: customin the operator's 30-day log were such copies (each within 3 s of a cursor decision; all 33 with a tool-call id shared it). Not verified on a live Cursor build: that the copy carries at least one marker. It is the native Cursor input, and the logged copies match it. - Custom agent types on Claude Code. A real custom type (project or user
.claude/agents/<name>.md, or a plugin agentplugin:name) still logs an unknown baseline unless the call names a model: the payload carries only the type name, and the model its definition pins (orinherit) is in a file the hook does not read. Reading it is option 2 of subagent-type-signal.md, held back until it is measured. Built-in pinned types (claude-code-guide,statusline-setup) ship no definition on disk, so they stayunknowntoo. - Other harnesses. cursor and codex expose
tool_use_idon decisions (documented in their hook payloads). Their end hooks (see "Child end" below) join on it when the end payload repeats the id. - codex current model. A
spawn_agentcall withoutmodelruns on the parent's current model: 22 of 24 such spawns in the operator's rollouts (2026-10-12; the other mismatches were Downshift's own rewrites). The adapter reads the lastturn_context.payload.modelfrom the tail oftranscript_path.gpt-6.1-solis registered for identity and tier and has list prices since #190 (2026-10-19), so cost telemetry can price it once a token source exists (Codex has none today).gpt-reserveis not in the catalog yet, so they still log asunknownwithrequested_model_rawset. - antigravity current model.
Subagents[].Modelarrives in the payload (2026-10-09 run asked forpro) but was never exposed to telemetry; it is now, for the subagent whose decision is recorded (the last with a prompt). The documented top-levelmodelNameis not read until a real payload confirms it. - cursor current model. In 144 captured Task payloads (2026-10-09/10) the top-level
modelwas always empty; the subagentmodelwas a real id,inherit(28) or absent (30). Withmodel_idon the payload,inheritis resolved like a missingtool_input.modeland logged as that parent id. On Cursor 3.27.12 (2026-10-24) TaskpreToolUseoften omitsmodel_id; whentranscript_pathis present the adapter reads the Claude-shaped parent JSONL (last assistantmessage.model, or the model on the line that carries thistool_use_id), bounded wait as Claude Code. Without payload model fields or a readable transcript, baseline staysunknown. - Unrecognised models (all harnesses). When the requested model is non-empty but not in the catalog, the shared runner records it in
requested_model_rawif it looks like a model id (64 chars,[A-Za-z0-9._:/-]), elseinvalid.
What each harness exposes for session discovery (2026-10-11/12)
Findings from the official docs plus local read-only inspection. Rows say what a hook or local source can tell Downshift; anything not listed was not found. SessionFromCatalog (HarnessCapabilities) is on only where the payload sends no session list and every session accepts the catalog session_candidates names (Claude Code family aliases). A list from the payload or discovery wins.
| harness | current model in hook | available models | quota | session-start hook | SessionFromCatalog |
|---|---|---|---|---|---|
| claude-code | SessionStart.model (optional); the Agent tool_input.model when the parent set it; PostToolUse.tool_response.resolvedModel |
No listing for subscriptions; availableModels/deniedModels exist only in managed settings; the Models API needs ANTHROPIC_API_KEY |
statusline rate_limits.five_hour / seven_day (global, Pro/Max only, after the first response); not per model |
SessionStart (add context, CLAUDE_ENV_FILE) |
yes |
| codex | model on every payload; effort only if the parent put reasoning_effort in spawn_agent |
models_cache.json (offline; hide means not shown in the picker, not unusable); app-server model/list is experimental |
per meter (codex, premium), never per model |
SessionStart can only add context |
no |
| cursor | model, model_id, model_params; transcript_path on preToolUse (3.27+); subagent_model on subagentStart (observe only, no rewrite) |
cursor-agent models (text, needs login; failed here with "Authentication required"); Cloud /v1/models needs an API key |
Cursor Models vs Other Models pools, UI/dashboard only; CLI /usage is interactive |
sessionStart (env reaches later hooks; not for cloud agents) |
no |
| antigravity | modelName (parent) and conversationId; the adapter does not read them yet |
agy --output-format json models (parent picker); no alias-to-model or pool mapping |
agy -p /usage --output-format json per account, group and window; not tied to an alias |
none (Pre/PostToolUse, Pre/PostInvocation, Stop) | no |
| kirocrew | none in the payload; session_id maps to ~/.kiro/sessions/cli/<id>.json (agent_name, model_id, undocumented) |
kiro-cli chat --list-models --format json (10 models plus auto, with rate_multiplier) |
no supported non-interactive credit source | agentSpawn (renamed SessionStart in V3); stdout goes to the agent context; any non-zero exit blocks |
no |
Consequences: Claude Code is the only harness where the catalog candidates are safe (restored 2026-10-27 after PR #570 removed the inferred ladder and left every Claude Code spawn unknown); every other harness needs a real list (hook payload, discovery cache or the operator file). Quota stays unknown everywhere except through the Claude Code statusline bridge and operator imports. Re-verify per release.
Child end (N5, 2026-10-13)
OpenCode update: The rows below describe an older snapshot. The current harness matrix reports live verification on OpenCode 2.2.5 of routing, the honored model chain, shell rewrite, child end and per-child token usage. Retry fallback and a go test rewrite through the plugin remain unverified live.
One shared recorder (internal/childend) writes resolved, child_ended and usage for any harness from a hookport.ChildEnd. An adapter only parses its payload (ParseChildEnd); the CLI entry is downshift end <harness>, and setup wires it from HarnessCapabilities.ChildEndEvent. downshift report and downshift doctor print, per harness, whether completion is measurable (an end event is declared and at least one end record has been seen; a launch is not an end). Claude Code keeps claude-code-post-tool-use and claude-code-subagent-stop as aliases of the same runner.
| harness | ChildEndEvent |
UsageSource |
status |
|---|---|---|---|
| claude-code | SubagentStop (launch and failure also on PostToolUse / PostToolUseFailure) |
transcript (agent_transcript_path) |
verified 2026-10-06 (launch payload, SubagentStop transcript); failure payload still GAP-CHILD-FAILURE |
| codex | PostToolUse for spawn_agent |
none (UsageSource: none): end and status are recorded, cost is not. A parser for the rollout token_count exists but stays off until a real payload proves transcript_path is the child's rollout |
unverified: needs a real payload. tool_response.status / model are assumed names; the token_count usage shape is from the Codex rollout format, not from a captured hook. A spawn that reports no status is a launch: it records launched, reads no usage and does not make completion measurable. transcript_path is the parent rollout, so until a real payload shows a child-scoped rollout the tokens may be the parent thread's. |
| cursor | subagentStop |
none (no usage field is read) | verified on 3.27.12 (2026-10-24): subagentStop carries status, session_id, and subagent_id (matches Task tool_use_id; no tool_call_id). PreToolUse on the same build sends session_id and tool_use_id but leaves model, model_id, and tool_input.model empty, so routing baseline stays unknown and R9 may hold. No executed child model field is read. |
| antigravity | none | none | no documented subagent-end payload (PostToolUse exists; its result fields are not documented). Nothing recorded. |
| kirocrew | none | none | PostToolUse tool_response not confirmed (see evidence/vendor-hook-docs-2026-10-11.md). Nothing recorded. |
| opencode | child_done (observation envelope the plugin forwards) |
none (UsageSource: none): the child_done parser reads status and inline usage counts, but nothing is priced. |
unverified: needs a live run. The envelope shape comes from the phase-0 probes, not from a captured plugin forward. The honor reader reports a resolved model only from the arrival-ordered switch chain; a batch without it records nothing. |
Where ChildEndEvent is empty, downshift end <harness> exits 0, records nothing and says so on stderr.
Child-end line (U2, 2026-10-13)
HarnessCapabilities.CanShowChildLine says whether the hook protocol can show one line when a subagent ends. Claude Code: true (systemMessage on PostToolUse and SubagentStop), pending a live check. cursor, codex, antigravity, kirocrew, opencode: false; the line is still computed by telemetry.ChildEndLine (by the shared recorder, for every harness) and no adapter prints it. DOWNSHIFT_QUIET=1 turns it off. See session-models.md.
Subagent type hint (AgentTypeHints)
HarnessCapabilities.AgentTypeHints maps a subagent type, exactly as the harness sends it, to a tier. core.RouteAgent uses it only to fill doubt: the text read must be unconfident, with no risk signal, no NB or semantic lift and no COMPLEX read, the current model must be known, and the hint is capped at that model's tier (no upshift). Reason code AGENT_TYPE_HINT. Every harness computes it the same way; the table is data.
| harness | type field read | hints | status |
|---|---|---|---|
| claude-code | tool_input.subagent_type |
Explore small, Plan mid |
from the built-in types' documented jobs; pinned built-ins carry none |
| cursor | tool_input.subagent_type |
none | field read, no stable names observed yet (lowercase explore seen); add only from evidence |
| codex | tool_input.agent_type |
none | field read (seen in spawn inputs); no hint names until evidence |
| kirocrew, antigravity, opencode | not read | none | no type field in the adapter payload |
Spawn state (2026-10-19)
switched / held / observed is computed in telemetry.SpawnStateOf and shown by the shared runner for every harness: one stderr line per spawn, plus live.json for panels. No harness-specific code. Limits: the stderr line only helps where the harness surfaces hook stderr (unverified per harness), and the statusline segment needs a statusline bridge (Claude Code today). Details: spawn-state.md.
Session view (U3, 2026-10-13)
downshift session (tree, --why, --pause) is shared code; what differs is whether a harness gives it a session id. HarnessCapabilities.SessionEnv names the variable a harness exports to commands run from it: Claude Code CLAUDE_CODE_SESSION_ID (seen set in a Bash tool call on Claude Code 2.1.289) and KiroCrew KIRO_SESSION_ID (set by the KiroCrew gateway for every agent process, PR #559, 2026-10-25); Cursor, Codex and Antigravity declare none and the command uses the latest session in the log. The hook payload carries a session id for Claude Code and Codex only, so only they group in the tree and can be paused per session. Antigravity, Cursor and KiroCrew carry none in the hook payload: computed and logged, not groupable, not pausable. KiroCrew's SessionEnv does let a command run from the harness (the downshift compactor/exec shell wrap) attribute its exec event to kirocrew instead of unknown, through envHarness() reading KIRO_SESSION_ID; the tree grouping still needs a hook-payload id it does not have. The /downshift slash command is Claude Code only. See session-view.md.
Mods
Downshift bundles no Claude Code mods: the vendored ones were removed on 2026-10-29. A mod is code Claude Code runs in its own process, so it exists only where mods load; the other harnesses have no mod system.
Answer when nothing is rewritten (2026-10-19)
An allow on an unchanged spawn can override the user's own ask rules, so the shared runner answers neutrally where the host permits it (PR #192) and with the host's required decision where it does not.
| Harness | Unchanged spawn | Why |
|---|---|---|
| claude-code, codex | neutral {} |
permissionDecision is optional; updatedInput is only accepted together with allow, so allow is emitted only with a rewrite. Pinned by TestHarnessConformance ("unchanged spawn must emit no permissionDecision"). |
| antigravity | {"decision":"allow"} |
The vendor summary lists decision as required output (allow, deny, ask, force_ask, deny_unless_prior_grant) (vendor-hook-docs). A neutral object would be a missing required field. Not changed. |
| cursor | {"permission":"allow"} |
The vendor summary documents permission allow/deny and says an invalid response blocks the action; it does not say the field is optional, and no capture of a neutral {} exists. Not changed. |
| opencode | {"v":1,"action":"allow",...} |
The envelope's action is required by the plugin wire contract. |
| kirocrew | empty stdout, exit 0 | exit-code contract. |
Whether cursor or antigravity treat an explicit allow as overriding a user prompt rule has not been verified on a live build (no Cursor or Antigravity session was driven). To change either, first capture how the host treats {} for a spawn it has a rule for, then add the harness to the neutral set and extend the conformance decoders. Until then the safe answer is the documented one.
Shell command rewrite: downshift compact (on by default, 2026-10-19)
On by default on Claude Code: the plugin registers the Bash PreToolUse hook. Set "exec": false in the Downshift config or DOWNSHIFT_EXEC=0 to turn it off. The decision is shared (internal/execwrap.Decide plus decide in internal/shellwrap): the command must start with one of the families below, contain no shell metacharacter (or match one of the compound shapes below), not already start with downshift, and be rewritten to the running binary's absolute path (single-quoted in the command, no PATH lookup). No Bash allow rule is needed. The rewrite is skipped when a deny or ask rule matches the command, or when the settings cannot be read, and never when "exec": false or DOWNSHIFT_EXEC=0 is set. The harness fact is HarnessCapabilities.CanRewriteShellCommand. An adapter takes part by exposing ShellCommand() and ShellRewrite().
Accepted families. FamilyOf in internal/execwrap/policy*.go decides. The first words must match one of these forms (the inventory below is checked against the code by internal/execwrap/families_inventory_test.go; the policy files decide the exact flags and subcommands); words after them are passed on as written. The family name is the only command fact telemetry keeps.
| family | command forms | behaviour |
|---|---|---|
go-test |
go test |
compresses |
pytest |
pytest |
compresses |
cargo-test |
cargo test |
compresses |
flutter-test |
flutter test |
compresses |
dart-test |
dart test |
compresses |
flutter-build |
flutter build |
passes through |
flutter-run |
flutter run |
passes through |
flutter-analyze |
flutter analyze |
passes through |
flutter-pub |
flutter pub |
passes through |
flutter-doctor |
flutter doctor |
passes through |
flutter-clean |
flutter clean |
passes through |
flutter-devices |
flutter devices |
passes through |
dart-run |
dart run |
passes through |
dart-analyze |
dart analyze |
passes through |
dart-pub |
dart pub |
passes through |
dart-format |
dart format |
passes through |
dart-compile |
dart compile |
passes through |
dart-fix |
dart fix |
passes through |
gradle |
gradle, gradlew, ./gradlew with the allowlisted tasks (build, check, test, assemble, lint, ...) |
compresses |
maven |
mvn, mvnw, ./mvnw with test, verify, package, install or clean |
compresses |
phpunit |
phpunit, vendor/bin/phpunit, ./vendor/bin/phpunit, php vendor/bin/phpunit, php ./vendor/bin/phpunit |
compresses |
composer |
composer |
passes through |
artisan |
php artisan <command> |
passes through |
phpstan |
phpstan |
passes through |
psalm |
psalm |
passes through |
php-cs-fixer |
php-cs-fixer |
passes through |
pint |
pint |
passes through |
pest |
pest |
passes through |
rector |
rector |
passes through |
sail-test |
sail test |
passes through |
sail-artisan |
sail artisan <command> |
passes through |
vitest |
vitest, npx vitest, pnpm exec vitest, yarn vitest |
compresses |
jest |
jest, npx jest, pnpm exec jest, yarn jest |
compresses |
playwright |
playwright test, npx playwright test, pnpm exec playwright test, yarn playwright test |
compresses |
cypress |
cypress run, npx cypress run, pnpm exec cypress run, yarn cypress run |
compresses |
tsc |
tsc, npx tsc, pnpm exec tsc, yarn tsc |
compresses |
next-build |
next build, npx next build, pnpm exec next build |
compresses |
agent-desktop |
agent-desktop snapshot ..., agent-desktop find ... (subcommand first) |
compresses |
vite-build |
vite build |
passes through |
vite-preview |
vite preview |
passes through |
turbo-run |
turbo run |
passes through |
npm-install |
npm install |
passes through |
npm-test |
npm test |
passes through |
npm-build |
npm build |
passes through |
pnpm-test |
pnpm test |
passes through |
pnpm-build |
pnpm build |
passes through |
yarn-test |
yarn test |
passes through |
yarn-build |
yarn build |
passes through |
bun-test |
bun test |
passes through |
bun-build |
bun build |
passes through |
eslint |
eslint, pnpm exec eslint, yarn eslint |
compresses |
prettier |
prettier |
passes through |
biome |
biome |
passes through |
mysql-query |
mysql -e <one read statement>, with connection and output options only (no INTO, no EXPLAIN ANALYZE, no second statement) |
passes through |
redis-read |
redis-cli <read-only command> (and valkey-cli), never --pipe |
passes through |
kubectl-get |
kubectl get |
passes through |
kubectl-describe |
kubectl describe |
passes through |
kubectl-logs |
kubectl logs |
passes through |
helm-list |
helm list |
passes through |
helm-status |
helm status |
passes through |
terraform-plan |
terraform plan |
passes through |
terraform-fmt |
terraform fmt |
passes through |
az-list |
az list |
passes through |
az-show |
az show |
passes through |
aws-describe |
aws describe |
passes through |
aws-list |
aws list |
passes through |
aws-get |
aws get |
passes through |
aws-s3-ls |
aws s3 ls |
passes through |
aws-s3-cp |
aws s3 cp (read-only forms only) |
passes through |
aws-logs |
aws logs |
passes through |
docker-ps |
docker ps |
passes through |
docker-logs |
docker logs |
passes through |
docker-images |
docker images |
passes through |
docker-build |
docker build |
passes through |
argocd-list |
argocd list |
passes through |
argocd-get |
argocd get |
passes through |
argocd-diff |
argocd diff |
passes through |
kustomize-build |
kustomize build |
passes through |
az-pipelines |
az pipelines <read form> |
passes through |
logcli |
logcli |
passes through |
sentry-cli |
sentry-cli |
passes through |
grafana-cli |
grafana-cli |
passes through |
datadog-ci |
datadog-ci |
passes through |
git-status |
git status |
compresses |
git-log |
git log |
passes through |
git-diff |
git diff |
compresses |
git-show |
git show |
compresses |
git-branch |
git branch |
passes through |
git-fetch |
git fetch |
passes through |
git-pull |
git pull |
passes through |
git-push |
git push (the go test run its hooks print folds; every other line is kept) |
compresses |
git-commit |
git commit (the go test run its hooks print folds; every other line is kept) |
compresses |
git-add |
git add |
passes through |
git-stash |
git stash |
passes through |
git-remote |
git remote |
passes through |
git-tag |
git tag |
passes through |
git-config-read |
git config --get, --get-all, --get-regexp, --list (read flags only) |
passes through |
git-other |
any other git <subcommand> not listed above |
passes through |
gh-pr |
gh pr view, gh pr checks |
compresses |
gh-run |
gh run list, gh run view --log |
compresses |
gh-api |
gh api |
passes through |
gh-issue |
gh issue |
passes through |
gh-repo |
gh repo |
passes through |
gh-auth |
gh auth |
passes through |
gh-search |
gh search |
passes through |
go-build |
go build |
compresses |
go-run |
go run |
passes through |
go-install |
go install |
passes through |
go-mod |
go mod |
passes through |
go-generate |
go generate |
passes through |
go-fmt |
go fmt |
passes through |
go-vet |
go vet |
passes through |
go-doc |
go doc |
passes through |
go-version |
go version |
passes through |
go-env |
go env |
passes through |
go-list |
go list |
passes through |
go-get |
go get |
passes through |
go-work |
go work |
passes through |
staticcheck |
staticcheck |
passes through |
golangci-lint |
golangci-lint |
compresses |
govulncheck |
govulncheck |
passes through |
cargo-build |
cargo build |
compresses |
cargo-run |
cargo run |
passes through |
cargo-check |
cargo check |
passes through |
cargo-clippy |
cargo clippy |
passes through |
cargo-fmt |
cargo fmt |
passes through |
cargo-doc |
cargo doc |
passes through |
cargo-add |
cargo add |
passes through |
cargo-update |
cargo update |
passes through |
cargo-tree |
cargo tree |
passes through |
cargo-audit |
cargo audit |
passes through |
cargo-outdated |
cargo outdated |
passes through |
pip-list |
pip list |
passes through |
pip-show |
pip show |
passes through |
pip-freeze |
pip freeze |
passes through |
pip-check |
pip check |
passes through |
uv-pip |
uv pip <read or install form> |
passes through |
uv-run |
uv run <command> |
passes through |
ruff |
ruff |
compresses |
mypy |
mypy |
compresses |
black |
black |
passes through |
isort |
isort |
passes through |
pyright |
pyright |
passes through |
bandit |
bandit |
passes through |
poetry |
poetry |
passes through |
pdm |
pdm |
passes through |
make |
make <target> (a go test run in its output folds; every other line is kept) |
compresses |
cmake |
cmake |
passes through |
ninja |
ninja |
passes through |
bazel |
bazel |
passes through |
just |
just |
passes through |
task |
task |
passes through |
nx |
nx |
passes through |
lerna |
lerna |
passes through |
changesets |
changesets |
passes through |
mkdir |
mkdir |
passes through |
touch |
touch |
passes through |
cp |
cp |
passes through |
mv |
mv |
passes through |
rm |
rm, never recursive (-r, -R or --recursive in any spelling) |
passes through |
ast-grep |
ast-grep |
passes through |
dotnet-build |
dotnet build |
compresses |
dotnet-test |
dotnet test |
passes through |
dotnet-run |
dotnet run |
passes through |
rspec |
rspec |
passes through |
rubocop |
rubocop |
passes through |
mise |
mise |
passes through |
asdf |
asdf |
passes through |
direnv |
direnv |
passes through |
psql |
psql |
passes through |
gcloud |
gcloud |
passes through |
journalctl |
journalctl |
passes through |
systemctl |
systemctl |
passes through |
kubectl-top |
kubectl top |
passes through |
xcodebuild |
xcodebuild |
passes through |
pod |
pod |
passes through |
expo |
expo |
passes through |
react-native |
react-native |
passes through |
adb |
adb |
passes through |
pip-install |
pip install (install form) |
passes through |
mix |
mix |
passes through |
swift |
swift |
passes through |
sbt |
sbt |
passes through |
Container exec (docker exec, docker compose exec, docker-compose exec) is wrapped when its inner command is an allowlisted family above (phpunit, npm-test, artisan, ...); the recorded family is the inner one. Accepted flags before the service or container: -T, --no-TTY, -i, -u/--user, -w/--workdir, -e/--env KEY=VAL. -t, -it and any other flag (-d, --index, --privileged) leave the command unwrapped, because a TTY changes the output the compressor reads. Nested docker is not wrapped.
Any other command, including npm test, is not wrapped. The shell still parses the wrapped command, so the words after the family expand as they would have.
Compound shapes (2026-10-21). internal/execwrap/policy_compound.go also accepts the shapes agents use most, matched word by word, and wraps only the allowlisted command inside them; the rest is kept as written:
| shape | rewritten to | exit code |
|---|---|---|
cd <dir> && <cmd> |
cd <dir> && '<bin>' compact -- <cmd> |
cd's on failure, else the command's |
<cmd> | tail -N (also head, -n N, -nN, N up to 5 digits) |
'<bin>' compact -- <cmd> | tail -N |
the pipe's last command, as before |
<cmd> 2>&1 | tail -N |
'<bin>' compact -- <cmd> 2>&1 | tail -N |
same |
cd <dir> && <cmd> 2>&1 | tail -N |
both of the above | same |
<dir> passes the same safe-byte gate as the command (no ~, $, quote, glob) and cannot start with -. A deny or ask rule that matches the whole command, the inner command, cd <dir> or the tail/head part stops the rewrite. Under | head -N the wrapped command runs to its end before the output is cut, where the bare command could have been stopped early by the closed pipe.
Chains (2026-10-21). internal/execwrap/policy_chain.go splits a command at each ; and && and decides every segment alone, as a plain command or one of the shapes above. Only allowlisted segments are wrapped; every other segment and every separator stays byte-identical:
| shape | rewritten to | exit code |
|---|---|---|
gofmt -l x; go test ./pkg |
gofmt -l x; '<bin>' compact -- go test ./pkg |
the last segment's, as before |
go build ./... && go test ./... |
each segment wrapped | && short-circuits on the first failure, as before |
git diff; go test ./... 2>&1 | tail -15 |
both wrapped, the pipe kept | same |
The session tag goes on each wrapped segment once. A deny or ask rule that matches the whole command or any segment (wrapped or kept, and the cd or tail part of a shape) stops the rewrite. A command that already holds downshift compact is never wrapped again.
Left unwrapped on purpose, and a chain is refused whole when any segment holds one: ||, a lone &, an empty segment (;;, a trailing ;), a pipe into anything but tail/head -N (git diff | grep '^[+-]', tee, a second pipe), tail -f, tail -n +N, file redirects (>, >>, 1>&2), heredocs, subshells, a pipe with no spaces around |, and anything with an expansion, a glob or a quote (a quoted ; is never split). Each of these can change what the command does or which exit code the agent sees in ways a word match cannot prove safe.
| harness | shell rewrite | status | limit |
|---|---|---|---|
| claude-code | PreToolUse on Bash → updatedInput.command, every sibling field kept, no permissionDecision |
Wired, on by default | The plugin's hooks.json carries the Bash PreToolUse entry running downshift claude-code. Verified live on 2026-10-20 (see docs/internal/tasks/2026-10-20-next-steps). If Claude Code ever ignores updatedInput without a permissionDecision, the command runs unchanged: nothing breaks, nothing is saved. Permissions: no allow rule is installed or required. The rewrite is skipped when a deny or ask rule in the managed, user (CLAUDE_CONFIG_DIR honoured), project or local settings matches the original command (as written and normalised); an unreadable or invalid settings file also means no rewrite. The hook emits no permissionDecision, so Claude Code's own permission flow, including any approval prompt, applies to the rewritten command as it would to the original. Never add a broad Bash(downshift compact:*). |
| codex | PreToolUse on Bash (also reported for exec_command) → permissionDecision: "allow" plus updatedInput.command, every sibling field kept |
Wired, Unverified live | downshift setup writes a ^Bash$ entry running downshift codex next to the Agent one. Codex honors updatedInput only together with permissionDecision: "allow", so a rewritten call is auto-approved by the hook; an unchanged call emits {}. Codex has no deny or ask rules the adapter can read, so ShellBlocked is always false and only the shared policy (allowlist, no metacharacters, kill switches) limits the rewrite. Unverified live until a Codex session runs a wrapped go test (the hook must be trusted in /hooks). |
| cursor | preToolUse on Shell → updated_input.command, every sibling field kept, no permission field |
Wired | Unverified live; Cursor ignored updated_input for Task on some plans, Shell needs its own proof. downshift setup writes the Shell entry in hooks.json. No deny/ask rule is read (Cursor has no readable rule file), so the rewrite is not skipped by rules. Advise fallback: beforeShellExecution (matcher *) answers allow with agent_message naming the downshift compact form for an allowlisted family (CanAdviseShellWrap). It never denies and cannot rewrite. Unverified live: that Cursor shows agent_message to the agent on allow. |
| opencode | not wired | Unverified | Same. |
| antigravity | not wired | Unverified | Same. |
| kirocrew | not wired | No rewrite channel | Policy-mode only (allow or block), so it can never rewrite a command. |
| grok | none | No hook | Config only. |
downshift compact -- <argv> works the same from any shell, harness or not.
Re-check on a live session (C14). A unit test cannot show that Claude Code applies updatedInput.command when the hook returns no permissionDecision. To check it after a Claude Code upgrade:
- Make sure the Downshift plugin is installed and no deny or ask rule matches
go test. No allow rule is needed, and none should be added fordownshift compact. - Start a new Claude Code session in a Go repository and ask it to run
go test ./...(a repository with a dozen or more packages, all passing). - Look at the tool call Claude Code shows. The command must read
'<path>/downshift' compact -- go test ./..., and a passing result must end with a[downshift compact: compacted N to M bytes]line. - Run
downshift context metrics:exec_metrics.commandsmust have grown. WithDOWNSHIFT_EXEC=0in the environment the command must run as typed.
If the command runs as typed with the hook on, Claude Code ignores the rewrite without a decision: nothing breaks and nothing is saved, and this feature should stay documented as not working there.
MCP registration (setup, on by default; --no-mcp skips it, 2026-10-28)
Only Claude Code (through claude mcp add -s user, detection by reading ~/.claude.json) and Codex (marked block in ~/.codex/config.toml) are registered; the file formats of Cursor, OpenCode, Antigravity and Kiro are in docs/internal/plans/mcp-registration.md and arrive in a later stage. Unverified: what claude mcp add does on a duplicate name (setup never adds over an existing entry), where .claude.json lives under CLAUDE_CONFIG_DIR, and whether Codex loads the server without a trust step.
Revalidation
Every TBD cell must be re-checked per harness release: hook contracts evolve upstream and a green cell can regress silently. Failing proof, the tool fails open and the spawn runs unchanged (README.md:755).
A 2026-10-09 sample of Codex spawn_agent inputs recorded key sets only (agent_type, message, task_name, and sometimes fork_turns). It did not include hook stdin, transcript_path, a model field, or executor acknowledgement, so the Codex row above is not refreshed. See closeout-recheck-2026-10-09.md.
Sources (README/docs only, no vendor claims)
- Claude paid: emission only until P1.3 (docs/evidence/rewrite-honored-protocol.md); plan limits: README § Plan compatibility
- Cursor free/legacy discard: README.md:734-735, README.md:738, README.md:1012-1013
- Codex flags + honored: README.md:744, README.md:746; evidence 2026-10-02: docs/evidence/codex-rewrite-honored-2026-10-02.md; evolving schema: README.md:373
- KiroCrew adapter capability and integration limits: native hook setup, routing guia,
internal/adapters/kirocrew/kirocrew.go. A hook invocation counter or direct adapter smoke test does not prove live enforcement or the served child model. - KiroCrew harness detection and
SessionEnv: KIRO_SESSION_ID(PR #559, merged 2026-10-25): kirocrew-harness-detection.md,internal/core/capabilities.go(KiroCrewCaps),cmd/downshift/session.go(envHarness). The env var letsenvHarness()attributedownshift compactor/execevents tokirocrew; it is not a hook-payload session id, so thedownshift sessiontree still cannot group or pause KiroCrew. The spike lists the model set reported bykiro-cli chat --list-models(withrate_multiplier); catalog membership for those ids (T4),SessionFromCatalog(T5),PayloadMarkers(T2) andAgentTypeHints(T7) are open follow-ups in that spike, not shipped, so they stay documented as the matrix shows:SessionFromCatalogno, no payload markers, no type hints. - Vendor hook docs vs adapters (search summaries, 2026-10-11): vendor-hook-docs
- Antigravity observed child, dated build and evidence limits: native evidence and final QA
- Grok config-only: README.md:520-531, README.md:691, README.md:1236
- Emission vs honored: docs/reference/session-models.md:17; allowlist: docs/reference/session-models.md:34
More docs
- Install Downshift: Claude Code, Codex and Cursor hook setupGuide
- Downshift configuration: state directory and local settingsGuide
- Downshift and Claude Code subagents: when routing can actGuide
- Downshift session view: subagent tree, reasons and pauseGuide
- Downshift report: routed spawn tokens and reworkGuide
- Downshift evidence ladder: what each saving figure meansGuide
- Downshift companions: Headroom and Claude Code mods to pairGuide
- Downshift capability matrix: status and evidence per featureReference
- Downshift capability matrix, part 2: context and packagingReference
- Downshift value per harness: observed tokens per harnessReference
- Downshift spawn state: switched, held or only observedReference
- Downshift offline simulation: routing without model callsGuide
- Downshift session models: which model IDs a hook may writeReference
- Downshift complexity weights: how a task becomes a modelReference
- Downshift architecture: deterministic hook and offline CLIDesign
- Downshift routed vs control: first Claude Code A/B resultsEvidence
- Downshift real usage: a Claude Code day and the last 30 daysEvidence