Claude patch
Patch Claude Code CLI binary to unlock hard-coded limitations. Use when the user wants to apply, revert, or check status of binary patches after upgrading Claude Code. Community-contributed patches for model restrictions, feature flags, and schema unlocks.From its SKILL.md
npx -y skills add huybuidac/claude-code-patchkit --skill claude-patchAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 4 stars4 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
5.5 KB, as published. Nobody here has run it
claude-patch
Binary patches for Claude Code CLI — unlock hard-coded limitations without waiting for upstream changes.
All scanning and patching runs through one cross-platform tool, patches/patch-bin.js. It handles ad-hoc re-signing on macOS and the rename-swap a locked claude.exe needs on Windows, so there are no per-platform scripts to choose between.
node patches/patch-bin.js scan --patch <name> [--bin <path>] # state + derived anchor + guards
node patches/patch-bin.js apply --patch <name> [--bin <path>]
node patches/patch-bin.js revert --patch <name> [--bin <path>]
--bin defaults to the resolved claude on PATH. scan exits 1 when the state is abnormal.
Workflow
- Identify the binary — run
scan; it prints the resolved path, size, and state. Show the user the path andclaude --versionbefore proposing any write. - Select the patch — from the user's argument, or ask. Read
patches/<name>.mdfor what it does and what it is tested on. - Confirm — never write without explicit user confirmation for this specific binary.
- Apply or revert —
applyhandles guard checks, backup, the write, the sidecar, re-signing, and self-verification in one step, and refuses rather than guessing if anything is off. - Report — state the resulting marker count and whether a restart is needed (patch-dependent;
subagent-modelneeds none,auto-compact-by-modeldoes).
Available patches
| Patch | Description |
|---|---|
| subagent-model | Unlock model param on Agent tool — use any model id per-call |
| auto-compact-by-model | Model-aware extended-context compact targets (Claude ≈400K, GPT ≈300K) |
Commands: apply <patch>, revert <patch>, status (scan every patch), list.
Safety rules
- NEVER patch without explicit user confirmation.
- NEVER patch if a context guard fails —
applyenforces this, so do not work around it. - If state is
abnormal, abort and report. Both-zero (no anchor, no marker) means the fingerprint changed: re-derive it before doing anything else, never patch blind. - Every write is length-preserving and verified against the expected bytes at that offset first, so a stale offset aborts instead of corrupting the binary.
- Backups (
<binary>.bak.<ts>) are ~290 MB each. Mention rotation after a version is confirmed working.
Why anchors are derived, not hardcoded
Every literal anchor in this skill's history eventually matched 0 times, because the bundler renames minified identifiers every few builds. A count of 0 is indistinguishable from "the feature was removed", so a hardcoded anchor turns routine drift into a false abort.
Each patch therefore derives its anchor at scan time from landmarks that do not move — string literals the product ships (.describe() text, source:"…" labels) and positional locals the bundler assigns by position. Patch definitions document the derivation rule rather than the bytes. When adding a patch, find a landmark first; if the only stable thing you can find is a minified name, expect it to rot.
Bundle multiplicity
The bun-compiled binary may embed the JS bundle more than once:
- macOS ≤ 2.1.132: 2 instances; macOS ≥ 2.1.133: 1
- Windows: 1 (all observed versions)
Never hard-assert a count — derivation counts landmarks and patches all of them.
Revert
revert prefers the sidecar <binary>.rtk-<patch>.json that apply writes: it records the original bytes for each offset, so the reverse-patch is exact and immune to build mismatch. This matters because a patched binary alone cannot reconstruct a drifted alias — only its length survives.
Without a sidecar (patched before they existed) it falls back to a content-validated backup: the candidate must itself scan as unpatched with matching landmarks and guards. Do not gate on file size — on macOS the backup is Apple-signed while the patched binary is ad-hoc signed, so their sizes legitimately differ. A <binary>.preRevert.<ts> snapshot is taken before any write, so the revert itself is undoable.
Platform notes
- macOS — patching invalidates Anthropic's signature;
apply/revertre-sign ad-hoc and verify. Gatekeeper may prompt on first launch. - Windows — a running
claude.exeis locked, so writes go to a copy that then takes the original's path (renaming a running image only updates the directory entry). Authenticode becomesHashMismatch; the binary still runs, though SmartScreen/AppLocker policy may object. A displaced*.replacing.*file may linger until the old process exits. - Auto-update — each new Claude Code version ships a fresh, unpatched binary. Re-apply per version.
Contributing
To add a new patch, create ${CLAUDE_SKILL_DIR}/patches/<name>.md following patches/TEMPLATE.md, and register its derivation in patch-bin.js.
What ships with it: 3 files
36.3 KB alongside SKILL.md, 1 of them executable
patches/
- scan-bin.jsruns3.5 KB
- subagent-model.md31.2 KB
- TEMPLATE.md1.6 KB
Gives 0 of the 12 instructions most context ai engineering skills give
Counted across 1,328 of the 2,349 authors here whose files we hold, read 2026-09-06
- Dispatch a fresh subagent for each taskin 76 of 1328, across 59 files
- Perform spec compliance review before code quality reviewin 44 of 1328, across 34 files
- Dispatch a final code reviewer after all tasksin 38 of 1328, across 26 files
- Answer subagent questions before allowing implementationin 36 of 1328, across 26 files
- Use the least powerful model capable of the taskin 33 of 1328, across 26 files
- Create a TodoWrite list for all tasksin 32 of 1328, across 22 files
- Perform a task review after each implementationin 31 of 1328, across 24 files
- Extract all tasks and context from the planin 29 of 1328, across 20 files
- Provide full task text to subagentsin 28 of 1328, across 20 files
- Use git worktrees for isolated workspacesin 25 of 1328, across 20 files
- Specify the model explicitly when dispatching a subagentin 23 of 1328, across 18 files
- Execute all tasks from the plan without stoppingin 21 of 1328, across 16 files
Said here and by no other author read
- Run scan before proposing any write
- Show binary path and version to user
- Read patch documentation before applying
- Use apply to handle guards and backups
- Report marker count and restart requirements
- Re-derive anchors if state is abnormal
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once.