Skip to content

Commit 65738a9

Browse files
phase3devclaude
andcommitted
launcher: opt-in x-cc-atis experiment opt-out (CC_ATIS_OPTOUT, off by default)
Automates the verified 2026-07-07 mitigation for the server-side experiment that blanks Opus 4.8 thinking summaries. When CC_ATIS_OPTOUT=1, both launchers purge any cached x-cc-atis experiment assignment from the CLI config (idempotent, one-time .bak-cc-workarounds backup, atomic temp+rename write, best-effort) and launch with DISABLE_GROWTHBOOK=1 so the next remote feature refresh cannot re-enroll the install. OFF by default: it edits ~/.claude.json and disables ALL client-side feature gating, so it must be an explicit choice. The bash launcher needs jq for the purge half (warns and env-only without it); the Windows launcher has no external dependency. Docs updated to match: README toggle table + 2026-07-07 update (launcher automation paragraph) + troubleshooting, launcher/README toggle table, TECHNICAL.md mitigation section, fixes/thinking-summaries/README limitation note. Two end-to-end regression tests (bash + windows launcher): default-off leaves the config byte-identical and the env unset; enabled purges exactly the atis slots/cache key, keeps everything else, backs up once, exports the env var, and a second run does not rewrite the file. Suite: 123/123. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 4752971 commit 65738a9

7 files changed

Lines changed: 320 additions & 8 deletions

File tree

‎README.md‎

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ Not affiliated with or endorsed by Anthropic. A future Claude Code update could
1515
> request correctly asks for one, so the launcher's flag is no longer sufficient
1616
> on that single model. It is gated on an experiment-assignment header the CLI
1717
> sends. Every other model is unaffected and the launcher remains the fix for
18-
> them. There is a mitigation.
18+
> them. There is a mitigation, and the launcher can now apply it for you:
19+
> set `CC_ATIS_OPTOUT=1` (off by default - it has caveats).
1920
> -> [2026-07-07 update](#2026-07-07-update-opus-48-and-the-experiment-header)
2021
2122
<img alt="A populated Thinking summary in the VS Code chat instead of an empty block" src="media/thinking.png" style="max-width: 100%; height: auto;">
@@ -59,6 +60,7 @@ Toggles (set in the environment where Claude Code launches, then reload):
5960
| `CC_THINKING_DISPLAY` | `summarized` | `summarized` shows extended-thinking summaries; `omitted` hides them (no injection). |
6061
| `CC_PATCH_CONTEXT_ICON` | `1` | `0` leaves the context-usage icon unpatched (and reverts ours on the next launch). |
6162
| `CC_PATCH_MD_COPY` | `1` | `0` leaves the webview without the markdown copy/export controls (and reverts ours on the next launch). |
63+
| `CC_ATIS_OPTOUT` | `0` | `1` opts out of the server-side experiment that blanks Opus 4.8 thinking summaries: purges the cached `x-cc-atis` assignment from `~/.claude.json` (one-time backup, atomic write, idempotent) and launches with `DISABLE_GROWTHBOOK=1`. **Off by default** - it edits the CLI's config file and disables ALL client-side feature gating; see the [2026-07-07 update](#2026-07-07-update-opus-48-and-the-experiment-header). |
6264

6365
See [`launcher/README.md`](launcher/README.md) for wiring details, the VS Code env-setting how-to, and the build command.
6466

@@ -173,6 +175,22 @@ effects observed so far, but they are possible); on Windows the file is
173175
`%USERPROFILE%\.claude.json` - if `jq` is unavailable, hand-edit the slot
174176
entries containing `"atis"` out of `clientDataCacheSlots`.
175177

