tweakcc-fixed 2.1.0 → 2.1.1

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.
Files changed (2) hide show
  1. package/README.md +87 -116
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,166 +1,137 @@
1
- # tweakcc-fixed (skrabe fork)
1
+ <div align="center">
2
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.
3
+ # tweakcc-fixed
4
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. Our extractor names 1007 prompts for CC 2.1.187 under our own per-model override conventions, capturing every model-facing string below the old 500-char floor — including 572 ids absent from Piebald's published extract. A merge would only bring a version label and prompt data we already supersede, so we keep the `upstream` remote as a **fetch-only comparison signal** and extract our own prompts.
5
+ ### Customize Claude Code far past its settings menu — themes, prompts, thinking, toolsets, and behavior — patched straight into the installed binary.
7
6
 
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.187** |
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** | [`skills/showtime/`](./skills/showtime/) — bug-class diagnostics, patch authoring, the version-bump pipeline |
7
+ [![npm](https://img.shields.io/npm/v/tweakcc-fixed?color=cb3837&label=npm&logo=npm&style=flat-square)](https://www.npmjs.com/package/tweakcc-fixed)
8
+ [![downloads](https://img.shields.io/npm/dt/tweakcc-fixed?color=cb3837&style=flat-square)](https://www.npmjs.com/package/tweakcc-fixed)
9
+ [![Claude Code](https://img.shields.io/badge/Claude%20Code-2.0.98%20%E2%86%92%202.1.190-d97757?style=flat-square)](https://github.com/anthropics/claude-code)
10
+ [![license](https://img.shields.io/badge/license-MIT-blue?style=flat-square)](#credit--license)
16
11
 
17
- ## What this fork adds over the base
12
+ **[Install](#install) · [Customize](#what-you-can-customize) · [The fork](#what-this-fork-adds) · [How it works](#how-it-works)**
18
13
 
19
- These mechanisms extend what's reachable for system-prompt customization ("lobotomization") beyond the base's named-prompt overrides. They don't exist upstream.
14
+ </div>
20
15
 
21
- ### System-reminder override mechanism
16
+ ---
22
17
 
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.
18
+ Claude Code only exposes so much through its settings. tweakcc reaches the rest: it patches the installed binary directly — the `cli.js`, and the JavaScript baked into the native Bun build so you can restyle the interface, rewrite the prompts Claude actually runs on, and change how it behaves. You pick what you want from a terminal UI, apply it in one command, and roll it back whenever you like.
24
19
 
25
- - **Empty body** injection suppressed.
26
- - **Custom body** → pristine content replaced.
27
- - **`{{placeholder}}` tokens** → whitelisted JS expressions substituted at apply time.
20
+ This is **tweakcc-fixed**, a fork of [Piebald's tweakcc](https://github.com/Piebald-AI/tweakcc) that keeps everything the original does and pushes further — roughly twice the prompt coverage, a deeper set of patches, and overrides that reach the native install where upstream stops. More on that [below](#what-this-fork-adds).
28
21
 
29
- Files are seeded automatically on first `--apply`. The registry (35 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)**.
22
+ ```console
23
+ $ npx -y tweakcc-fixed@latest --apply
24
+ ✓ Theme, spinner, thinking verbs, statusline
25
+ ✓ System Prompt: Doing tasks (override) 92 fewer chars
26
+ ✓ Tool Description: Bash (override) 4 fewer chars
27
+ ✓ Toolset + subagent model selection
28
+ … patches applied · backup written
29
+ ```
30
30
 
31
- ### MCP per-server instruction routing
31
+ ## Install
32
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.
33
+ ```bash
34
+ npx -y tweakcc-fixed@latest # interactive TUI — toggle patches, edit prompts
35
+ npx -y tweakcc-fixed@latest --apply # apply everything you've enabled
36
+ npx -y tweakcc-fixed@latest --restore # revert from the backup
37
+ ```
34
38
 
35
- ### `string` kind in inline-blob overrides
39
+ Nothing to clone or build. Prompt data is pulled from this repo at runtime, so a new Claude Code release works the moment its version bump lands here. Updating Claude Code overwrites the patches, so you just re-run `--apply` your configuration in `~/.tweakcc/config.json` is untouched either way.
36
40
 
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.
41
+ > Versions 1.0.5 on npm came from a different, unmaintained fork. 2.0.0 onward is this one.
38
42
 
39
- ### Skills view
43
+ ## What you can customize
40
44
 
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).
45
+ Everything lives behind one terminal UI: toggle a patch, edit a prompt, apply.
42
46
 
43
- ### Strip empty system-reminders (always applied)
47
+ The surface is wide. You can restyle the **look** — themes, the wording of the thinking verbs, the spinner's symbols and speed, the input border, the statusline, table rendering, session titles. You can rewrite the **prompts** — every system prompt, tool description, and `<system-reminder>` is plain markdown you can edit, so you change what Claude is told, not just how it's dressed. You can retune the **tooling** — toolsets, subagent model selection, input-pattern highlighters, file-read limits, MCP startup. And you can adjust **behavior** — reasoning-effort defaults, memory handling, session naming, and a good deal more.
44
48
 
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).
49
+ It works the same on npm and native (Bun-compiled) installs, every change is a toggle, and `--restore` puts the original binary back.
46
50
 
47
- ### claudeMd context once-per-conversation
51
+ ## What this fork adds
48
52
 
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.
53
+ tweakcc-fixed is a strict superset of the original: everything above still applies, on the same latest Claude Code target. What it adds is reach.
50
54
 
51
- ### `maxEffortDefault`
55
+ The biggest difference is coverage. Its extractor pulls roughly twice the prompt surface upstream does — every model-facing string, including the short ones the base skips — which is what makes serious prompt editing possible in the first place.
52
56
 
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`.
57
+ | | tweakcc-fixed | upstream |
58
+ | ---------------------------- | :-----------: | :-------: |
59
+ | Prompt sites (CC 2.1.190) | **1,106** | 527 |
60
+ | Unique prompt IDs | **1,031** | 527 |
61
+ | Patches | **58** | 45 |
62
+ | Overrides on native installs | **yes** | gated off |
54
63
 
55
- ## Fixes carried in this fork
64
+ That reach shows up in a few mechanisms the base doesn't have. The `<system-reminder>` injections that fire per turn — and never surface as named prompts — become editable: blank one out to drop it, or rewrite it. Each connected MCP server's instruction block can be dropped or rewritten the same way. And where upstream gates system-prompt overrides off for native installs, this fork applies them. It pairs with [lobotomized-claude-code](https://github.com/skrabe/lobotomized-claude-code), a set of per-model override packs tuned against exactly this extraction.
56
65
 
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:
66
+ The extra patches cluster around a few themes: **memory** (a dream-mode consolidation pass, leaner memory types), **reasoning** (Opus defaulting to max effort, plus the experimental complexity router), **search** (the experimental fff backend), and a run of **correctness fixes** an honest rewind-summary header, a "summarize from here" that actually starts at the rewind point, quieter empty system-reminders, and more.
58
67
 
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) |
68
+ Two of those are worth calling out, and both ship off by default. **fff-first Bash search** routes Claude's grep, find, and rg through [fff](https://github.com/dmtrKovalenko/fff) and a warm-index daemon, so results come back ranked; it serves a query only when the result is provably identical to the real tool and falls back to the embedded ripgrep/ugrep on anything it can't match exactly, so correctness never rides on it. **The complexity router** reads how hard each task is and routes reasoning effort to match — routine work runs low, the hardest runs max — without switching models or churning the prompt cache, and an explicit `/effort` or `CLAUDE_CODE_EFFORT_LEVEL` always wins.
65
69
 
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 the [`showtime` skill](./skills/showtime/) for the bug-class catalog, realignment recipes, and the version-bump pipeline.
70
+ <details>
71
+ <summary>Every patch the fork adds</summary>
67
72
 
68
- ## Inherited base features
73
+ <br>
69
74
 
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.
75
+ **Memory & context**
71
76
 
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 `adhoc-patch` / remote-config sections and native-install behavior describe upstream's build, not this fork. For this fork's programmatic surface, see [Library API](#library-api) below rather than upstream's API docs.
77
+ - `dream-mode` `/dream` plus automatic memory consolidation
78
+ - `lean-memory-types` — a trimmed memory-type taxonomy
79
+ - `claudemd-context-once-per-conversation` — inject CLAUDE.md and context once per conversation, not every turn
73
80
 
74
- ## Pairing with lobotomized-claude-code
81
+ **Reasoning**
75
82
 
76
- Use this fork's extraction surface with [skrabe/lobotomized-claude-code](https://github.com/skrabe/lobotomized-claude-code)per-model override sets (**Claude Opus 4.8**, Claude Fable 5) tuned against this fork's extraction. Our named-prompt JSON catches prompts Piebald's published extract doesn't (572 ids for CC 2.1.187 absent from their extract), and the system-reminder + `string`-kind reach lets the overrides cover content the base mechanisms can't.
83
+ - `max-effort-default` — Opus defaults to max reasoning effort
84
+ - `complexity-router` — route reasoning effort by task difficulty _(experimental)_
77
85
 
78
- ## Install
86
+ **Search**
79
87
 
80
- Published on npm as [`tweakcc-fixed`](https://www.npmjs.com/package/tweakcc-fixed)this repo is the package's source (v2.0.0+):
88
+ - `swap-ripgrep-for-fff` — fff-backed grep, find, and rg _(experimental)_
81
89
 
82
- ```bash
83
- npx tweakcc-fixed@latest # interactive UI
84
- npx tweakcc-fixed@latest --apply # apply customizations from ~/.tweakcc/config.json
85
- ```
90
+ **Correctness & noise**
86
91
 
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
- landsno package update needed for prompt data alone.
92
+ - `fix-rewind-summary-header` an honest rewind / compaction summary header
93
+ - `fix-summarize-from-here` "summarize from here" starts at the rewind point, not the top
94
+ - `strip-empty-system-reminders` drop the empty `<system-reminder>` blocks left after empty tool output
95
+ - `read-default-lines` an env-gated cap on the default `Read` line count
96
+ - `suppress-deferred-tools` — drop the deferred-tools announcement
91
97
 
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.)
98
+ **Models & prompts**
97
99
 
98
- **From source** (contributing, or running unpublished work-in-progress):
100
+ - `autonomous-operation-all-models` apply the Fable/Mythos autonomous prompt set to every model
101
+ - `auto-mode-classifier-model` — pin the auto-mode safety classifier to a cheaper model
99
102
 
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
- ```
103
+ </details>
105
104
 
106
105
  ## How it works
107
106
 
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`.
107
+ Two kinds of edit, both driven by your config in `~/.tweakcc/config.json`:
109
108
 
110
- ## Library API
111
-
112
- Besides the CLI, `tweakcc-fixed` is published as a library — the building blocks
113
- the tool uses, exposed for writing your own Claude Code patching scripts. Every
114
- export is documented inline (JSDoc, shipped in the `.d.ts`).
115
-
116
- ```ts
117
- import {
118
- tryDetectInstallation,
119
- readContent,
120
- writeContent,
121
- backupFile,
122
- helpers,
123
- } from 'tweakcc-fixed';
124
-
125
- // Find Claude Code (npm or native Bun install)
126
- const installation = await tryDetectInstallation();
127
-
128
- // Back up before touching anything
129
- await backupFile(installation.path, './cli.js.bak');
130
-
131
- // Read the JS (extracted from the native binary when needed)
132
- const { content, clearBytecode } = await readContent(installation);
133
-
134
- // Patch it — `helpers` finds minified identifiers in the bundle
135
- const reactVar = helpers.getReactVar(content);
136
- const patched = content.replace(/…/, '…');
137
-
138
- // Write it back. For native installs this repacks the binary; `clearBytecode`
139
- // MUST be threaded through from readContent so a stale Bun bytecode cache
140
- // doesn't keep running the old code.
141
- await writeContent(installation, patched, clearBytecode);
109
+ ```
110
+ ┌──────────────────────┐ ┌────────────────────────────┐
111
+ 1. code patches │ │ 2. prompt overrides │
112
+ regex-anchored │ │ swap embedded prompt text │
113
+ splices of JS │ │ for your markdown │
114
+ └──────────┬───────────┘ └─────────────┬──────────────┘
115
+ └────────────┬────────────────────┘
116
+
117
+ npm cli.js ──or── native Bun binary
118
+ (patched in place) (JS extracted → patched → repacked)
119
+
120
+ backup written · `--restore` anytime
142
121
  ```
143
122
 
144
- Main exports: `findAllInstallations` / `tryDetectInstallation` /
145
- `showInteractiveInstallationPicker` (detection), `readContent` / `writeContent`
146
- (JS I/O across npm + native), `backupFile` / `restoreBackup`, `readTweakccConfig`
147
- plus the config-path helpers, the `helpers` toolkit (minified-identifier finders
123
+ A code patch finds a minified shape with a regex and splices in modified JS; a prompt override swaps the embedded prompt text for your markdown. npm installs are patched in place, while native installs have their JS pulled out of the Bun binary with [node-lief](https://github.com/Piebald-AI/node-lief), patched, and repacked with stale bytecode cleared. The same building blocks ship as a library — `tryDetectInstallation`, `readContent`/`writeContent`, `backupFile`, and the minified-identifier `helpers` — if you'd rather script your own patches.
148
124
 
149
- - diff utilities), and the `Installation` / `TweakccConfig` / `Settings` /
150
- `DetectInstallationOptions` types.
125
+ ## Staying current
151
126
 
152
- ## The `showtime` skill (CC version-bump pipeline)
127
+ When Claude Code ships a new version, the [showtime skill](./skills/showtime/) runs the whole upgrade: pull the new `cli.js`, re-extract the prompts, realign anything that drifted, and verify it landed clean. Say "it's showtime," or run `node skills/showtime/driver.mjs check`.
153
128
 
154
- 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:
129
+ ## Credit & license
155
130
 
156
- | File | Role |
157
- | -------------- | ---------------------------------------------------------------------------------------------------------------------- |
158
- | `SKILL.md` | the runbook — the phases, the gates, when to ask vs act |
159
- | `REFERENCE.md` | the self-contained "why" — the bug-class catalog, the quote-context rule, the realignment recipe, the gotchas |
160
- | `driver.mjs` | the mechanical harness — `versions` / `extract` / `report` / `check` (resolves the repo itself; honors `TWEAKCC_REPO`) |
131
+ A fork of [Piebald-AI/tweakcc](https://github.com/Piebald-AI/tweakcc) (© [Piebald LLC](https://piebald.ai)) — all of the core customization is its work, carried here with fixes from upstream PRs [#601](https://github.com/Piebald-AI/tweakcc/pull/601), [#646](https://github.com/Piebald-AI/tweakcc/pull/646), [#655](https://github.com/Piebald-AI/tweakcc/pull/655), and [#664](https://github.com/Piebald-AI/tweakcc/pull/664) on top of the fork-only additions. [MIT](https://github.com/Piebald-AI/tweakcc/blob/main/LICENSE).
161
132
 
162
- **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.
133
+ <div align="center">
163
134
 
164
- ## License
135
+ If it made your Claude Code better, a ⭐ helps others find it.
165
136
 
166
- [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).
137
+ </div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tweakcc-fixed",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "type": "module",
5
5
  "description": "Maintained fork of tweakcc — patch an installed Claude Code (npm or native binary) with curated system-prompt overrides, system-reminder overrides, and fork-only patches. Pairs with skrabe/lobotomized-claude-code.",
6
6
  "main": "dist/lib/index.mjs",