一键导入
patch-channels-validation
Validate that Claude Code channel patching was applied correctly. Use after running the patcher to confirm both patches took effect.
用 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.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Checklist for safely upgrading Claude Code version with channel patching. Use before upgrading any agent's Claude Code installation.
Core methodology for patching Bun-compiled Claude Code binaries. Use when implementing or updating the channel patcher for ELF binaries.
Determine what type of Claude Code binary you have (JS bundle vs Bun ELF), its version, and what patchable strings are present.
| name | patch-channels-validation |
| description | Validate that Claude Code channel patching was applied correctly. Use after running the patcher to confirm both patches took effect. |
The patcher reporting "4 patches applied successfully" is NECESSARY but NOT SUFFICIENT. The patcher only confirms it found and rewrote bytes at the expected pattern locations. It does NOT confirm the rewritten code actually changes runtime behavior.
Failure modes where the patcher says ✅ but behavior is unchanged:
Always validate behavior, not just patcher output. Specifically:
--dangerously-load-development-channels and a non-allowlisted channel plugin.This is a documented historical failure: see docs/research/patcher-investigation/ for cases where Patch 2/3 reported OK on certain versions but the dialog still appeared at runtime.
Source: Handler instruction (2026-05-05): "Remember the patcher can succeed but the patch can still not successfully change the behavior."
CLAUDE_BIN=$(readlink -f "$(which claude)")
# 1. Binary still runs
claude --version
# Expected: "2.1.XXX (Claude Code)" — non-zero exit = broken patch
# 2. Allowlist patch applied (isChannelAllowlisted returns true)
strings "$CLAUDE_BIN" | grep -c 'return!0}\/\*x'
# Expected: > 0 (padded replacement present)
# 3. Original allowlist function is gone
strings "$CLAUDE_BIN" | grep -c 'isChannelAllowlisted.*marketplace'
# Expected: 0 if patched, > 0 if unpatched
Before patching, check if the binary was previously patched:
# Check for the padding comment signature from allowlist patch
strings "$CLAUDE_BIN" | grep -q 'return!0}\/\*x' && echo "ALREADY PATCHED" || echo "NOT PATCHED"
claude --version exits 0 and prints version stringreturn!0 present where the original function wascase"exit":K() present (calls onAccept instead of g4(1))| Symptom | Cause |
|---|---|
TypeError: Expected CommonJS module | Replacement changed byte length or broke module wrapping |
| Version prints but plugins still blocked | Only one of two patches applied |
| Segfault on startup | Binary corruption — restore from backup |
See docs/research/patcher-investigation/evidence-patching-results.txt for detailed experiment logs.