Community-contributed binary patches for Claude Code CLI — unlock hard-coded limitations without waiting for upstream changes.
Disclaimer: This is unofficial and not supported by Anthropic. It modifies the Claude Code binary. Use at your own risk. Keep backups and know how to reinstall Claude Code.
npx skills add huybuidac/claude-code-patchkit -gThe
-gflag installs globally (user-level) so the skill is available in all projects. Without it, the skill is only available in the current project.
/plugin marketplace add huybuidac/claude-code-patchkit
/plugin install claude-patch
macOS / Linux:
- macOS arm64 (tested) or x86_64 (expected to work); Linux (untested)
- Python 3
codesign(macOS only — ships with macOS)
Windows 10/11:
- arm64 (tested) or x64 (expected to work)
- PowerShell 5.1+
- Node.js (LTS) on PATH — required for the bundled binary scanner
Both:
- Claude Code installed as native binary
- Write permission to the Claude binary
Inside a Claude Code session:
/claude-patch # Interactive mode
/claude-patch apply subagent-model # Apply specific patch
/claude-patch revert subagent-model # Revert to backup
/claude-patch status # Show all patch states
| Patch | Description | Risk |
|---|---|---|
| subagent-model | Unlock model param on Agent tool — use any model id per-call |
Low |
Claude Code is distributed as a bun-compiled binary with embedded JS bundles. Some behaviors are locked behind hard-coded Zod schemas. This is an Agent Skill — Claude reads the patch definitions and executes the procedure interactively with your confirmation at each step. It applies safe, length-preserving binary patches with:
- Fingerprint detection — locate exact byte patterns
- Context guard — verify surrounding stable strings (not minified variables)
- State detection — determine unpatched / patched / abnormal before acting
- Backup — always saves
<binary>.bak.<timestamp> - Length-preserving swap — no offset shifts or blob corruption
- Re-sign / signature handling — ad-hoc codesign on macOS; on Windows the Authenticode signature becomes
HashMismatch(binary still runs) - Self-verify — confirm marker count post-patch
Note: the bun-compiled binary embeds the JS bundle 1 or 2 times depending on platform/version (macOS ≤ 2.1.132 = 2, macOS ≥ 2.1.133 = 1, Windows = 1). Patch definitions detect the count dynamically rather than asserting a fixed number.
claude.exe is locked while running, so apply/revert use a rename-swap pattern:
- Copy → patch a
.patchingsidecar at the known offset Rename-Itemthe liveclaude.exeto.replacing.<ts>(same-volume rename works on a running .exe)Move-Itemthe patched copy into place- Restart Claude Code to pick up the new binary; clean up
*.replacing.*after exit
- Never patches without explicit user confirmation
- Aborts if fingerprint doesn't match (schema changed in new version)
- Always creates backup before modifying
- Re-applies required per Claude Code update (new binary = clean slate)
- Copy
skills/claude-patch/patches/TEMPLATE.md - Fill in all sections (fingerprint, context guard, replacement, detection, script)
- Test on at least 2 Claude Code versions
- Submit a PR
- Length-preserving replacement (old bytes == new bytes in length)
- Unique marker string embedded in replacement for state detection
- Context guard using stable strings (
.describe()text, not minified variable names) - Tested version list
- macOS arm64 (Apple Silicon) — tested
- macOS x86_64 — should work (untested)
- Windows 11 arm64 — tested
- Windows 10/11 x64 — should work (untested)
- Linux — binary layout may differ, contributions welcome
- Backups are saved as
<binary>.bak.<timestamp>next to the original - macOS / Linux:
cp <binary>.bak.<timestamp> <binary> && codesign --force --sign - <binary>(skipcodesignon Linux) - Windows: stop Claude Code, then use rename-swap —
Rename-Item claude.exe claude.exe.broken; Move-Item claude.exe.bak.<ts> claude.exe. The backup retains the original Authenticode signature. - Clean up Windows
*.replacing.*files after Claude Code has exited (they may stay on disk while the old process is still mapped) - If your
.baksize doesn't match the current binary (Claude Code re-bundled within the same version), don't restore — the/claude-patch revertflow will detect this and offer in-place reverse-patch instead. - To reinstall Claude Code: delete the install dir (
~/.local/share/claude/on Unix,%USERPROFILE%\.local\bin\claude.exeon Windows) and re-run the installer
MIT