A temporary fork of 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.113) while upstream catches up.
Note
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, switch back to upstream.
For full documentation of what tweakcc is and how to use it, see the upstream README.
- Upstream tweakcc version:
4.0.11 - Based on upstream commit:
2e1d03e— Prompts for 2.1.113 (#692) - Target Claude Code versions: up to and including 2.1.113
- This package's version: starts at
1.0.xon first publish, with its own semver independent of upstream
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.
| PR | Author | What it fixes |
|---|---|---|
| #601 | @signadou | Handle WASMagic import errors gracefully during native installation detection |
| #646 | @sla-te | Support the React Compiler output and async refactoring introduced in CC 2.1.85–2.1.88 (affects most patches) |
| #655 | @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 |
| #664 | @mike1858 | Resolves issue #660 — two patches broke cli.js due to literal \" sequences in prompt content |
These are not in any upstream PR and are unique to this fork.
-
bcce70a— Scope PR #664's backslash-doubling to quote contexts. PR #664's pre-processing ran before every delimiter branch — including backticks. In template-literal content,escapeDepthZeroBackticksis already parity-aware, so pre-doubling backslashes inside a template prematurely terminated the template and causedcli.jsto 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. -
207b57c— Align PR #664's backtick tests with the scoped-doubling fix. 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 fromcli.jstemplate literals). Tests now assert the scoped behavior. -
3c08e0c— Adapt patch regexes to CC 2.1.113's minified shapes. Updates matchers inopusplan1m,patchesAppliedIndication,thinkerFormat, andverbosePropertyso each patch still locates its target in the 2.1.113 build output. -
c87898c— Don't overwriteverbose:Xinside destructuring patterns. TheverbosePropertypatch was greedy enough to match{ verbose: localName }in destructure targets and replace it withverbose: true, which is a syntax error. The fix scopes the replacement to property-value positions only. -
dc84a6c— Preserve CC's theme background and default padding in theuserMessageDisplaypatch. Stock CC 2.1.79+ setsbackgroundColor: "userMessageBackground"andpaddingRight: 1on 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/paddingYaccept'default'(emittingpaddingRight: 1to 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. -
89555eb— Make ctrl+R honor the new default fg/bg modes.restoreToOriginalwas hardcoding'none'/'default'for the bg/fg modes, which stopped lining up after the default settings shifted indc84a6c. The mode is now derived fromDEFAULT_SETTINGSso restore actually matches what new installs get. -
3114c5b— Forward theme fg/bg tokens to the replacementTextso "default" colors survive wrapping. When fg/bg is'default'the chalk chain emits no color codes, so the innerTextfell 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 forwardscolor: "text"andbackgroundColor: "userMessageBackground"onto the replacementTextso the theme colors reach the cells chalk can't paint. -
1e28b59— Match the shrunken past-tense thinking-verb array in recent CC builds. Apply-time failed withpatch: 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-edcooking 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 anedsuffix and drops the minimum to{6,}, which keeps us from colliding with the far-larger present-tense-ingarray (handled by the earlier pass) or the user's substituted-ingverbs. 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. -
cc12f96— Flatten the{head, hiddenLines, tail}text prop so long pastes in the user message display don't render as[object Object]. CC 2.1.79+ hoisted the long-message collapse from the innerEjK-style subcomponent into the caller viauseMemo— when the original text exceeds ~10,000 chars (typical for pasted blocks) thetextprop becomes{head:string, hiddenLines:number, tail:string}instead of a string. The patch captured that prop asmessageVarand 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 tohead + "(N line[s] hidden)" + tail, mirroring CC's native collapse output; strings,null, andundefinedall pass through unchanged. A small but important secondary fix: the emitted expression contains a$&&sequence, andString.prototype.replacetreats$&in a string replacement as the matched substring, which would corrupt the output — using a function replacer bypasses$-substitution entirely. -
c66f604— Paint wrapped user-message lines with the configured bg. 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)boxAttrsObjStrwas finalized right after the padding/border block, before the fg/bg block ran, so everyboxAttrs.push('backgroundColor:...')was silently discarded (this also broke the default-theme bg added in3114c5b, leaving the Box without itsuserMessageBackgroundtoken). (2) For a customrgb(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: finalizeboxAttrsObjStrafter the bg block, and for custom bg also pushbackgroundColor:"rgb(r,g,b)"onto both Box and Text so Ink paints the full padded width across every wrapped line. -
9ef9328— Rewrite the CC ≥2.1.79userMessageDisplaypath as attribute-preserving surgery (finally fixes wrapped-line bg). Even afterc66f604, 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 importantlyflexDirection:"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: customrgb(r,g,b)replaces CC's bg ternary with a static literal;nullstrips the bg attr;'default'leaves CC's ternary intact (so message-actions-mode switching still works); border/padding/alignSelfoverrides append onto the CSV. The innerEjKcall is replaced withcreateElement(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 fromcc12f96moves into a shared helper with the tightenedtypeof x==="object"&&x!==nullguard (handles""/0cleanly). Verified against CC 2.1.112's cli.js: the replacement preservesflexDirection:"column",marginTop:q?1:0, andpaddingRight:w?0:1verbatim; an end-to-end Ink render test confirms every wrapped line now has the bg ANSI re-opened at its start across padding spaces. Supersedesc66f604's Ink-level bg push on both Box and Text (now handled via the preserved/mutated attrs instead).
Published to npm as tweakcc-fixed. Run without installation:
npx tweakcc-fixed@latest # interactive UI
npx tweakcc-fixed@latest --apply # apply customizations from ~/.tweakcc/config.jsonTip
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.
Or install globally (re-run to upgrade):
npm install -g tweakcc-fixed@latest
# or: pnpm add -g tweakcc-fixed@latest
tweakcc-fixed # interactive UI
tweakcc-fixed --apply # apply customizationsNote
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 for full documentation.
MIT, inherited from upstream. Copyright © 2026 Piebald LLC. This fork adds only the fixes described above; all core tweakcc code remains under the upstream copyright and license.