experiment

Claude Code binary: reverse engineered

in progressreverse-engineeringtooling

Extracted the .exe, rebuilt the source tree from the extracted contents, now I can recompile with my own patches.

A bit borderline, legally, but a great exercise. Currently working on recovering meaningful function names from the minified output, so LLMs can actually navigate the codebase instead of drowning in garbage symbols.

target
claude.exe v2.1.205
bundle
19 MB JS
patches
9 shipped

The target

The official Claude Code CLI is a single 100 MB Bun-compiled executable. Inside it sits a 19 MB JavaScript application bundled as a CommonJS IIFE that no one can edit. 0xClaude unpacks that bundle and gives it back to you as something patchable.

How it works

extract-bundle.py pulls the embedded JS and assets out of your own claude.exe. A small patch framework then layers changes on top: each patch is a CommonJS module that exports bundleTransform(source) => source and anchors itself to a unique string in the bundle. build.ps1 recompiles a fresh claude-fork.exe with the patched bundle, and an acceptance gate verifies --version output stays byte-identical.

The patches are small, self-contained, and toggle-able by renaming a file.

The patch catalog

Nine patches ship today: model menus, providers, login, setmodel, auto-pairs, slash commands, classifier logging, hot-reload, and a hello-world demo. Enable the ones you want, disable the rest: alternate model providers like LiteLLM, NVIDIA NIM, or LM Studio appear in the native /model picker, get cached, hot-reload, and persist to ~/.claude/settings.json like built-in models.

Where it is heading

The next frontier is symbol recovery: pulling meaningful function names out of the minified output so an LLM can navigate the codebase instead of drowning in garbage identifiers. It is a bit borderline, legally, but it is a great exercise in how these tools are built.