Skip to content

Delete the entry-module shim once tweakcc 4.3.3 is pinned — but re-home the fail-closed Mach-O signing check first #129

Description

@bman654

Once the tweakcc pin reaches 4.3.3, tweakcc recognizes /cli and can find Claude Code's bundle
without clodex renaming anything. That deletes src/bun-entry-module.ts and every consumer of it —
and with them the stand-in, the restore sweep, the pre-shim guard, and the known limitation recorded
in .claude/docs/patcher.md (a local patch emitting the stand-in before a NUL is still rewritten),
which this closes by construction rather than by fixing.

findStandIn, restoreEveryStandIn and isModuleNameAt have no consumers outside the module;
entryModuleShimName and tweakccRecognizesModuleName already have none. The external surface is
only inspectEntryModule, shimEntryModuleName and restoreEntryModuleName, called from
src/patcher.ts (~lines 649 and 808) and scripts/extract-cc-bundles.mjs.

Do not delete this without replacing it first

restoreEntryModuleName(..., { resign: true }) is currently our only fail-closed Mach-O signing
check
, and that is not obvious from reading it. tweakcc 4.3.3 runs codesign -s - -f too, but it
catches a signing failure, warns, and returns success.

Measured with the shim disabled and a fake codesign exiting 42 during a real patch: tweakcc warned,
clodex patch reported 11 applied, 0 failed and exited 0, and the published binary was "code
object is not signed at all" — codesign --verify exited 1 and launching it was killed (exit 137).

So deleting the shim as-is would trade a narrow, opt-in-only silent rewrite for a silent
unrunnable binary on every Mac. A fatal post-write signing/verification step, independent of the
shim, has to land in the same change.

Also in scope

  • Add /cli and cli to any remaining mirrored recognizer, or remove the mirror with the module.
  • Clean up scripts/extract-cc-bundles.mjs (shim import, scratch-copy branch).
  • Losing inspectEntryModule also loses the discoverable / needs-shim / unparseable
    diagnostic split; tweakcc's generic extraction error is what remains. Decide whether that is
    acceptable or worth keeping a reduced probe.
  • A future unrecognized entry name has no fallback once the shim is gone — it becomes an upstream
    fix.
  • Update .claude/docs/patcher.md and .claude/docs/claude-code-internals.md.

Notes

  • 4.3.3 was published 2026-08-13, so minimumReleaseAge (10 days) clears it on 2026-08-23.
  • 4.3.3 does not remove the ELF relocation: linux builds still leave an orphan module table and
    still grow, though less (linux-x64 2.1.233: 770 MB under 4.3.0 vs 560 MB under 4.3.3, from a
    325 MB pristine). That behaviour predates the shim — 2.1.228, which needs no shim at all, grows
    identically — and is unaffected by any of this.
  • With 4.3.3 installed but the shim still in place, all five platforms tested still patch and run.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions