Skip to content
Merged
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
bump: patch
---

### Fixed

- The `simple-system-prompt` lever no longer restates which models already default to the lean system prompt, which had misclassified Haiku 5.5 as full. It points at a rerunnable probe record of the binary's lean-prompt selection instead.
41 changes: 41 additions & 0 deletions docs/upstream/claude-code-lean-prompt-selector.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Probed behavior: which models already default to the lean system prompt

No docs page says which models Claude Code gives the lean system prompt by default. The
context-budget `simple-system-prompt` lever needs that answer to explain a measured zero:
`CLAUDE_CODE_SIMPLE_SYSTEM_PROMPT=1` changes nothing on a model that is already lean. This record
is the probe the lever points at, in the probed-behavior form of the
[upstream-drift convention](../conventions/upstream-drift/README.md#required-parts).

## Decision

The audit still measures on the consumer's session model and reports the delta; it does not
branch advice on model. This probe only explains a zero, so a stale reading here mislabels a
zero's cause and never changes a recommendation.

## Probe

Read the selector and the model capability table from the installed binary:

```bash
B="$(perl -MCwd -e 'print Cwd::abs_path(shift)' "$(command -v claude)")"
grep -ao 'function [A-Za-z_$]*([a-z]){let [a-z]=[A-Za-z_$]*([a-z]),[a-z]=[A-Za-z_$]*([a-z],"lean_prompt",[a-z]);.\{0,400\}' "$B"
perl -0777 -ne 'for (split /\{id:"/) { next unless /^(claude-[a-z0-9-]+)",family:.*?capabilities:\[([^\]]*)\]/s;
print "$1 ", ($2 =~ /"lean_prompt"/ ? "lean_prompt" : "-"), "\n" }' "$B" | sort -u
```

The first command prints the selector function; the second lists every model in the capability
table and whether its capability list carries `lean_prompt`.

## Observation (Claude Code 2.1.296, 2026-10-10)

The selector reads a model's `lean_prompt` capability first and falls back to its legacy
model-id list only for a model without that capability entry. In the capability table,
`claude-haiku-5-5` carries `lean_prompt` and `claude-haiku-4-5` does not, so a Haiku 5.5 session
is already lean and a Haiku 4.5 session gets the full prompt.

- **Pointer**: when a `simple-system-prompt` delta needs explaining, rerun the probe above against
the installed binary.
- **As of**: 2026-10-10 (Claude Code 2.1.296).
- **Recheck trigger**: a Claude Code release whose changelog names the system prompt,
`CLAUDE_CODE_SIMPLE_SYSTEM_PROMPT` or a new model; or the probe's first command printing nothing
(the selector changed shape).
6 changes: 3 additions & 3 deletions plugins/context-budget/skills/audit/reference/levers.json
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
"mechanism": "Switches to the lean system prompt on models where the full prompt is default.",
"category": "removes-weight",
"categoryBasis": "Env row documented; measured large on some models and a measured no-op on models where the lean prompt is already default.",
"conditions": "Model-dependent, and the dependence is resolvable from the binary's lean-prompt selector rather than only from a measured zero: the full-prompt path is the legacy list (model id contains `claude-3-`, `haiku`, or `sonnet`, or equals `claude-opus-4-0` / `claude-opus-4-1` / `claude-opus-4-5` / `claude-opus-4-6` / `claude-opus-4-7`); everything else — including the opus-5 family — already defaults lean, so the env var can only measure zero there. A zero on those models is explained (already-default), not merely reported. Per operator decision, advice does not branch on model — measure on the consumer's session model and report the measured delta, including an explained zero.",
"conditions": "Model-dependent. On a model that already defaults to the lean prompt the env var can only measure zero, and that zero is explained (already-default), not merely reported. Which models already default lean is read from the probe record https://github.com/melodic-software/claude-code-plugins/blob/main/docs/upstream/claude-code-lean-prompt-selector.md, rerun against the installed binary; no docs page covers it as of 2026-10-10. Per operator decision, advice does not branch on model — measure on the consumer's session model and report the measured delta, including an explained zero.",
"posture": "recommendable-on-fit",
"scope": "Environment variable only; no settings key.",
"detection": "CLAUDE_CODE_SIMPLE_SYSTEM_PROMPT in the environment; the session model from the baseline snapshot.",
Expand All @@ -187,8 +187,8 @@
"citations": [
"https://code.claude.com/docs/en/env-vars"
],
"verified": "2026-08-23",
"recheckTrigger": "Either variable's env-vars row changes, the binary's legacy full-prompt list changes, or the lean prompt becomes default everywhere (the lever then measures zero universally)."
"verified": "2026-10-10",
"recheckTrigger": "Either variable's env-vars row changes, the probe record's recheck trigger fires, or the lean prompt becomes default everywhere (the lever then measures zero universally)."
},
{
"id": "bare-simple-mode",
Expand Down
10 changes: 6 additions & 4 deletions plugins/context-budget/skills/audit/scripts/levers.test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -145,19 +145,21 @@ const lean = (cat.levers ?? []).find((l) => l.id === "simple-system-prompt");
if (!lean) problems.push("missing simple-system-prompt");
else {
const cond = String(lean.conditions || "");
if (!/opus-5/i.test(cond)) problems.push("simple-system-prompt conditions do not name opus-5");
if (!/already-default|already defaults lean/i.test(cond)) {
problems.push("simple-system-prompt conditions do not explain a zero as already-default");
}
if (!/legacy list|claude-opus-4-0/i.test(cond)) {
problems.push("simple-system-prompt conditions do not cite the binary legacy-list check");
if (!cond.includes("docs/upstream/claude-code-lean-prompt-selector.md")) {
problems.push("simple-system-prompt conditions do not point at the lean-prompt probe record");
}
if (/lean_prompt|claude-[a-z]+-\d|opus-\d|haiku|sonnet|\b2\.1\.\d/i.test(cond)) { // portability-ok: JS RegExp, not grep or sed
problems.push("simple-system-prompt conditions restate the selector instead of pointing at the record");
}
}
console.log(problems.length ? problems.join("\n") : "CLEAN");
' "$CATALOGUE")"

report_clean "$routeout" \
"include-git-instructions names the env route; simple-system-prompt resolves opus-5 lean default"
"include-git-instructions names the env route; simple-system-prompt points at the lean-prompt probe record"

outputout="$(node -e '
const cat = JSON.parse(require("fs").readFileSync(process.argv[1], "utf8"));
Expand Down
Loading