Skip to content

Repack on CC 2.1.245 native (Linux x64) bloats binary 392MB → 694MB with duplicated chunks, no config applied #979

Description

@aegntic

Environment

  • Version: tweakcc 4.3.3
  • Operating System: Linux x64 (Arch, kernel 7.1.8)
  • Node.js version: v26.7.0
  • Claude Code: 2.1.245 native install (~/.local/share/mise/installs/claude/2.1.245/claude, 391,948,592 bytes)

Steps to reproduce

  1. Install CC 2.1.245 native + tweakcc 4.3.3 with any non-trivial config (custom theme, thinking verbs, spinner)
  2. tweakcc --apply -y
  3. On stock 4.3.3 the run stops at the parse gate with Cannot use import statement outside a module (fixed by Fix parse gate rejecting ESM native bundles (CC 2.1.245+) #978 — the entry chunk of this build is ESM, not @bun-cjs). With the gate fixed (I patched dist/config-*.mjs per Fix parse gate rejecting ESM native bundles (CC 2.1.245+) #978), apply proceeds and reports patch results, then repacks.
  4. Compare the repacked binary against ~/.tweakcc/native-binary.backup.

Actual behavior

The repacked binary is 694,614,320 bytes (+302 MB, +77%) with clear signs of duplicated embedded content, while carrying zero of the applied config:

$ ls -la ~/.local/share/mise/installs/claude/2.1.245/claude
-rwxr-xr-x 694,614,320  claude     # after --apply
$ ls -la ~/.tweakcc/native-binary.backup
-rwxr-xr-x 391,948,592  native-binary.backup

$ cmp ~/.tweakcc/native-claudejs-orig.js ~/.tweakcc/native-claudejs-patched.js && echo identical
identical

$ for m in Accomplishing Boondoggling; do \
    echo "$m: backup=$(grep -ac $m native-binary.backup) current=$(grep -ac $m claude)"; done
Accomplishing: backup=3 current=6
Boondoggling: backup=3 current=6

tweakcc --restore returns the binary to 391,948,592 bytes and baseline string counts, so the backup path is fine — the problem is in repack.

Expected behavior

Repack should replace the embedded entry chunk in place and produce a binary of (approximately) the original size, with no duplication of existing chunk content.

Notes

Happy to run any further diagnostics against the backup/patched pair on request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions