一键导入
binary-patching-methodology
Core methodology for patching Bun-compiled Claude Code binaries. Use when implementing or updating the channel patcher for ELF binaries.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Core methodology for patching Bun-compiled Claude Code binaries. Use when implementing or updating the channel patcher for ELF binaries.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Validate that Claude Code channel patching was applied correctly. Use after running the patcher to confirm both patches took effect.
Checklist for safely upgrading Claude Code version with channel patching. Use before upgrading any agent's Claude Code installation.
Determine what type of Claude Code binary you have (JS bundle vs Bun ELF), its version, and what patchable strings are present.
基于 SOC 职业分类
| name | binary-patching-methodology |
| description | Core methodology for patching Bun-compiled Claude Code binaries. Use when implementing or updating the channel patcher for ELF binaries. |
The JS source is embedded as plaintext strings inside the Bun binary, but:
writeFileSync with UTF-8 encoding destroys the ELF structureNODE_OPTIONS is ignored (Bun, not Node.js)Use Python (or any tool that handles raw bytes) to find and replace byte sequences:
with open(binary_path, 'rb') as f:
data = f.read()
original = b'function sG6(H){if(!H)return!1;let{name:...' # exact bytes
replacement = b'function sG6(H){return!0}/*xxxxxxxxx...*/' # same length
assert len(original) == len(replacement) # CRITICAL
data = data.replace(original, replacement)
with open(binary_path, 'wb') as f:
f.write(data)
/*...*/ to fill remaining space| Strategy | Example | Safety |
|---|---|---|
| Block comment padding | return!0}/*xxxx*/ | Safe — JS parser ignores comments |
Space padding after } | return!0} | UNSAFE — breaks Bun module detection |
| Trailing semicolons | return!0};;; | UNSAFE — may break parsing |
Works:
g4(1) → K() )Breaks:
TypeError: Expected CommonJS modulestrings binary | grep 'EXPORTNAME:()=>'isChannelAllowlisted:()=>sG6 → sG6)strings binary | grep 'function sG6('Full evidence and experiment results in docs/research/patcher-investigation/.