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 +21 -21
- package/README.md +124 -95
- package/dist/config-BiuOq4pD.mjs +725 -0
- package/dist/content-CseHblfu.mjs +29 -0
- package/dist/index.mjs +12 -12
- package/dist/lib/index.d.mts +9 -0
- package/dist/lib/index.mjs +1 -1
- package/dist/nativeInstallation-CrF53qa5.mjs +4 -0
- package/package.json +103 -112
- package/dist/config-5W52dXMg.mjs +0 -668
- package/dist/content-vIySXZ_y.mjs +0 -29
- package/dist/nativeInstallation-DDTsTrCt.mjs +0 -4
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
|
|
4
|
-
|
|
5
|
-
> [!
|
|
6
|
-
> This fork
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
##
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
##
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
```bash
|
|
83
|
-
|
|
84
|
-
#
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
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).
|