Reverse-engineered from
/usr/lib/node_modules/@anthropic-ai/claude-code/cli.jsv2.1.68 (minified, ~12MB).
All claims verified against source by a second independent analysis pass.
Logic confirmed unchanged in v2.1.69 (function names re-mangled by minifier; behavior identical).
Type ultrathink in a message and Claude Code:
- Injects a meta-message into the conversation telling the model to "apply reasoning effort level: high"
- Shows a 5-second toast: "Effort set to high for this turn"
- Does nothing else
It does not change the API's output_config.effort parameter. It does not change budget_tokens. The two numeric constants defined right next to the ultrathink code — ff7=180000 and Tf7=40000 — are never referenced anywhere else in the file. Dead constants, probably from an earlier implementation.
// Feature flag gate — tengu_turtle_carbon, default: true
function jd() { return zA("tengu_turtle_carbon", !0) }
// Word detector
function Vf7(A) { return /\bultrathink\b/i.test(A) }
// Called on every user message before the turn
function rqY(A) {
if (!jd() || !A || !Vf7(A)) return [];
l("tengu_ultrathink", {}); // telemetry side-effect (comma operator)
return [{ type: "ultrathink_effort", level: "high" }];
}The returned event is then converted into a meta-message injected into the conversation:
case "ultrathink_effort":
return h9([q8({
content: `The user has requested reasoning effort level: ${A.level}. Apply this to the current turn.`,
isMeta: true
})]);The UI renderer silently discards the event (renders nothing):
case "ultrathink_effort": return null // alongside token_usage, ultramemory, etc.Toast:
p4.useEffect(() => {
if (!r6.length || !jd()) return;
j8({ key: "ultrathink-active", text: "Effort set to high for this turn", priority: "immediate", timeoutMs: 5000 })
}, [j8, r6.length]);Claude Code has an actual API-level effort knob, completely independent of ultrathink:
output_config: { effort: "low" | "medium" | "high" | "max" }
Beta header: effort-2025-11-24 (stored as bn1).
Supported models (via Xs(model)): opus-4-6, sonnet-4-6, and any unrecognized model name not matching haiku/sonnet/opus patterns (permissive fallback).
The function that applies it:
function xjz(A, q, K, Y, z) {
if (!Xs(z) || "effort" in q) return;
if (A === void 0) Y.push(bn1); // beta header only, no value
else if (typeof A === "string") q.effort = A, Y.push(bn1); // sets output_config.effort
}Called as: xjz(G6, o, y6, I6, w.model) where o is the output_config object.
Effort value resolution order:
G6 = Cf7() ?? w.effortValue ?? gD6(w.model)
// ↑ env var ↑ user settings ↑ model defaultCf7()readsCLAUDE_CODE_EFFORT_LEVEL(validated against["low","medium","high","max"])w.effortValuecomes from user settings, set via/modelmenu or stored inuserSettings.effortLevelgD6(model)is the model default
When the ultrathink feature flag (tengu_turtle_carbon) is on — which is the default — gD6() deliberately sets the default effort to "medium" for supported models:
function gD6(A) {
if (A.toLowerCase().includes("opus-4-6")) {
if (Lf7() || Jd()) return "medium"; // API mode or Claude Pro user
if (zb6().enabled && (By() || wb6())) return "medium"; // feature flag + Max/5x tier
}
if (jd() && Xs(A)) return "medium"; // ← the ultrathink path
return; // undefined → no effort set in API call
}So enabling the ultrathink feature lowers the default API effort from the Anthropic default ("high") to "medium". Typing ultrathink then sends a text message telling the model to "apply reasoning effort: high" — but the API parameter remains "medium".
The "max" effort level (Opus 4.6 only) is never touched by ultrathink. You'd need CLAUDE_CODE_EFFORT_LEVEL=max or the model menu to get there.
var ff7 = 180000, Tf7 = 40000, QF5, UF5;Both ff7 and Tf7 appear exactly once in the entire 12MB file — at their declaration, immediately adjacent to the ultrathink functions. They are never read. Almost certainly the old token budget values from when ultrathink was intended to set budget_tokens directly, before the implementation switched to the output_config.effort system.
| What | How |
|---|---|
| Detection | /\bultrathink\b/i regex on user input |
| Feature flag | tengu_turtle_carbon (default: enabled) |
| API effect | None — only a text meta-message is injected |
| API effort param | Separate system: output_config.effort, set by env var / user settings / model default |
| Default effort (with flag on) | "medium" for supported models |
"max" effort |
Unreachable via ultrathink; use CLAUDE_CODE_EFFORT_LEVEL=max |
| Dead constants | ff7=180000, Tf7=40000 — defined, never used |
| Toast | "Effort set to high for this turn", 5 seconds |
Minified function names change between releases. In v2.1.69 the same functions appear as Ad(), zY4(), Rt9(), enA=180000, ArA=40000, Ca1="effort-2025-11-24" etc. Logic is byte-for-byte equivalent.
Researched by an AI already working for someone else, so we read the minified source anyway.