178+
**Launcher automation (added 2026-07-07).** The launcher can apply both steps
179+
on every launch: set `CC_ATIS_OPTOUT=1` in the launcher's environment (e.g. VS
180+
Code's `claudeCode.environmentVariables`, or your shell profile). When enabled
181+
it purges any cached assignment (idempotent - no rewrite when nothing is
182+
cached; one-time backup to `~/.claude.json.bak-cc-workarounds`; atomic
183+
temp-then-rename write; best-effort, never blocks the launch) and sets
184+
`DISABLE_GROWTHBOOK=1` for the launched process, so a refresh that re-enrolls
185+
you between launches is undone on the next launch. It is **off by default**,
186+
unlike the launcher's other fixes, because it is not free: it edits the CLI's
187+
own config file, and the env var disables Claude Code's client-side feature
188+
gating entirely, not just this experiment - enable it deliberately. The bash
189+
launcher needs `jq` for the purge half (without it, it warns and only sets the
190+
env var, which is NOT sufficient while an assignment is already cached); the
191+
Windows launcher has no external dependency. The manual recipe above remains
192+
for non-launcher users.
193+
176194
**Status.** Undocumented upstream: no CHANGELOG entry through `2.1.204`
177195
mentions it, and there was no notice, no opt-in, and no documented opt-out. The
178196
documented `showThinkingSummaries` setting is silently overridden while the
@@ -388,7 +406,7 @@ Setup is otherwise identical to Option 1. This is unrelated to the fixes above.
388406

389407
## Troubleshooting
390408

