tweakcc-fixed 1.0.5 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Piebald LLC
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Piebald LLC
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,95 +1,124 @@
1
- # tweakcc-fixed
2
-
3
- A **temporary fork of [tweakcc](https://github.com/Piebald-AI/tweakcc)** that bundles together several pending upstream fixes, with a few additional fixes on top, so `tweakcc` works cleanly against recent Claude Code releases (through **CC 2.1.128**) while upstream catches up.
4
-
5
- > [!NOTE]
6
- > This fork exists only to unblock users while the fixes below are reviewed and merged upstream. Once the relevant PRs land in [Piebald-AI/tweakcc](https://github.com/Piebald-AI/tweakcc), switch back to upstream.
7
-
8
- For full documentation of what tweakcc is and how to use it, see the [**upstream README**](https://github.com/Piebald-AI/tweakcc#readme).
9
-
10
- ## Base
11
-
12
- - **Upstream tweakcc version:** `4.0.11`
13
- - **Based on upstream commit:** [`2e1d03e`](https://github.com/Piebald-AI/tweakcc/commit/2e1d03e)_Prompts for 2.1.113_ ([#692](https://github.com/Piebald-AI/tweakcc/pull/692))
14
- - **Target Claude Code versions:** up to and including **2.1.128**
15
- - **This package's version:** starts at `1.0.x` on first publish, with its own semver independent of upstream
16
-
17
- ## Cherry-picked upstream PRs
18
-
19
- All four PRs below are open (unmerged) upstream at the time of forking. Their fixes are required for tweakcc to function on current CC builds.
20
-
21
- | PR | Author | What it fixes |
22
- | ------------------------------------------------------ | ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
23
- | [#601](https://github.com/Piebald-AI/tweakcc/pull/601) | [@signadou](https://github.com/signadou) | Handle `WASMagic` import errors gracefully during native installation detection |
24
- | [#646](https://github.com/Piebald-AI/tweakcc/pull/646) | [@sla-te](https://github.com/sla-te) | Support the React Compiler output and async refactoring introduced in CC 2.1.85–2.1.88 (affects most patches) |
25
- | [#655](https://github.com/Piebald-AI/tweakcc/pull/655) | [@LeonFedotov](https://github.com/LeonFedotov) | Fall back to npm source when Bun bytecode extraction produces non-patchable JS, and thread a `clearBytecode` flag through the content API so repack clears stale compiled code |
26
- | [#664](https://github.com/Piebald-AI/tweakcc/pull/664) | [@mike1858](https://github.com/mike1858) | Resolves [issue #660](https://github.com/Piebald-AI/tweakcc/issues/660) — two patches broke `cli.js` due to literal `\"` sequences in prompt content |
27
-
28
- ## Additional fixes on top
29
-
30
- These are not in any upstream PR and are unique to this fork.
31
-
32
- - **[`bcce70a`](https://github.com/BenIsLegit/tweakcc-fixed/commit/bcce70a) — Scope [PR #664](https://github.com/Piebald-AI/tweakcc/pull/664)'s backslash-doubling to quote contexts.**
33
- [PR #664](https://github.com/Piebald-AI/tweakcc/pull/664)'s pre-processing ran before every delimiter branch including backticks. In template-literal content, `escapeDepthZeroBackticks` is already parity-aware, so pre-doubling backslashes inside a template prematurely terminated the template and caused `cli.js` to fail to load with _"Expected CommonJS module to have a function wrapper"_. This fix scopes the doubling to double-quoted and single-quoted strings only. Affects [issue #660](https://github.com/Piebald-AI/tweakcc/issues/660).
34
-
35
- - **[`207b57c`](https://github.com/BenIsLegit/tweakcc-fixed/commit/207b57c) Align [PR #664](https://github.com/Piebald-AI/tweakcc/pull/664)'s backtick tests with the scoped-doubling fix.**
36
- The two backtick-context tests encoded a _literal-text_ interpretation of prompt content, which doesn't match tweakcc's storage format (markdown files hold the JS-source-escaped form extracted from `cli.js` template literals). Tests now assert the scoped behavior.
37
-
38
- - **[`3c08e0c`](https://github.com/BenIsLegit/tweakcc-fixed/commit/3c08e0c) — Adapt patch regexes to CC 2.1.113's minified shapes.**
39
- Updates matchers in `opusplan1m`, `patchesAppliedIndication`, `thinkerFormat`, and `verboseProperty` so each patch still locates its target in the 2.1.113 build output.
40
-
41
- - **[`c87898c`](https://github.com/BenIsLegit/tweakcc-fixed/commit/c87898c) Don't overwrite `verbose:X` inside destructuring patterns.**
42
- The `verboseProperty` patch was greedy enough to match `{ verbose: localName }` in destructure targets and replace it with `verbose: true`, which is a syntax error. The fix scopes the replacement to property-value positions only.
43
-
44
- - **[`dc84a6c`](https://github.com/BenIsLegit/tweakcc-fixed/commit/dc84a6c) — Preserve CC's theme background and default padding in the `userMessageDisplay` patch.**
45
- Stock CC 2.1.79+ sets `backgroundColor: "userMessageBackground"` and `paddingRight: 1` on the user-message Box; the replacement Box dropped both, stripping the theme-provided message background and the trailing column of bg that hugs the text. `backgroundColor: "default"` now re-emits the theme token, `paddingX`/`paddingY` accept `'default'` (emitting `paddingRight: 1` to match CC's native look), and the UI gains Default/Custom radios for each padding axis. Default settings flip to `'default'` so ctrl+R and fresh installs match CC's out-of-box appearance.
46
-
47
- - **[`89555eb`](https://github.com/BenIsLegit/tweakcc-fixed/commit/89555eb) Make ctrl+R honor the new default fg/bg modes.**
48
- `restoreToOriginal` was hardcoding `'none'`/`'default'` for the bg/fg modes, which stopped lining up after the default settings shifted in `dc84a6c`. The mode is now derived from `DEFAULT_SETTINGS` so restore actually matches what new installs get.
49
-
50
- - **[`3114c5b`](https://github.com/BenIsLegit/tweakcc-fixed/commit/3114c5b) — Forward theme fg/bg tokens to the replacement `Text` so "default" colors survive wrapping.**
51
- When fg/bg is `'default'` the chalk chain emits no color codes, so the inner `Text` fell back to the terminal's default fg — and on narrow/wrapped user messages whole cells rendered without the theme color (matching the report that "default" bg/fg worked on slash commands but not regular messages). The patch now also forwards `color: "text"` and `backgroundColor: "userMessageBackground"` onto the replacement `Text` so the theme colors reach the cells chalk can't paint.
52
-
53
- - **[`1e28b59`](https://github.com/BenIsLegit/tweakcc-fixed/commit/1e28b59) Match the shrunken past-tense thinking-verb array in recent CC builds.**
54
- Apply-time failed with `patch: thinkingVerbs: failed to find past tense verbs pattern`. The past-tense regex required `{50,}` capitalised entries — which matched the pre-2.x ~170-entry list but not the 8-entry `-ed` cooking array CC now ships (observed across 2.1.70–2.1.113): `["Baked","Brewed","Churned","Cogitated","Cooked","Crunched","Sautéed","Worked"]`. The fix anchors each entry on an `ed` suffix and drops the minimum to `{6,}`, which keeps us from colliding with the far-larger present-tense `-ing` array (handled by the earlier pass) or the user's substituted `-ing` verbs. 2.1.113 is a bun-compiled native binary that encodes `"Sautéed"` as the literal escape `"Saut\xE9ed"` rather than raw UTF-8; the existing character class already covers backslash/x/hex-digit/é, so both serialisation forms match without a code change — verified against all four cli.js shapes.
55
-
56
- - **[`cc12f96`](https://github.com/BenIsLegit/tweakcc-fixed/commit/cc12f96) — Flatten the `{head, hiddenLines, tail}` text prop so long pastes in the user message display don't render as `[object Object]`.**
57
- CC 2.1.79+ hoisted the long-message collapse from the inner `EjK`-style subcomponent into the caller via `useMemo` — when the original text exceeds ~10,000 chars (typical for pasted blocks) the `text` prop becomes `{head:string, hiddenLines:number, tail:string}` instead of a string. The patch captured that prop as `messageVar` and interpolated it with `` `${$}` `` in a template literal, which stringifies an object to `"[object Object]"` and wiped out the entire user message display for any long paste. The fix replaces the naive interpolation with a runtime ternary that detects the object variant and flattens it to `head + "(N line[s] hidden)" + tail`, mirroring CC's native collapse output; strings, `null`, and `undefined` all pass through unchanged. A small but important secondary fix: the emitted expression contains a `$&&` sequence, and `String.prototype.replace` treats `$&` in a _string_ replacement as the matched substring, which would corrupt the output — using a function replacer bypasses `$`-substitution entirely.
58
-
59
- - **[`c66f604`](https://github.com/BenIsLegit/tweakcc-fixed/commit/c66f604) Paint wrapped user-message lines with the configured bg.**
60
- Reported: with custom User Message Display settings, a message long enough to wrap in the terminal had its highlight only on line 1 — line 2+ rendered against the terminal default bg. Two bugs collided: (1) `boxAttrsObjStr` was finalized right after the padding/border block, _before_ the fg/bg block ran, so every `boxAttrs.push('backgroundColor:...')` was silently discarded (this also broke the default-theme bg added in `3114c5b`, leaving the Box without its `userMessageBackground` token). (2) For a custom `rgb(r,g,b)` the patch only added `.bgRgb()` to the chalk chain — those ANSI bg escapes live inside the text content, and when Ink word-wraps the message the escape on line 1 doesn't reliably re-open on line 2. Fix: finalize `boxAttrsObjStr` _after_ the bg block, and for custom bg also push `backgroundColor:"rgb(r,g,b)"` onto both Box and Text so Ink paints the full padded width across every wrapped line.
61
-
62
- - **[`9ef9328`](https://github.com/BenIsLegit/tweakcc-fixed/commit/9ef9328) Rewrite the CC ≥2.1.79 `userMessageDisplay` path as attribute-preserving surgery (finally fixes wrapped-line bg).**
63
- Even after `c66f604`, line 2+ of a wrapped message STILL rendered without the configured bg. Root cause was structural, not an ordering bug: the patch was replacing CC's entire outer Box+subcomponent tree with its own, dropping every layout attribute CC sets on that Box — most importantly `flexDirection:"column"`. Without it, the Box defaults to row layout and no longer inherits full parent width from CC's row-flex message-list parent, so Ink only paints the Box bg to the content width of line 1. The redesign tries the modern pattern first (the legacy pattern's `{text:VAR}` alternative ALSO matched 2.1.79+ shapes, so the legacy path was silently handling new-CC cases), captures the Box attrs dict as a regex group, and only _mutates_ what the user is customizing: custom `rgb(r,g,b)` replaces CC's bg ternary with a static literal; `null` strips the bg attr; `'default'` leaves CC's ternary intact (so message-actions-mode switching still works); border/padding/`alignSelf` overrides append onto the CSV. The inner `EjK` call is replaced with `createElement(Text, {color, backgroundColor, bold:!0, italic:!0, ...}, template)` using Ink's native Text props instead of chalk ANSI — Ink's layout pass paints bg and re-opens style codes on every wrapped line, which chalk-in-string doesn't reliably do. The legacy (CC ≤2.1.21) path keeps its prior chalk-chain behavior since those versions never had the wrap bug. Object-variant flattening from `cc12f96` moves into a shared helper with the tightened `typeof x==="object"&&x!==null` guard (handles `""`/`0` cleanly). Verified against CC 2.1.112's cli.js: the replacement preserves `flexDirection:"column"`, `marginTop:q?1:0`, and `paddingRight:w?0:1` verbatim; an end-to-end Ink render test confirms every wrapped line now has the bg ANSI re-opened at its start across padding spaces. Supersedes `c66f604`'s Ink-level bg push on both Box and Text (now handled via the preserved/mutated attrs instead).
64
-
65
- - **[`f64268a`](https://github.com/BenIsLegit/tweakcc-fixed/commit/f64268a) — Restore four broken patches on CC 2.1.128 (Patches applied indication, Thinker format, Session memory, User message display).**
66
- Four patches stopped applying on CC 2.1.128. Root causes were two helper-function regressions plus two pattern-shape changes — the bundle prologue, Box component, spinner signature, and session-memory feature all shifted in 2.1.128's build. **`getModuleLoaderFunction`** only matched the old ternary `H=H!=null?…:…` form; 2.1.128 emits `var K=H!=null&&typeof H==="object"` instead, so the regex now accepts an optional `var |let ` prefix and either `?` or `&&` after `!=null`, and the prologue slice grew 2000→5000 chars. **`findBoxComponent`** gains a Method 5 matching the new exhaustive destructured signature (`children`/`ref`/`tabIndex`/`autoFocus` together) — the older memo, displayName, and ink-box-localvar shapes are gone. Both helpers gate `patchesAppliedIndication` and `userMessageDisplay`, so fixing them unblocks both. **`thinkerFormat`'s** `approxAreaPatternNew` now allows any number of intervening `key:val,` pairs between `overrideMessage:` and `spinnerSuffix:` (2.1.128 inserted `isCompacting` and `compactingHintText` between them, breaking the 2.1.113-era adjacency anchor). **`sessionMemory`** is rewritten as graceful degradation because 2.1.128 dropped the `tengu_session_memory` flag, the `# Session Title` config block (per-section/total token limits), and the `minimumMessageTokensToInit`/`minimumTokensBetweenUpdate`/`toolCallsBetweenUpdates` knobs entirely only `tengu_coral_fern` (past-session search) remains. Each sub-patch now no-ops on missing patterns instead of failing the whole combined patch, so the patch reports green on 2.1.128 with just the past-sessions bypass active. Three now-graceful skip messages downgraded console.error→console.log with a clear "(skipping; expected on CC ≥2.1.128)" note. Also downgrades `patchesAppliedIndication`'s "header component function not found" log similarly — that's been a graceful PATCH 3 skip on every CC ≥2.1.86 release, not an error. Verified end-to-end: 228/228 unit tests pass; `--apply` against the real 2.1.128 native binary reports ✓ for all four previously-failing patches; the patched cli.js was inspected directly and contains all expected insertions (`\n4.0.11 (tweakcc)` after both `(Claude Code)` version-output occurrences, the `+ tweakcc v4.0.11` strings in all three banner contexts, and the React-compiler `_tw=` createElement variable).
67
-
68
- ## Installation
69
-
70
- Published to npm as [`tweakcc-fixed`](https://www.npmjs.com/package/tweakcc-fixed). Run without installation:
71
-
72
- ```bash
73
- npx tweakcc-fixed@latest # interactive UI
74
- npx tweakcc-fixed@latest --apply # apply customizations from ~/.tweakcc/config.json
75
- ```
76
-
77
- > [!TIP]
78
- > **Always use `@latest`.** This fork is actively iterating on fixes as new Claude Code versions ship and as more upstream fixes are cherry-picked. Without `@latest`, `npx` will reuse a cached copy from its last run and you may miss newly-published fixes. `@latest` forces a fresh resolve against the npm registry.
79
-
80
- Or install globally (re-run to upgrade):
81
-
82
- ```bash
83
- npm install -g tweakcc-fixed@latest
84
- # or: pnpm add -g tweakcc-fixed@latest
85
-
86
- tweakcc-fixed # interactive UI
87
- tweakcc-fixed --apply # apply customizations
88
- ```
89
-
90
- > [!NOTE]
91
- > The binary is named `tweakcc-fixed` (not `tweakcc`) to avoid conflicting with an upstream `tweakcc` install. Everything else — flags, config format, API, patch list — is identical to upstream. See the [upstream README](https://github.com/Piebald-AI/tweakcc#readme) for full documentation.
92
-
93
- ## License
94
-
95
- [MIT](./LICENSE), inherited from upstream. Copyright © 2026 [Piebald LLC](https://piebald.ai). This fork adds only the fixes described above; all core tweakcc code remains under the upstream copyright and license.
1
+ # tweakcc-fixed (skrabe fork)
2
+
3
+ A hard fork of [Piebald-AI/tweakcc](https://github.com/Piebald-AI/tweakcc) that patches an installed Claude Code in place — both npm `cli.js` and the JavaScript embedded in a native Bun binary to apply **curated system-prompt overrides** and a set of **fork-only patches**. It is purpose-built to pair with [skrabe/lobotomized-claude-code](https://github.com/skrabe/lobotomized-claude-code), and it stays current with every Claude Code release through its own prompt-extraction pipeline.
4
+
5
+ > [!IMPORTANT]
6
+ > **This fork is a superset of upstream and no longer merges from it (2026-06-04).** Upstream's `tweakcc` gates system-prompt overrides **off** for native installs and doesn't have this fork's override mechanisms (inline-blob, system-reminders) or extended extractor; we add those and apply system prompts to native installs too. Upstream is essentially static recent releases are version bumps plus prompt-data drops we supersede (our extractor names 394 prompts for CC 2.1.173; Piebald's latest (2.1.170) extract has 346) — so there's nothing to gain by merging. We keep the `upstream` remote only as a **fetch-only comparison signal** and extract our own prompts.
7
+
8
+ | | |
9
+ | ---------------------- | --------------------------------------------------------------------------------------------------------- |
10
+ | **This fork** | [skrabe/tweakcc-fixed](https://github.com/skrabe/tweakcc-fixed) |
11
+ | **Base** | [Piebald-AI/tweakcc](https://github.com/Piebald-AI/tweakcc) @ `bc41a43`, then diverged |
12
+ | **Target CC versions** | 2.0.98 through **2.1.173** |
13
+ | **Install** | `npx tweakcc-fixed@latest` — published on npm from this repo ([Install](#install)) |
14
+ | **Pairs with** | [skrabe/lobotomized-claude-code](https://github.com/skrabe/lobotomized-claude-code) (per-model overrides) |
15
+ | **Agent guide** | [`AGENTS.md`](./AGENTS.md) bug-class diagnostics, patch authoring, the version-bump pipeline |
16
+
17
+ ## What this fork adds over the base
18
+
19
+ These mechanisms extend what's reachable for system-prompt customization ("lobotomization") beyond the base's named-prompt overrides. They don't exist upstream.
20
+
21
+ ### System-reminder override mechanism
22
+
23
+ A directory `~/.tweakcc/system-reminders/` with one `.md` file per editable dynamic injection. This targets the per-turn / event-driven `<system-reminder>` wrappers that never appear as named prompts in `prompts-X.Y.Z.json` and therefore bypass the named-prompt pipeline.
24
+
25
+ - **Empty body** injection suppressed.
26
+ - **Custom body** pristine content replaced.
27
+ - **`{{placeholder}}` tokens** → whitelisted JS expressions substituted at apply time.
28
+
29
+ Files are seeded automatically on first `--apply`. The registry (~30 entries) covers the claudeMd context wrapper, the anti-thinking nudge, MCP per-server overrides, token/budget telemetry, plan-mode reminders, hook/tool-call wrappers, the task-list reminder, the ultrathink booster, the user-sent-new-message wrap, the stop-hook session-goal, and more. UI: `tweakcc` → **System reminders (injection lobotomy)**.
30
+
31
+ ### MCP per-server instruction routing
32
+
33
+ Auto-generates `~/.tweakcc/system-reminders/mcp-<server-name>.md` for each connected MCP server (from `~/.claude.json` `mcpServers`) and patches `cli.js` so MCP-instruction assembly consults those files at runtime empty body drops the server's block from the model's context, custom body replaces it, and `{{server_instructions}}` resolves to the server's pristine instructions.
34
+
35
+ ### `string` kind in inline-blob overrides
36
+
37
+ Extends the inline-blob mechanism to double-quoted JS string literals (previously array/template only), reaching blobs like `function xu3(){return"Users may configure 'hooks'..."}` that the base couldn't override.
38
+
39
+ ### Skills view
40
+
41
+ A UI surface for managing `~/.claude/settings.json` `skillOverrides` — per-skill cycle through `on / name-only / user-invocable-only / off`. Writes `settings.json` natively (CC honors it immediately; no patch required).
42
+
43
+ ### Strip empty system-reminders (always applied)
44
+
45
+ Short-circuits CC's universal reminder wrapper so empty / `"(no content)"` text produces no `<system-reminder>` block, killing the drift-inducing `<system-reminder>(no content)</system-reminder>` appended after empty tool outputs. Cache-control-safe (returns the unwrapped placeholder, not an empty text block, so prompt-cached message blocks aren't rejected).
46
+
47
+ ### claudeMd context once-per-conversation
48
+
49
+ Patches the claudeMd wrapper so the `claudeMd` / `userEmail` / `currentDate` system-reminder injects only on the first API call per conversation (re-firing after `/clear`), instead of CC's default of re-prepending it every call.
50
+
51
+ ### `maxEffortDefault`
52
+
53
+ A Misc-Configurable toggle that defaults Opus to `"max"` reasoning effort instead of `"xhigh"`. Override at runtime with `/effort` or `CLAUDE_CODE_EFFORT_LEVEL`.
54
+
55
+ ## Fixes carried in this fork
56
+
57
+ Beyond the fork-only features above, this fork carries correctness fixes that originated in open upstream PRs and in BenIsLegit's now-unmaintained `tweakcc-fixed`, plus fork-only patch work. They are now simply part of this fork (we don't merge upstream, so nothing here is "pending"). Credit:
58
+
59
+ | Source | Author | Fix |
60
+ | ------------------------------------------------------ | ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
61
+ | [#601](https://github.com/Piebald-AI/tweakcc/pull/601) | [@signadou](https://github.com/signadou) | Handle `WASMagic` import errors gracefully during native-installation detection |
62
+ | [#646](https://github.com/Piebald-AI/tweakcc/pull/646) | [@sla-te](https://github.com/sla-te) | Support React Compiler output / async refactoring introduced in CC 2.1.85–2.1.88 |
63
+ | [#655](https://github.com/Piebald-AI/tweakcc/pull/655) | [@LeonFedotov](https://github.com/LeonFedotov) | Fall back to npm source when Bun-bytecode extraction yields non-patchable JS; thread `clearBytecode` through repack |
64
+ | [#664](https://github.com/Piebald-AI/tweakcc/pull/664) | [@mike1858](https://github.com/mike1858) | Fix two patches that broke `cli.js` on literal `\"` sequences in prompt content (#660) |
65
+
66
+ Fork-only patch work: scoping #664's backslash-doubling to quote contexts only (template literals already get a parity-aware backtick pass); adapting `opusplan1m` / `patchesAppliedIndication` / `thinkerFormat` / `verboseProperty` / `userMessageDisplay` matchers across successive CC minified shapes; the past-tense thinking-verb array fix; the `migration.test.ts` `vi.mock` fix; and TS7 build + Linux native-binary patching. See [`AGENTS.md`](./AGENTS.md) for the full rundown and how to extend the fork.
67
+
68
+ ## Inherited base features
69
+
70
+ These come from the tweakcc base and work unchanged in this fork: system-prompt customization, custom themes, thinking-verb and spinner customization, toolsets (`/toolset`), input-pattern highlighters, `opusplan[1m]`, MCP startup optimization, table-format options, token-count rounding, statusline throttling, `AGENTS.md`/`CLAUDE.md` alternate names, session naming (`/title`, `/rename`), subagent model selection, and the `unpack` / `repack` CLI commands.
71
+
72
+ For detailed docs on these shared features, see the [upstream tweakcc README](https://github.com/Piebald-AI/tweakcc#readme) — with the caveat that upstream is now v4 and has diverged, so its API / `adhoc-patch` / remote-config sections and native-install behavior describe upstream's build, not this fork.
73
+
74
+ ## Pairing with lobotomized-claude-code
75
+
76
+ Use this fork's extraction surface with [skrabe/lobotomized-claude-code](https://github.com/skrabe/lobotomized-claude-code) — per-model override sets (**Claude Fable 5**, Claude Opus 4.8) tuned against this fork's extraction. Our named-prompt JSON catches prompts Piebald's published extract doesn't (394 named for CC 2.1.173 vs their 346 for 2.1.170), and the system-reminder + `string`-kind reach lets the overrides cover content the base mechanisms can't.
77
+
78
+ ## Install
79
+
80
+ Published on npm as [`tweakcc-fixed`](https://www.npmjs.com/package/tweakcc-fixed) this repo is the package's source (v2.0.0+):
81
+
82
+ ```bash
83
+ npx tweakcc-fixed@latest # interactive UI
84
+ npx tweakcc-fixed@latest --apply # apply customizations from ~/.tweakcc/config.json
85
+ ```
86
+
87
+ After a Claude Code update overwrites the patches, just re-run `--apply`. Prompt
88
+ data (`prompts-X.Y.Z.json`) is fetched at runtime from this repo's `main` branch,
89
+ so new CC versions are supported as soon as this repo's version-bump pipeline
90
+ lands — no package update needed for prompt data alone.
91
+
92
+ > [!NOTE]
93
+ > Package versions **≤ 1.0.5** were published from BenIsLegit's earlier,
94
+ > now-unmaintained fork; **2.0.0+** is published from this repo and supersedes
95
+ > them. (`npx tweakcc` is upstream Piebald, which doesn't apply system-prompt
96
+ > overrides to native installs.)
97
+
98
+ **From source** (contributing, or running unpublished work-in-progress):
99
+
100
+ ```bash
101
+ git clone https://github.com/skrabe/tweakcc-fixed ~/dev/tweakcc-fixed
102
+ cd ~/dev/tweakcc-fixed && pnpm install && pnpm build
103
+ node dist/index.mjs --apply
104
+ ```
105
+
106
+ ## How it works
107
+
108
+ tweakcc-fixed patches Claude Code's minified `cli.js`, reading customizations from `~/.tweakcc/config.json`. For npm installs `cli.js` is patched directly; for native installs the JS is extracted from the Bun binary with [node-lief](https://github.com/Piebald-AI/node-lief), patched, and repacked (with stale Bun bytecode cleared). Updating Claude Code overwrites the patches, but they live in your config, so reapply with `--apply`. Revert with `--restore`.
109
+
110
+ ## The `showtime` skill (CC version-bump pipeline)
111
+
112
+ When Claude Code ships a new version, [`skills/showtime/`](./skills/showtime/) is a [Claude Code skill](https://docs.claude.com/en/docs/claude-code/skills) that drives the whole bump end-to-end on your local machine — extract the new `cli.js`, run the prompt extractor, drive the version-bump report to zero, realign drifted overrides, and prove it landed clean against a **four-zeros** bar (smoke + apply-hygiene + no-orphan-overrides + no-latent-var-breakage). It ships three files:
113
+
114
+ | File | Role |
115
+ | -------------- | ---------------------------------------------------------------------------------------------------------------------- |
116
+ | `SKILL.md` | the runbook — the phases, the gates, when to ask vs act |
117
+ | `REFERENCE.md` | the self-contained "why" — the bug-class catalog, the quote-context rule, the realignment recipe, the gotchas |
118
+ | `driver.mjs` | the mechanical harness — `versions` / `extract` / `report` / `check` (resolves the repo itself; honors `TWEAKCC_REPO`) |
119
+
120
+ **Install:** copy `skills/showtime/` into your skills dir — `cp -R skills/showtime ~/.claude/skills/` (global) or `.claude/skills/` in a project — then say _"it's showtime"_ when a new CC version drops, or run the driver directly: `node ~/.claude/skills/showtime/driver.mjs check`. Pair it with an overrides repo ([lobotomized-claude-code](https://github.com/skrabe/lobotomized-claude-code) by default) as described above.
121
+
122
+ ## License
123
+
124
+ [MIT](https://github.com/Piebald-AI/tweakcc/blob/main/LICENSE). Fork of [Piebald-AI/tweakcc](https://github.com/Piebald-AI/tweakcc); upstream © [Piebald LLC](https://piebald.ai).