Created
February 23, 2026 13:18
-
-
Save pmatos/b3f9a593b6b734e693f3886853826b58 to your computer and use it in GitHub Desktop.
ARM64 patch to enable worktrees in cc 2.1.50
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| EXPECTED_SHA="4e2b23dbf2f97918d5edc95ae1de03d230a66b94d5fa31a57cc673742ec6ae22" | |
| PATCHED_SHA="fcf070c6e28f5649578f5359b4d3d9dce27eaf6768bb3e0300072f0b13b11169" | |
| TARGET="${1:-$(readlink -f "$(which claude)")}" | |
| if [[ ! -f "$TARGET" ]]; then | |
| echo "Error: file not found: $TARGET" >&2 | |
| exit 1 | |
| fi | |
| ACTUAL_SHA=$(sha256sum "$TARGET" | awk '{print $1}') | |
| if [[ "$ACTUAL_SHA" == "$PATCHED_SHA" ]]; then | |
| echo "Already patched: $TARGET" | |
| exit 0 | |
| fi | |
| if [[ "$ACTUAL_SHA" != "$EXPECTED_SHA" ]]; then | |
| echo "Error: SHA256 mismatch for $TARGET" >&2 | |
| echo " Expected: $EXPECTED_SHA" >&2 | |
| echo " Got: $ACTUAL_SHA" >&2 | |
| echo "This script only patches Claude Code v2.1.50 arm64 (unpatched)." >&2 | |
| exit 1 | |
| fi | |
| cp "$TARGET" "$TARGET.bak" | |
| sed -i 's/tengu_worktree_mode",!1/tengu_worktree_mode",!0/g' "$TARGET" | |
| NEW_SHA=$(sha256sum "$TARGET" | awk '{print $1}') | |
| if [[ "$NEW_SHA" != "$PATCHED_SHA" ]]; then | |
| echo "Error: unexpected SHA after patching, restoring backup" >&2 | |
| mv "$TARGET.bak" "$TARGET" | |
| exit 1 | |
| fi | |
| echo "Patched: $TARGET" | |
| echo "Backup: $TARGET.bak" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment