ReferenceError: getCurrentOutputStyleName is not defined on session start/resume (regression in 2.1.193, still in 2.1.195)
Summary
Launching/resuming a session crashes with ReferenceError: getCurrentOutputStyleName is not defined. The function is called but never defined in the bundle. Introduced in 2.1.193 and still present in 2.1.195 (latest). 2.1.191 is unaffected.
Error
ERROR getCurrentOutputStyleName is not defined
/$bunfs/root/src/entrypoints/cli.js:32559:7784
- <anonymous> (/$bunfs/root/src/entrypoints/cli.js:32559:7784)
- LT (.../cli.js:545:64488)
- Sie (.../cli.js:545:77933)
- NT (.../cli.js:545:77808)
... (repeated Sie/NT React render frames)
The stack is entirely minified React component render frames, so it fires during a UI render on startup/resume.
Root cause
The bundle contains exactly one code reference to the symbol, a free (un-minified) call with no corresponding definition:
... .agentDefinitions.activeAgents), account: <fn>(), outputStyle: getCurrentOutputStyleName(), mcpServers: ...
Because getCurrentOutputStyleName is left as an un-minified free identifier (no function getCurrentOutputStyleName / const getCurrentOutputStyleName = anywhere), it resolves to nothing at runtime → ReferenceError. This looks like a context/telemetry payload builder (collecting account, outputStyle, mcpServers) that lost its import/definition during bundling.
Evidence across builds (native installer)
Counting code-symbol occurrences in each cached binary:
| Version | getCurrentOutputStyleName refs | Status |
|---------|----------------------------------|--------|
| 2.1.191 | 0 | OK (symbol does not exist) |
| 2.1.193 | call present, no definition | crashes |
| 2.1.195 | call present, no definition | crashes |
So this is a 2.1.193 regression, not new in 2.1.195, and updating does not fix it (195 is latest published).
Repro
- Install/run Claude Code 2.1.193 or 2.1.195 (native installer).
- Start or resume a session (the render path that builds the context payload containing
outputStyle). - Crash with the error above.
Note: no outputStyle is configured in any settings.json, and no custom output styles exist — so it is not a user-config issue. It reproduces with default config.
Workaround
Roll the native-installer symlink back to a good build and pin it:
ln -sfn ~/.local/share/claude/versions/2.1.191 ~/.local/bin/claude
# add to ~/.claude/settings.json env: "DISABLE_AUTOUPDATER": "1"
Environment
- Claude Code: 2.1.193 / 2.1.195 (broken), 2.1.191 (works)
- Install: native installer (
~/.local/share/claude/versions/...) - Platform: macOS (Darwin 25.5.0), arm64
Suggested fix
Restore the missing definition/import of getCurrentOutputStyleName (or guard the call) in the context/telemetry payload builder so the outputStyle field resolves safely.
Showing cached comments. Read the full discussion on GitHub ↗
6 Comments
Solid root-cause writeup — the free
getCurrentOutputStyleNameidentifier with no definition in the telemetry/context-payload builder matches the all-React-render stack on startup. (I'm on 2.1.179 so I can't reproduce 2.1.193/195 myself; the notes below are the things I can verify, framed as such.)Three things worth adding for anyone landing here in a panic, since "every session start crashes" reads like a total lockout:
1. Your sessions are not lost — this is purely the binary. The crash is in a render-path telemetry builder, not in storage. Your conversation history lives on disk as
~/.claude/projects/<encoded-cwd>/<uuid>.jsonland is untouched by this bug (verified on my own install: the transcripts are plain.jsonlfiles that exist independently of the running version). So the rollback fully recovers you, andclaude --resumebrings the old sessions right back. Nothing was deleted.2. Don't "fix" it by reinstalling from scratch. Because the only broken thing is the compiled binary, a clean reinstall / deleting
~/.claude/ clearing config buys you nothing and risks losing yoursettings.json, MCP servers, and custom config for no reason. Roll the binary back, leave config alone.3. Rollback gotchas (so the workaround doesn't silently no-op):
ln -sfn ... 2.1.191 ..., confirm that version is actually cached:ls ~/.local/share/claude/versions/. If2.1.191isn't in there, the symlink points at a non-existent path and you get a different breakage instead of a fix. Pick the newest good version that is present (anything ≤ 2.1.191 by their evidence).DISABLE_AUTOUPDATER=1advice only applies to native-installer users. If you installed via npm (which clauderesolves into a node.../bin/claude), the symlink trick doesn't apply — pin instead withnpm install -g @anthropic-ai/claude-code@<last-good-version>and avoid@latest/claude updateuntil a fixed build ships.DISABLE_AUTOUPDATER(or pin the npm version) before the next launch, otherwise an auto-update can quietly put you back on the broken build.Net: acute and total (no session starts), but non-destructive — history and config are safe, and the rollback is a clean recovery rather than a rebuild.
I have this issue also.
Confirming the same crash on Windows 11 (native installer), so this isn't macOS-specific.
ReferenceError: getCurrentOutputStyleName is not definedonclaude --resume; 2.1.191 is fine.outputStyle:getCurrentOutputStyleName()with no definition. Occurrence counts in the cached native builds: 2.1.191 → 0, 2.1.193 → 1 (call, no def), 2.1.195 → 1 (call, no def).B:/~BUN/root/src/entrypoints/cli.js.~/.local/bin/claude.exeback to the cachedversions/2.1.191build and setDISABLE_AUTOUPDATER=1.Env: Windows 11 Pro (10.0.26200), x64, native installer.
Confirmed on Linux (kernel 7.1.1-tigerlake, x86_64), Claude Code 2.1.195.
Same error, same stack trace as described.
Additional workaround (no downgrade needed): print mode bypasses the crashing render path entirely:
Tested on a session originally created with 2.1.178–2.1.186 — resumes cleanly with
-p, crashes with interactive mode.Confirmed still broken in 2.1.197 (Linux, x86_64, kernel 7.1.1-tigerlake)
Tested by triggering the native installer update from 2.1.195 → 2.1.197:
Symbol occurrence count in each binary (
grep -oa "getCurrentOutputStyleName" <binary> | wc -l):| Version | Occurrences | Status |
|---------|-------------|--------|
| 2.1.190 | 0 | ✅ OK |
| 2.1.195 | 2 | ❌ crashes |
| 2.1.197 | 2 | ❌ crashes |
Context in 2.1.197 bundle (identical to 2.1.195):
Call site present, no definition — same root cause, not fixed in 2.1.197.
Workaround still required: pin to 2.1.190 or use
claude -p(print mode).Binary patch workaround (works on Linux/macOS/Windows-WSL, no downgrade needed)
Since the bug persists in 2.1.197, here's a surgical binary patch that fixes it without rolling back.
Root cause (confirmed)
The Bun bundle embeds JS uncompressed.
getCurrentOutputStyleName()appears as a 27-byte literal call with no definition. Pre-2.1.193 the field didn't exist, so returningundefinedis semantically equivalent.Patch
Replace the 27-byte call with
(void 0)+ 19 spaces (same byte count → no offset shift, valid JS):Auto-patch wrapper (survives future updates, self-disables when fixed)
Put this in a directory that precedes
~/.local/binin$PATH(e.g.~/.claude/scripts/claude):Detection logic:
| Case | call present | definition present | action |
|------|----|---|---|
| ≤ 2.1.190 (old) | ✗ | ✗ | exec direct |
| 2.1.193–2.1.197 (buggy) | ✓ | ✗ | patch |
| Future fixed version | ✓ | ✓ | exec direct — wrapper is a no-op |
The wrapper patches once per new binary version (result cached as
<version>-patched). When Anthropic ships a fix that includes the definition,has_bugreturns false and the wrapper transparently falls through — no manual cleanup needed.Tested on Linux x86_64, kernel 7.1.1-tigerlake, Claude Code 2.1.197.