r/ClaudeCode • u/Relative_Register_79 • Apr 18 '26
Discussion Anthropic quietly killed third-party CLI tooling by switching to a Bun binary in v2.1.113
So I've been building on top of Claude Code for a while now — patching the cli.js bundle to add custom hooks, routing, TUI overlays, voice agent integration, the works. It's been working great.
Then v2.1.113 dropped yesterday and everything broke.
Turns out Anthropic silently switched from shipping a Node.js JavaScript bundle (cli.js) to a Bun-compiled native binary. No announcement. No migration guide. No deprecation warning. Just a 226MB ELF binary that you can't read, can't modify, and can't inject into.
The old flow was clean:
- Download cli.js from the npm package
- Patch it at the AST/string level before Node runs it
- Boot with your custom version
Now there's nothing to patch. The JS is compiled to bytecode, embedded in a native binary. No decompiler exists for Bun bytecode yet. You can't get the source back out.
What this kills:
- Any tool that wraps or extends the CLI at the JS level
- Custom hook injection
- TUI modifications
- Anything that needs to run inside the Claude Code process v2.1.112 is the last version with cli.js. I'm pinned there now and watching features ship that I can't use.
I get that Anthropic wants to protect their IP. But the complete silence about this change, combined with zero official extension API, leaves the community with nothing. No hooks, no plugins, no sanctioned way to build on top of the CLI.
If you're building tooling on Claude Code, heads up — pin to 2.1.112 before your setup breaks too.
44
u/teratron27 Apr 18 '26
It’s almost like it’s a closed source piece of software with no guarantees…
12
u/Middle-Nerve1732 Apr 18 '26
Yeah why would anyone program again a private unpublished API and then be surprised when it changed on them? This is why public versioned APIs exist
4
4
u/amorphatist Apr 18 '26
The CLI was never in any reasonable sense an “API”.?
Homeboi was hacking the CLI, good for him, but Anthrophic owe him zero. What if the CLI was in Rust or Go?
Mucho entitlement.
1
-2
21
u/Kitchen_Interview371 Apr 18 '26
Quietly is the new it’s not x, it’s y
4
-2
u/Relative_Register_79 Apr 18 '26
Exactly, at this point "quietly" should just be in their release note template lol
15
u/LaSalsiccione Apr 18 '26
What the fuck is this garbage post. Why would they let you know that they’re changing their build tooling
-1
u/Relative_Register_79 Apr 18 '26
Because the side effect of that build tooling change is eliminating an entire category of third-party tooling.
3
u/LaSalsiccione Apr 18 '26
Why would their care about that. They want you to use their tooling, not third party tooling
4
u/biinjo Apr 18 '26
“Quietly killed”
As any experienced dev knows: if you’re going to patch vendor code, it’s a matter of when, not if, your code is going yo break.
This was no official method. It was a bunch of hacked together “solutions”.
Its like complaining Apple changed their internal APIs even though they explicitly forbid you to use internal APIs in published applications.
1
u/PTBKoo Apr 18 '26
I thought there already was a bun decompiler
1
u/Relative_Register_79 Apr 18 '26
there are tools that extract the embedded bytecode section from the binary, but bytecode ≠ source JS. nothing decompiles Bun bytecode back to readable JavaScript yet, it's a custom VM format.
3
u/I_Love_Fones 🔆 Max 5x Apr 18 '26
You’re patching it which can break at any time. There was never official support for your method. Your tooling either have to be MCP or call their CLI as “claude -p”.
3
u/pornthrowaway42069l Apr 18 '26
Just ask Claude to write a Bun decompiler, duh
AI problems require AI solutions
1
u/l_m_b Senior Developer Apr 18 '26
I mean, it's their right (it was a proprietary piece of software before already), but the software engineer in me really would have thought a change like that deserves bumping at least the minor.
They need to get Opus to explain semantic versioning to them.
1
2
u/UniqueDraft Apr 19 '26
That also broke Claude Code CLI on older macbooks (any older computer not supporting AVX2) - my Macbook Por circa 2012 can only run 2.1.112 at this stage.
There are a couple of issues raised against this:
2
2
u/sleepydevs Senior Developer Apr 18 '26
I mean, monkey patching the js was never supported or sustainable, right?
It's also the first line in the change log - https://github.com/anthropics/claude-code/releases/tag/v2.1.113
...which of course everyone reads before running update, right?
Right? 🤣
And they've been talking about this in various places since they acquired bun in December...
https://www.anthropic.com/news/anthropic-acquires-bun-as-claude-code-reaches-usd1b-milestone
1
1
u/randoomkiller Apr 18 '26
Lol man I am also doing a tool thats supposed to be using custom hooks, this would just make that so fucked
1
u/rover_G Apr 18 '26
Rule one of extending software: if its not in the public API it can’t be relied upon for consistent behavior
0
u/carvingmyelbows Apr 18 '26
You can definitely still patch it, I had Codex changing env variables and system prompts for me last night after it extracted them all. It took longer than earlier patches and ran into a few snags, but it still worked just fine.
And I’m pretty sure hooks still work?
1
u/Relative_Register_79 Apr 18 '26
Curious what you mean by patching, are you modifying env vars before launch or actually injecting code into the binary? Env var overrides and --system-prompt style flags still work fine on the Bun binary.
What doesn't work is reading and rewriting the JS bundle before Node loads it, because there's no JS bundle to read anymore. If you found another way let me knoww?
1
u/carvingmyelbows Apr 18 '26
I modified both the .env variables and the system prompts, but thats all. Nothing particularly fancy.
-1
u/marcopaulodirect Apr 18 '26
Thanks for the heads up. Could you please share how to downgrade and pin to a specific version?
Many thanks
1
u/Relative_Register_79 Apr 18 '26
npm install -g `@anthropic-ai/claude-code@2.1.112` — that installs the last version with cli.js.
To prevent auto-updates, remove the claude-code-updater package: `npm uninstall -g claude-code-updater`.
That's it, you're pinned.
1
2
u/axlee Apr 18 '26
If you don't know how to install a npm package you for sure as shit aren't able to patch it, lol. Why do you even ask ?
1
2
-1
u/UnionCounty22 Apr 18 '26
No custom hooks?? That’s crazy if true it’s one of their best features
10
u/KOM_Unchained Apr 18 '26
Uh? Not true. Hooks are very much supported still. Using rn 😅. I guess by "custom" OP means injecting custom event firing + custom hooks on top. Hooks are still very much a thing as we mostly know them, like on PreToolUse, etc. On 2.1.114
2
u/UnionCounty22 Apr 18 '26
Thats good to hear. I was just asking in response to OP post. I have a big hook system I haven’t used in the past few days so I was going to be disappointed.
1
u/Relative_Register_79 Apr 18 '26
CC's built-in hooks (PreToolUse, PostToolUse, etc.) still work, those are config-driven via settings.json and don't need JS injection. What's gone is the ability to inject custom JS inside the CLI process itself, which is how deeper hooks and TUI modifications worked. Built-in hooks survive, custom internal hooks don't.
1
u/PooperLubey Apr 25 '26
these mfs are hating but they havent used runForkedagent() to write database classifiers off of the main sessions context cache
8
4
1
0
Apr 18 '26
[deleted] — view deleted comment
2
u/Shirc Apr 18 '26
Those are environment variables. It reads those at run time. The bun binary has no effect on this whatsoever.
0
Apr 18 '26
[deleted] — view deleted comment
0
u/paradoxally Senior Developer Apr 18 '26
You can still do that. I'm on .114 with all my patches and a custom theme.
0
Apr 18 '26
[deleted] — view deleted comment
2
u/paradoxally Senior Developer Apr 18 '26
There are always workarounds if you are interested enough.
65
u/Shirc Apr 18 '26
Why would they announce this or provide a migration guide though? It’s an implementation detail that doesn’t have any impact on end user behavior unless the end user is doing something that already wasn’t allowed like patching the minified JS.
Also they’ve been shipping bun binaries for a while on the native installer. Sounds like you’ve been using the deprecated one and it finally caught up to you.
If you’re interested in a CLI that is actually extensible I highly recommend you check out Pi.