391-
* Summaries suddenly empty again, but only on Opus 4.8 (since 2026-07-07): the launcher is not broken and neither is your setup - your install is likely enrolled in a server-side experiment that blanks Opus 4.8 summaries at the API. No launch flag can override it. Diagnose and mitigate per the [2026-07-07 update](#2026-07-07-update-opus-48-and-the-experiment-header).
409+
* Summaries suddenly empty again, but only on Opus 4.8 (since 2026-07-07): the launcher is not broken and neither is your setup - your install is likely enrolled in a server-side experiment that blanks Opus 4.8 summaries at the API. No launch flag can override it. Diagnose and mitigate per the [2026-07-07 update](#2026-07-07-update-opus-48-and-the-experiment-header), or set `CC_ATIS_OPTOUT=1` in the launcher environment to apply the mitigation automatically (off by default; read the caveats there first).
392410
* Thinking still empty after setup: Reload the VS Code window after changing the setting. Confirm the setting points to the launcher's full absolute path. On Windows, confirm the path uses double backslashes.
393411
* Context icon still missing after setup: It may take two reloads the first time (see the first-run note above). Confirm `CC_PATCH_CONTEXT_ICON` is not set to `0` and `CC_WORKAROUNDS` is not set to `0`.
394412
* `could not find the real 'claude' binary`: Set `CLAUDE_REAL_BIN` to its full path. Use `which claude` on Linux/macOS or `where claude` on Windows.

‎TECHNICAL.md‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,13 @@ current builds.)
259259

260260
See the [README's 2026-07-07 update](README.md#2026-07-07-update-opus-48-and-the-experiment-header)
261261
for the verified two-step mitigation (purge the cached assignment, then launch
262-
with `DISABLE_GROWTHBOOK=1`) and its caveats. Server-side assignment can be
263-
widened, narrowed, or ended by Anthropic at any time without a client update.
262+
with `DISABLE_GROWTHBOOK=1`) and its caveats. The launcher can apply both steps
263+
on every launch via the opt-in `CC_ATIS_OPTOUT=1` toggle (off by default; same
264+
idempotent / one-time-backup / atomic-write / best-effort safety model as the
265+
bundle patches - the purge runs only when an assignment is actually cached, and
266+
a failed parse or write leaves `~/.claude.json` untouched). Server-side
267+
assignment can be widened, narrowed, or ended by Anthropic at any time without
268+
a client update.
264269
265270
### Status
266271

‎fixes/thinking-summaries/README.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ the one lever that is not interactivity-gated. It edits no files.
1111
> experiment (an `x-cc-atis` request header sourced from a cached assignment in
1212
> `~/.claude.json`) blanks summaries even when the request carries
1313
> `display: "summarized"`, so this fix cannot restore them there. Other models
14-
> and un-enrolled installs are unaffected. Diagnosis and mitigation:
14+
> and un-enrolled installs are unaffected. Diagnosis and mitigation (manual, or
15+
> automated by the launcher's opt-in `CC_ATIS_OPTOUT=1` toggle, off by default):
1516
> [README 2026-07-07 update](../../README.md#2026-07-07-update-opus-48-and-the-experiment-header);
1617
> mechanism: [TECHNICAL.md](../../TECHNICAL.md#2026-07-07-update-server-side-experiment-blanks-opus-48-summaries).
1718
> Also note extension `2.1.202`+ maps `showThinkingSummaries` into the launch

‎launcher/README.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ recompiling. The Windows launcher compiles to a single `claudemax.exe` with
99

1010
Both launchers are drop-in process wrappers: they find the real `claude`, peel
1111
the process-wrapper convention args, inject the thinking-display flag when a real
12-
agent run is detected, reconcile the webview bundle, then exec the real CLI.
12+
agent run is detected, apply the opt-in `x-cc-atis` experiment opt-out,
13+
reconcile the webview bundle, then exec the real CLI.
1314

1415
## Wiring (process wrapper)
1516

@@ -38,6 +39,7 @@ Terminal:
3839
| `CC_THINKING_DISPLAY` | `summarized` | `summarized` shows extended-thinking summaries; `omitted` hides them (no injection). **2026-07-07:** cannot override the server-side experiment that blanks Opus 4.8 summaries - see the [README 2026-07-07 update](../README.md#2026-07-07-update-opus-48-and-the-experiment-header). |
3940
| `CC_PATCH_CONTEXT_ICON` | `1` | `0` leaves the context-usage icon unpatched (and reverts ours on the next launch). |
4041
| `CC_PATCH_MD_COPY` | `1` | `0` leaves the webview without the markdown copy/export controls (and reverts ours on the next launch). |
42+
| `CC_ATIS_OPTOUT` | `0` | `1` opts out of the server-side experiment that blanks Opus 4.8 thinking summaries: purges the cached `x-cc-atis` assignment from `~/.claude.json` (one-time backup, atomic write, idempotent) and launches with `DISABLE_GROWTHBOOK=1`. **Off by default** - it edits the CLI's config file and disables ALL client-side feature gating. Bash launcher needs `jq` for the purge half. See the [README 2026-07-07 update](../README.md#2026-07-07-update-opus-48-and-the-experiment-header). |
4143

4244
Setting toggles without touching the script:
4345

‎launcher/claudemax‎

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
# headless -p/SDK. Done by injecting `--thinking-display summarized` into the
77
# launch args - the one lever that is NOT interactivity-gated. Edits nothing.
88
# 2026-07-07: cannot override the server-side experiment that blanks Opus 4.8
9-
# summaries (x-cc-atis header); see the README's 2026-07-07 update.
9+
# summaries (x-cc-atis header); see the README's 2026-07-07 update. The
10+
# launcher can apply that update's mitigation - opt in with CC_ATIS_OPTOUT=1
11+
# (OFF by default; see the section below and the README for its caveats).
1012
# 2. Restores the always-visible context-usage icon in the VS Code chat input.
1113
# Recent extension builds (2.1.165+) hide that icon until you have used
1214
# >50% of the context window; with the 1M window that is ~500k tokens, so it
@@ -49,6 +51,8 @@
4951
# export CC_WORKAROUNDS=0 # master: disable every fix (1)
5052
# export CC_RECONCILE=0 # do not touch the webview bundle (1)
5153
# export CC_SCRUB_ROUTING=1 # force the default Anthropic account (0)
54+
# export CC_ATIS_OPTOUT=1 # purge cached x-cc-atis experiment
55+
# # assignment + DISABLE_GROWTHBOOK=1 (0)
5256
#
5357
# The real `claude` must be installed. This wrapper finds it automatically; if it
5458
# cannot, set CLAUDE_REAL_BIN to the full path of your real claude binary.
@@ -176,6 +180,59 @@ fi
176180
# >>> ccwa-local-env >>>
177181
# <<< ccwa-local-env <<<
178182

183+
# --- x-cc-atis experiment opt-out (OFF by default) ---------------------------
184+
#
185+
# CC_ATIS_OPTOUT=1 applies the verified 2026-07-07 mitigation for the
186+
# server-side experiment that blanks Opus 4.8 thinking summaries (README
187+
# "2026-07-07 update"):
188+
# 1. purge any cached x-cc-atis experiment assignment from ~/.claude.json, and
189+
# 2. launch with DISABLE_GROWTHBOOK=1 so the next remote feature refresh
190+
# cannot re-enroll this install.
191+
# Both halves are required - the env var alone still sends the already-cached
192+
# token, and the purge alone lasts only until the next refresh (both measured).
193+
#
194+
# OFF by default, unlike the other fixes, because it is not free: it edits the
195+
# CLI's own config file, and DISABLE_GROWTHBOOK=1 opts the install out of Claude
196+
# Code's client-side feature gating ENTIRELY, not just this experiment. Enable
197+
# it deliberately.
198+
#
199+
# Safety model matches the bundle patches: idempotent (no rewrite when nothing
200+
# is cached), one-time backup (~/.claude.json.bak-cc-workarounds, only if
201+
# absent), atomic temp+mv write (jq exits non-zero on malformed input, so a bad
202+
# parse never replaces the file), best-effort (never blocks the launch). The
203+
# purge half needs jq; without it the launcher warns and still sets
204+
# DISABLE_GROWTHBOOK=1 (an already-cached assignment is still sent until purged
205+
# by hand - see the README's manual recipe).
206+
CC_ATIS_OPTOUT="${CC_ATIS_OPTOUT:-0}"
207+
208+
_cc_atis_optout() {
209+
[ "$CC_WORKAROUNDS" != "0" ] || return 0
210+
[ "$CC_ATIS_OPTOUT" != "0" ] || return 0
211+
export DISABLE_GROWTHBOOK=1
212+
local cfg="$HOME/.claude.json" tmp
213+
[ -f "$cfg" ] && [ -r "$cfg" ] || return 0
214+
if ! command -v jq >/dev/null 2>&1; then
215+
echo "claudemax: CC_ATIS_OPTOUT=1 but jq is not installed; cached x-cc-atis assignment (if any) NOT purged" >&2
216+
return 0
217+
fi
218+
# Idempotent: rewrite only when an assignment is actually cached.
219+
jq -e '((.clientDataCacheSlots // {}) | any(.[]?; .data.atis? != null))
220+
or ((.clientDataCache // {}) | has("atis"))' "$cfg" >/dev/null 2>&1 || return 0
221+
if [ ! -e "${cfg}.bak-cc-workarounds" ]; then
222+
cp -p "$cfg" "${cfg}.bak-cc-workarounds" 2>/dev/null || true
223+
fi
224+
tmp="${cfg}.ccatis.$$"
225+
if jq '.clientDataCacheSlots |= (if . then with_entries(select((.value.data.atis? // null) == null)) else . end)
226+
| del(.clientDataCache.atis)' "$cfg" > "$tmp" 2>/dev/null \
227+
&& [ -s "$tmp" ]; then
228+
mv -f "$tmp" "$cfg" 2>/dev/null || rm -f "$tmp" 2>/dev/null || true
229+
else
230+
rm -f "$tmp" 2>/dev/null || true
231+
fi
232+
}
233+
234+
_cc_atis_optout || true
235+
179236
# --- Inject the thinking-display fix into the launch args -------------------
180237
#
181238
# Fire on a real agent invocation. Surfaces signal a real run differently:

‎launcher/claudemax.win.js‎

Lines changed: 85 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
// the launch args (the one lever that is NOT interactivity-gated). Edits
88
// nothing.
99
// 2026-07-07: cannot override the server-side experiment that blanks Opus
10-
// 4.8 summaries (x-cc-atis header); see the README's 2026-07-07 update.
10+
// 4.8 summaries (x-cc-atis header); see the README's 2026-07-07 update. The
11+
// launcher can apply that update's mitigation - opt in with CC_ATIS_OPTOUT=1
12+
// (OFF by default; see the section below and the README for its caveats).
1113
// 2. Restores the always-visible context-usage icon in the VS Code chat input.
1214
// Recent extension builds (2.1.165+) hide that icon until you have used
1315
// >50% of the context window; with the 1M window that is ~500k tokens, so it
@@ -50,6 +52,8 @@
5052
// set CC_WORKAROUNDS=0 master: disable every fix (default: 1)
5153
// set CC_RECONCILE=0 do not touch the webview bundle (default: 1)
5254
// set CC_SCRUB_ROUTING=1 force the default Anthropic account (default: 0)
55+
// set CC_ATIS_OPTOUT=1 purge cached x-cc-atis experiment assignment
56+
// + DISABLE_GROWTHBOOK=1 (default: 0)
5357
//
5458
// The real `claude` must be installed. This wrapper finds it automatically
5559
// (native install `claude.exe` or npm `claude.cmd`); if it cannot, set the
@@ -550,6 +554,86 @@ if (process.env.CC_SCRUB_ROUTING && process.env.CC_SCRUB_ROUTING !== "0") {
550554
// >>> ccwa-local-env >>>
551555
// <<< ccwa-local-env <<<
552556

557+
// --- x-cc-atis experiment opt-out (OFF by default) ---------------------------
558+
// CC_ATIS_OPTOUT=1 applies the verified 2026-07-07 mitigation for the
559+
// server-side experiment that blanks Opus 4.8 thinking summaries (README
560+
// "2026-07-07 update"): purge any cached x-cc-atis experiment assignment from
561+
// the CLI config (%USERPROFILE%\.claude.json) and launch with
562+
// DISABLE_GROWTHBOOK=1 so the next remote feature refresh cannot re-enroll this
563+
// install. Both halves are required - the env var alone still sends the
564+
// already-cached token, and the purge alone lasts only until the next refresh
565+
// (both measured).
566+
//
567+
// OFF by default, unlike the other fixes, because it is not free: it edits the
568+
// CLI's own config file, and DISABLE_GROWTHBOOK=1 opts the install out of
569+
// Claude Code's client-side feature gating ENTIRELY, not just this experiment.
570+
// Enable it deliberately.
571+
//
572+
// Safety model matches the bundle patches: idempotent (no rewrite when nothing
573+
// is cached), one-time backup (.claude.json.bak-cc-workarounds, only if
574+
// absent), temp + rename write (a failed parse or write leaves the original
575+
// untouched), best-effort (never blocks the launch).
576+
function atisOptout() {
577+
try {
578+
if (process.env.CC_WORKAROUNDS === "0") return;
579+
if (!process.env.CC_ATIS_OPTOUT || process.env.CC_ATIS_OPTOUT === "0") return;
580+
process.env.DISABLE_GROWTHBOOK = "1";
581+
const home = process.env.USERPROFILE || process.env.HOME || "";
582+
if (!home) return;
583+
const cfg = path.join(home, ".claude.json");
584+
if (!fs.existsSync(cfg)) return;
585+
let data;
586+
try {
587+
data = JSON.parse(fs.readFileSync(cfg, "utf8"));
588+
} catch (_) {
589+
return; // unreadable or malformed -> leave the file intact
590+
}
591+
if (!data || typeof data !== "object" || Array.isArray(data)) return;
592+
let changed = false;
593+
const slots = data.clientDataCacheSlots;
594+
if (slots && typeof slots === "object" && !Array.isArray(slots)) {
595+
for (const k of Object.keys(slots)) {
596+
const v = slots[k];
597+
if (v && v.data && typeof v.data === "object" && v.data.atis != null) {
598+
delete slots[k];
599+
changed = true;
600+
}
601+
}
602+
}
603+
if (
604+
data.clientDataCache &&
605+
typeof data.clientDataCache === "object" &&
606+
"atis" in data.clientDataCache
607+
) {
608+
delete data.clientDataCache.atis;
609+
changed = true;
610+
}
611+
if (!changed) return; // idempotent: nothing of the experiment's is cached
612+
const bak = cfg + ".bak-cc-workarounds";
613+
if (!fs.existsSync(bak)) {
614+
try {
615+
fs.copyFileSync(cfg, bak);
616+
} catch (_) {
617+
/* best-effort backup */
618+
}
619+
}
620+
const tmp = cfg + ".ccatis." + process.pid;
621+
try {
622+
fs.writeFileSync(tmp, JSON.stringify(data, null, 2) + "\n");
623+
fs.renameSync(tmp, cfg); // atomic on the same volume
624+
} catch (_) {
625+
try {
626+
fs.unlinkSync(tmp);
627+
} catch (_) {
628+
/* nothing to clean up */
629+
}
630+
}
631+
} catch (_) {
632+
/* never block the launch */
633+
}
634+
}
635+
atisOptout();
636+
553637
// --- Inject the thinking-display fix into the launch args -------------------
554638
// Fire on a real agent invocation. Surfaces signal a real run differently:
555639
// - the VS Code extension passes "--max-thinking-tokens N" (N > 0) plus the

0 commit comments

Comments
 (0)