claude-code - 💡(How to fix) Fix CC silently replaces on-disk binary at unchanged version string, defeating tweakcc and other patchers [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#52460Fetched 2026-04-24 06:06:38
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Timeline (top)
labeled ×3commented ×1

Claude Code appears to silently replace the on-disk binary at ~/.local/share/claude/versions/<version> on launch/update, even when the version string is unchanged. This quietly reverts any third-party binary patches (e.g. tweakcc) without any observable signal — same filename, same version, zero patches.

Error Message

  1. Ran tweakcc --apply against CC 2.1.111 — patches landed (verified via grep for injected RGB values and the tweakcc v4.0.11 marker string).
  2. Restarted Ghostty + launched a fresh CC session.
  3. Theming regressed (themes + user-message-display both gone).
  4. Inspected binary at /Users/jm/.local/share/claude/versions/2.1.111 — file was still there, version was still 2.1.111, but:
    • grep -ac 'tweakcc' <binary>0
    • No spenschsuite theme block, no injected RGB values
    • Default orange rgb(215,119,87) present (shipping default)
  5. Re-running tweakcc --apply against the same version re-patched successfully.

Root Cause

Claude Code appears to silently replace the on-disk binary at ~/.local/share/claude/versions/<version> on launch/update, even when the version string is unchanged. This quietly reverts any third-party binary patches (e.g. tweakcc) without any observable signal — same filename, same version, zero patches.

Fix Action

Workaround

Added a SessionStart hook that greps the live binary for the tweakcc marker string and warns the user if it's missing:

if ! LANG=C grep -aq 'tweakcc' "\$live_binary"; then
  echo "⚠ binary was replaced — run tweakcc --apply"
fi

Code Example

if ! LANG=C grep -aq 'tweakcc' "\$live_binary"; then
  echo "⚠ binary was replaced — run tweakcc --apply"
fi
RAW_BUFFERClick to expand / collapse

Summary

Claude Code appears to silently replace the on-disk binary at ~/.local/share/claude/versions/<version> on launch/update, even when the version string is unchanged. This quietly reverts any third-party binary patches (e.g. tweakcc) without any observable signal — same filename, same version, zero patches.

Observed behavior

  1. Ran tweakcc --apply against CC 2.1.111 — patches landed (verified via grep for injected RGB values and the tweakcc v4.0.11 marker string).
  2. Restarted Ghostty + launched a fresh CC session.
  3. Theming regressed (themes + user-message-display both gone).
  4. Inspected binary at /Users/jm/.local/share/claude/versions/2.1.111 — file was still there, version was still 2.1.111, but:
    • grep -ac 'tweakcc' <binary>0
    • No spenschsuite theme block, no injected RGB values
    • Default orange rgb(215,119,87) present (shipping default)
  5. Re-running tweakcc --apply against the same version re-patched successfully.

So the binary at 2.1.111 was replaced by a different binary also reporting 2.1.111.

Impact

  • Tools patching the CC binary (tweakcc and similar) can be reverted without any observable change to the version symlink or CC CLI --version output.
  • A drift-detection hook that only compares version strings cannot catch this. Only a content check (e.g. grepping for an injected marker) works.
  • Users experience silent UI regressions after Ghostty/terminal restarts or system sleep — no upgrade prompt, no changelog, no signal.

Suggested remediation

Either:

  1. Don't silently replace same-version binaries on disk. If versions/2.1.111 already exists and matches its expected checksum, leave it alone.
  2. If replacement is intentional (e.g. hotfix at same version), bump the patch or build ID so the symlink target changes, allowing drift-detection hooks and patchers to notice.
  3. Expose a "frozen binary" flag (env var or settings.json) that disables on-launch binary replacement for users who patch their local install.

Environment

  • macOS (Darwin 25.4.0, arm64)
  • Claude Code 2.1.111 installed at ~/.local/share/claude/versions/2.1.111 (Mach-O binary, ~200MB)
  • tweakcc v4.0.11
  • Observed 2026-04-22 → 2026-04-23

Workaround

Added a SessionStart hook that greps the live binary for the tweakcc marker string and warns the user if it's missing:

if ! LANG=C grep -aq 'tweakcc' "\$live_binary"; then
  echo "⚠ binary was replaced — run tweakcc --apply"
fi

extent analysis

TL;DR

To prevent silent replacement of patched binaries, consider implementing a checksum check or version bump to detect changes.

Guidance

  • Verify the existence and integrity of the patched binary by checking its checksum or contents before and after launching Claude Code.
  • Implement a drift-detection hook that checks for the presence of the tweakcc marker string or other injected patches.
  • Consider setting an environment variable or flag to disable on-launch binary replacement for patched installations.
  • If replacement is intentional, bump the patch or build ID to update the symlink target and trigger detection hooks.

Example

The provided SessionStart hook script can be used as a starting point to detect and warn about binary replacement:

if ! LANG=C grep -aq 'tweakcc' "$live_binary"; then
  echo "⚠ binary was replaced — run tweakcc --apply"
fi

Notes

The suggested remediation steps require modifications to Claude Code's update mechanism, which may not be feasible without access to the codebase. The provided workaround can help mitigate the issue but may not be a permanent solution.

Recommendation

Apply the workaround by implementing a drift-detection hook, such as the provided SessionStart script, to detect and warn about binary replacement. This will allow users to take corrective action and re-apply patches as needed.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING