tweakcc 3.3.0 → 4.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/README.md +1103 -40
- package/dist/config-BnEFBw3y.mjs +669 -0
- package/dist/content-5p21eXlE.mjs +29 -0
- package/dist/index.mjs +24 -666
- package/dist/lib/index.mjs +1 -0
- package/dist/nativeInstallation-BuwapCoy.mjs +4 -0
- package/package.json +16 -11
- package/dist/nativeInstallation-DBmBL-fs.mjs +0 -4
package/README.md
CHANGED
|
@@ -41,12 +41,38 @@ Download it and try it out for free! **https://piebald.ai/**
|
|
|
41
41
|
> ⭐ **If you find tweakcc useful, please consider [starring the repository](https://github.com/Piebald-AI/tweakcc) to show your support!** ⭐
|
|
42
42
|
-->
|
|
43
43
|
|
|
44
|
-
<img src="./assets/demo.gif" alt="Animated GIF demonstrating running `npx tweakcc`, creating a new theme, changing all of Claude Code's UI colors to purple, changing the thinking format from '<verb>ing...' to 'Claude is <verb>ing', changing the generating spinner style to a
|
|
44
|
+
<img src="./assets/demo.gif" alt="Animated GIF demonstrating running `npx tweakcc`, creating a new theme, changing all of Claude Code's UI colors to purple, changing the thinking format from '<verb>ing...' to 'Claude is <verb>ing', changing the generating spinner style to a 50ms glow animation, applying the changes, running Claude, and using '/config' to switch to the new theme, and sending a message to see the new thinking verb format." width="800">
|
|
45
|
+
|
|
46
|
+
> [!IMPORTANT]
|
|
47
|
+
> **NEW in 4.0.0:** tweakcc now has an API; use `npm i tweakcc` to add to your project and see [API](#api)!
|
|
48
|
+
>
|
|
49
|
+
> **NEW in 4.0.0:** You can now create custom patches via sandboxed scripts! Works with native installations. No need to fork tweakcc just to make a quick patch! See [`tweakcc adhoc-patch`](#cli-commands).
|
|
50
|
+
>
|
|
51
|
+
> **NEW in 4.0.0:** You can also apply customizations from a remote URL to a config file. See [Remote Config](#remote-config).
|
|
52
|
+
>
|
|
53
|
+
> Also see `tweakcc --restore`, [`tweakcc unpack`](#cli-commands), and [`tweakcc repack`](#cli-commands).
|
|
54
|
+
|
|
55
|
+
> [!NOTE]
|
|
56
|
+
> **NEW:** tweakcc 4.0.0 also introduces several new patches:
|
|
57
|
+
>
|
|
58
|
+
> - [AGENTS.md support (demo video)](#feature-agentsmd-support)
|
|
59
|
+
> - [:lock: unlock swarm mode](#feature-swarm-mode-native-multi-agent)
|
|
60
|
+
> - [:lock: unlock session memory (blog post)](https://piebald.ai/blog/session-memory-is-coming-to-claude-code) (thank you [@odysseus0](https://github.com/odysseus0)!)
|
|
61
|
+
> - [`/remember` skill](https://piebald.ai/blog/session-memory-is-coming-to-claude-code)
|
|
62
|
+
> - [input pattern highlighters](#feature-input-pattern-highlighters)
|
|
63
|
+
> - [Opus plan 1M](#feature-opus-plan-1m-mode)
|
|
64
|
+
> - [MCP startup optimization](#feature-mcp-startup-optimization)
|
|
65
|
+
> - [token count rounding](#feature-token-count-rounding)
|
|
66
|
+
> - [statusline throttling/pacing](#feature-statusline-update-customization)
|
|
67
|
+
> - [auto-accept plan mode](#feature-auto-accept-plan-mode) (thank you [@irdbl](https://github.com/irdbl)!)
|
|
68
|
+
> - [dangerously bypassing permissions in sudo](#feature-bypass-permissions-check-in-sudo) (thank you [@brrock](https://github.com/brrock)!)
|
|
69
|
+
> - [native installer warning suppression](#feature-suppress-native-installer-warning) (thank you [@brrock](https://github.com/brrock)!).
|
|
45
70
|
|
|
46
71
|
With tweakcc, you can
|
|
47
72
|
|
|
48
73
|
- Customize all of Claude Code's **system prompts** (**NEW:** also see all of [**Claude Code's system prompts**](https://github.com/Piebald-AI/claude-code-system-prompts))
|
|
49
74
|
- Create custom **toolsets** that can be used in Claude Code with the new **`/toolset`** command
|
|
75
|
+
- **Highlight** custom patterns while you type in the CC input box with custom colors and styling, like how `ultrathink` used to be rainbow-highlighted.
|
|
50
76
|
- Manually name **sessions** in Claude Code with `/title my chat name` or `/rename` (see [**our blog post**](https://piebald.ai/blog/messages-as-commits-claude-codes-git-like-dag-of-conversations) for implementation details)
|
|
51
77
|
- Create **custom themes** with a graphical HSL/RGB color picker
|
|
52
78
|
- Add custom **thinking verbs** that will show while Claude's working
|
|
@@ -55,19 +81,22 @@ With tweakcc, you can
|
|
|
55
81
|
- Remove the **ASCII border** from the input box
|
|
56
82
|
- Expand **thinking blocks** by default, so that you don't need to use the transcript (<kbd>Ctrl+O</kbd>) to see them
|
|
57
83
|
- Configure which Claude **model** each **subagent** (Plan, Explore, and general-purpose) uses
|
|
84
|
+
- Switch between **table formats** - Claude Code default, Unicode (`┌─┬─┐`), ASCII/markdown (`|---|`), Unicode without top/bottom borders.
|
|
58
85
|
|
|
59
86
|
tweakcc also
|
|
60
87
|
|
|
61
88
|
- Fixes a bug where the **spinner animation** is frozen if you have the `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC` environment variable set ([#46](https://github.com/Piebald-AI/tweakcc/issues/46))
|
|
62
89
|
- Allows you to **change the context limit** (default: 200k tokens) used with models from custom Anthropic-compatible APIs with a new environment variable, `CLAUDE_CODE_CONTEXT_LIMIT`
|
|
90
|
+
- Adds the **`opusplan[1m]`** model alias, combining Opus for planning with Sonnet's 1M context for execution—reducing "[context anxiety](#feature-opus-plan-1m-mode)" ([#108](https://github.com/Piebald-AI/tweakcc/issues/108))
|
|
63
91
|
- Adds a message to Claude Code's startup banner indicating that you're running the patched version of CC (configurable)
|
|
92
|
+
- Speeds up Claude Code startup by **~50%** with non-blocking MCP connections and configurable parallel connection batch size ([#406](https://github.com/Piebald-AI/tweakcc/issues/406))
|
|
93
|
+
- Enables native multi-agent/swarm mode (TeammateTool, delegate mode, swarm spawning) by bypassing the `tengu_brass_pebble` Statsig flag.
|
|
64
94
|
|
|
65
|
-
|
|
95
|
+
tweakcc supports Claude Code installed on **Windows, macOS, and Linux**, both **native/binary installations** and those installed via npm, yarn, pnpm, bun, Homebrew/Linuxbrew, nvm, fnm, n, volta, nvs, and nodenv, as well as custom locations.
|
|
66
96
|
|
|
67
|
-
|
|
68
|
-
- Apply **custom styling** to the markdown elements in Claude's responses like code, bold, headers, etc
|
|
97
|
+
tweakcc supports Claude Code's **native installation**, which is a large platform-specific native executable containing the same minified/compiled JavaScript code from npm, just packaged up in a [Bun](https://github.com/oven-sh/bun) binary. We support patching the native binary on macOS, Windows, and Linux, including ad-hoc signing on Apple Silicon, via [**node-lief**](https://github.com/Piebald-AI/node-lief), our Node.js bindings for [LIEF (Library to Instrument Executables)](https://github.com/lief-project/LIEF).
|
|
69
98
|
|
|
70
|
-
tweakcc
|
|
99
|
+
While tweakcc has a large library of built-in patches, you can create custom patches by using tweakcc's [API](#api). If you don't want to create an npm package, you can use [`tweakcc adhoc-patch`](#cli-commands), which applies a custom Node.js script to your default Claude Code installation. Because `adhoc-patch` supports running scripts from an HTTP URL, you can even host a script on a GitHub Gist or pastebin for easy distribution.
|
|
71
100
|
|
|
72
101
|
Run without installation:
|
|
73
102
|
|
|
@@ -78,57 +107,518 @@ $ npx tweakcc
|
|
|
78
107
|
$ pnpm dlx tweakcc
|
|
79
108
|
```
|
|
80
109
|
|
|
110
|
+
## Table of contents
|
|
111
|
+
|
|
112
|
+
- [How it works](#how-it-works)
|
|
113
|
+
- [Remote config](#remote-config)
|
|
114
|
+
- [CLI Commands (`unpack`, `repack`, `adhoc-patch`)](#cli-commands)
|
|
115
|
+
- [API](#api)
|
|
116
|
+
- [System prompts](#system-prompts)
|
|
117
|
+
- [Toolsets](#toolsets)
|
|
118
|
+
- [**Features**](#features)
|
|
119
|
+
- [System prompts](#system-prompts)
|
|
120
|
+
- Themes
|
|
121
|
+
- Thinking verbs customization
|
|
122
|
+
- Thinking indicator customizations
|
|
123
|
+
- Context limit
|
|
124
|
+
- LSP support
|
|
125
|
+
- Hide "ctrl-g to edit prompt in <editor>"
|
|
126
|
+
- Hide the startup banner
|
|
127
|
+
- Hide the startup "Clawd" logo
|
|
128
|
+
- Increase the max size in tokens for files read via `Read`
|
|
129
|
+
- Remove the border from the message input box
|
|
130
|
+
- Add all models to `/model`
|
|
131
|
+
- tweakcc patches applied indicator
|
|
132
|
+
- Show more items in select menus
|
|
133
|
+
- Subagent models
|
|
134
|
+
- Suppression of `1→ ` prefixes from `Read` output
|
|
135
|
+
- Suppress `/rate-limit-options` from being injected
|
|
136
|
+
- Swarm mode
|
|
137
|
+
- Session memory
|
|
138
|
+
- `/remember` skill
|
|
139
|
+
- [Toolsets](#toolsets)
|
|
140
|
+
- User message display customization
|
|
141
|
+
- Token indicator display
|
|
142
|
+
- [Add support for dangerously bypassing permissions in sudo](#feature-bypass-permissions-check-in-sudo)
|
|
143
|
+
- [Input pattern highlighters](#feature-input-pattern-highlighters)
|
|
144
|
+
- [Opus Plan 1M mode](#feature-opus-plan-1m-mode)
|
|
145
|
+
- [MCP startup optimization](#feature-mcp-startup-optimization)
|
|
146
|
+
- [Table format](#feature-table-format)
|
|
147
|
+
- [Swarm mode (native multi-agent)](#feature-swarm-mode-native-multi-agent)
|
|
148
|
+
- [Token count rounding](#feature-token-count-rounding)
|
|
149
|
+
- [Statusline update customization](#feature-statusline-update-customization)
|
|
150
|
+
- [AGENTS.md support (with video)](#feature-agentsmd-support)
|
|
151
|
+
- [Auto-accept plan mode](#feature-auto-accept-plan-mode)
|
|
152
|
+
- [Suppress native installer warning](#feature-suppress-native-installer-warning)
|
|
153
|
+
- [Scroll escape sequence filter](#feature-scroll-escape-sequence-filter)
|
|
154
|
+
- _Missing documentation for above features coming soon_
|
|
155
|
+
- [Configuration directory](#configuration-directory)
|
|
156
|
+
- [Building from source](#building-from-source)
|
|
157
|
+
- [Troubleshooting](#troubleshooting)
|
|
158
|
+
- [FAQ](#faq)
|
|
159
|
+
- [Contributing](#contributing)
|
|
160
|
+
- [Related projects](#related-projects)
|
|
161
|
+
- [License](#license)
|
|
162
|
+
|
|
81
163
|
## How it works
|
|
82
164
|
|
|
83
|
-
tweakcc works by patching Claude Code's minified `cli.js` file. For npm-based installations
|
|
165
|
+
tweakcc works by patching Claude Code's minified `cli.js` file, reading customizations from `~/.tweakcc/config.json`. For npm-based installations `cli.js` is modified directly, but for native installations it's extracted from the binary using [node-lief](https://github.com/Piebald-AI/node-lief), patched, and then the binary is repacked. When you update your Claude Code installation, your customizations will be overwritten, but they're remembered in your configuration file, so they can be reapplied by just running `npx tweakcc --apply`.
|
|
84
166
|
|
|
85
|
-
tweakcc is verified to work with Claude Code **2.1.
|
|
167
|
+
tweakcc is verified to work with Claude Code **2.1.32.** In newer or earlier versions various patches might not work. However, if we have the [system prompts for your version](https://github.com/Piebald-AI/tweakcc/tree/main/data/prompts) then system prompt patching is guaranteed to work with that version, even if it's significantly different from the verified CC version—the version number stated above is only relevant for the non-system-prompt patches. We get the latest system prompts within minutes of each new CC release, so unless you're using a CC version older than 2.0.14, your version is supported.
|
|
86
168
|
|
|
87
|
-
|
|
169
|
+
You can also create custom patches using tweakcc without having to fork it or open a PR. [`tweakcc adhoc-patch`](#cli-commands) supports using custom scripts that work with native and npm-based installs and that automatically detect your Claude Code installation.
|
|
88
170
|
|
|
89
|
-
|
|
171
|
+
## Remote Config
|
|
90
172
|
|
|
91
|
-
|
|
92
|
-
2. **`~/.tweakcc/`** if it exists, or
|
|
93
|
-
3. **`~/.claude/tweakcc`** if it exists, or
|
|
94
|
-
4. **`$XDG_CONFIG_HOME/tweakcc`** if the `XDG_CONFIG_HOME` environment variable is set.
|
|
173
|
+
While tweakcc usually works by applying customizations from your local `~/.tweakcc/config.json`, you can optionally pass the `--config-url <http URL>` flag when you use `tweakcc --apply` to have tweakcc fetch config from a remote URL and apply it to your local Claude Code installation. This is useful for testing someone else's config when shared via a Gist or pastebin, for example.
|
|
95
174
|
|
|
96
|
-
|
|
175
|
+
Example:
|
|
176
|
+
|
|
177
|
+
```
|
|
178
|
+
npx tweakcc@latest --apply --config-url https://gist.githubusercontent.com/bl-ue/27323f9bfd4c18aaab51cad11c1148dc/raw/b24b5fe08874ce50f4be6c093d9589d184f91a70/config.json
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
Your local config will **not** be overwritten; the remote config will be copied into your `config.json` under `remoteConfig.settings`.
|
|
182
|
+
|
|
183
|
+
## CLI Commands
|
|
184
|
+
|
|
185
|
+
In addition to the interactive TUI (`npx tweakcc`) and the `--apply` flag, tweakcc provides three subcommands for advanced use: `unpack`, `repack`, and `adhoc-patch`.
|
|
186
|
+
|
|
187
|
+
<details>
|
|
188
|
+
<summary><code>unpack</code></summary>
|
|
189
|
+
|
|
190
|
+
Extract the embedded JavaScript from a native Claude Code binary and write it to a file. This is useful for inspecting Claude Code's source, writing custom patches, or making manual edits before repacking. Note that `unpack` only works with native/binary installations; it will error if pointed at an npm-based installation (`cli.js`), because it can already be read directly from disk. `unpack` takes the path to the JS file to write to, and an optional path to a native binary, which if omitted will default to the current installation.
|
|
97
191
|
|
|
98
192
|
```bash
|
|
99
|
-
|
|
100
|
-
|
|
193
|
+
npx tweakcc unpack <output-js-path> [binary-path]
|
|
194
|
+
```
|
|
101
195
|
|
|
102
|
-
|
|
103
|
-
|
|
196
|
+
</details>
|
|
197
|
+
|
|
198
|
+
<details>
|
|
199
|
+
<summary><code>repack</code></summary>
|
|
200
|
+
|
|
201
|
+
Read a JavaScript file and embed it back into a native Claude Code binary. This is the counterpart to `unpack` — after inspecting or modifying the extracted JS, use `repack` to write it back. Like `unpack`, this only works with native installations. `repack` takes a path to a JS file to read from, and an optional path to a native binary, which if omitted, as above, will default to the current installation.
|
|
202
|
+
|
|
203
|
+
```bash
|
|
204
|
+
npx tweakcc repack <input-js-path> [binary-path]
|
|
104
205
|
```
|
|
105
206
|
|
|
106
|
-
|
|
207
|
+
Example:
|
|
107
208
|
|
|
108
|
-
|
|
209
|
+
```bash
|
|
210
|
+
# Extract, edit, and repack
|
|
211
|
+
npx tweakcc unpack ./claude-code.js
|
|
212
|
+
# ... make your edits to claude-code.js ...
|
|
213
|
+
npx tweakcc repack ./claude-code.js
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
</details>
|
|
217
|
+
|
|
218
|
+
<details>
|
|
219
|
+
<summary><code>adhoc-patch</code></summary>
|
|
220
|
+
|
|
221
|
+
Apply a one-off or ad-hoc patch to a Claude Code installation without going through the tweakcc UI or config system. It supports three modes and works with both native and npm-based installations.
|
|
222
|
+
|
|
223
|
+
3 modes of patching are supported.
|
|
224
|
+
|
|
225
|
+
#### `--string`
|
|
226
|
+
|
|
227
|
+
A fixed/static old string is replaced with a fixed/static new string, analogous to `grep -F`.
|
|
228
|
+
|
|
229
|
+
- By default, all instances of the old string are replaced, but you can use `--index` to specify a particular occurrence by 1-based index, e.g. `--index 1` to replace only the first, `--index 2` to replace only the second, etc.
|
|
230
|
+
|
|
231
|
+
#### `--regex`
|
|
232
|
+
|
|
233
|
+
All matches of a regular expression are replaced with a new string.
|
|
234
|
+
|
|
235
|
+
- The new string can contain `$D` replacements, where `D` is the 0-based index of a group matched by the regular expression; `$0` = the entire matched text, `$1` = the first user-defined match group, etc.
|
|
236
|
+
|
|
237
|
+
- The regular expression must begin and end with a forward slash in JavaScript style, e.g. `/my.+regex/`. An optional list of flags—characters from the set `g`, `i`, `m`, `s`, `u`, and `y`—may be appended after the last delimiting forward slash, e.g. `/claude/ig`
|
|
238
|
+
|
|
239
|
+
- Like `--string`, `--regex` supports the use of `--index` to specify by index which occurrence to replace, without which all occurrences are replaced.
|
|
240
|
+
|
|
241
|
+
#### `--script`
|
|
242
|
+
|
|
243
|
+
This is the most powerful option. A short snippet of JavaScript code running in Node.js takes the JavaScript content of the CC installation as input and returns the entire input, modified as output.
|
|
244
|
+
|
|
245
|
+
- **Security:** The script is run in a sandboxed/isolated `node` child process with the [`--experimental-permission`](https://nodejs.org/api/permissions.html) option to prevent the script from using file system and network APIs. This option requires that you have Node.js 20+ installed and on your `PATH`. Due to this sandboxing, scripts themselves (including those downloaded from HTTP URLs) are safe to run without prior review; however, because the scripts are patching Claude Code, which is an executable, it's technically possible for a script to patch malicious code into your Claude Code executable that would execute when you run `claude`. As a result, it's highly advised to review the diff tweakcc prints when it asks you if you'd like to apply the changes proposed by the patch.
|
|
246
|
+
|
|
247
|
+
- **Input/output:** Claude Code's JavaScript code is passed to the script via a global variable, `js`, available inside the script's execution context. To return the modified file content, simply use the `return` keyword. For example, to write a very simple script that replaced all instances of `"Claude Code"` with `"My App"`, you could write the following:
|
|
248
|
+
|
|
249
|
+
```js
|
|
250
|
+
js = js.replace(/"Claude Code"/g, '"My App"');
|
|
251
|
+
return js;
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
- **Utility vars:** Because complicated patches may need to make use of common functions and global variables like `chalk`, `React`, `require`, and the low-level module loader function, and also common [Ink/React](https://github.com/vadimdemedes/ink) components like `Text` and `Box`, tweakcc also provides a `vars` global variable to the script. `vars` is an object containing the names of the common variables listed above; here's an example:
|
|
255
|
+
|
|
256
|
+
```js
|
|
257
|
+
const vars = {
|
|
258
|
+
chalkVar: 'K6',
|
|
259
|
+
moduleLoaderFunction: 's',
|
|
260
|
+
reactVar: 'Yt8',
|
|
261
|
+
requireFuncName: 'C1',
|
|
262
|
+
textComponent: 'f',
|
|
263
|
+
boxComponent: 'NZ5',
|
|
264
|
+
};
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
- **Script source:** Scripts can be passed in 3 ways: directly on the command-line, via a local file on disk, and via an HTTP URL. In order to specify a file, pass the path to the file prefixed with `@` (similar to `curl -d`). To specify an HTTP URL, use `@` and ensure the URL is prefixed with `http://` or `https://`. HTTP scripts themselves are safe to run as a result of our sandboxing, with one notable pitfall, as mentioned above.
|
|
268
|
+
|
|
269
|
+
#### Usage
|
|
109
270
|
|
|
110
271
|
```bash
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
272
|
+
# Replace a fixed string with another string:
|
|
273
|
+
npx tweakcc adhoc-patch --string '"Claude Code"' '"My App"'
|
|
274
|
+
|
|
275
|
+
# Replace all CSS-style RGB colors with bright red:
|
|
276
|
+
npx tweakcc adhoc-patch --regex 'rgb\(\d+,\d+,\d+\)' 'rgb(255,0,0)'
|
|
277
|
+
|
|
278
|
+
# Erase all of CC's code and replace it with a simple console.log:
|
|
279
|
+
npx tweakcc adhoc-patch --script $'return "(function(){console.log(\"Hi\")})()"'
|
|
280
|
+
|
|
281
|
+
# Run a script from a local file:
|
|
282
|
+
npx tweakcc adhoc-patch --script '@path/to/script.js'
|
|
283
|
+
|
|
284
|
+
# Run a script from an HTTP URL (warning: this script makes everything in CC blue and changes "Claude Code" to "ABC Code CLI", which BREAKS CC):
|
|
285
|
+
# Its contents are:
|
|
286
|
+
#
|
|
287
|
+
# js = js.replace(/Claude Code/g, "ABC Code CLI")
|
|
288
|
+
# js = js.replace(/rgb\(\d+,\d+,\d+\)/g, "rgb(0,128,255)")
|
|
289
|
+
# return js
|
|
290
|
+
#
|
|
291
|
+
npx tweakcc adhoc-patch --script '@https://gist.githubusercontent.com/bl-ue/2402a16b966176c994ea7bd5d11b0b09/raw/eeb0b78a6387f0e6a15182eeabd95f0e84e4ccd7/patch_cc.js'
|
|
116
292
|
```
|
|
117
293
|
|
|
118
|
-
|
|
294
|
+
</details>
|
|
119
295
|
|
|
120
|
-
|
|
296
|
+
Here's a demo of `adhoc-patch` using a script from an HTTP URL ([link to Gist](https://gist.githubusercontent.com/bl-ue/13973d1510a0612dfa99fabf4c20df3b/raw/ef106a2033dfb07d754fa8d27f06979ec2fe3831/demo_change.js)):
|
|
121
297
|
|
|
122
|
-
|
|
298
|
+
https://github.com/user-attachments/assets/221ce577-933e-41d9-ae14-88ce5457a321
|
|
123
299
|
|
|
124
|
-
|
|
125
|
-
-
|
|
126
|
-
- [**claude-powerline**](https://github.com/Owloops/claude-powerline) - Vim-style powerline statusline for Claude Code with real-time usage tracking, git integration, and custom themes.
|
|
127
|
-
- [**CCometixLine**](https://github.com/Haleclipse/CCometixLine) - A high-performance Claude Code statusline tool written in Rust with Git integration, usage tracking, interactive TUI configuration, and Claude Code enhancement utilities.
|
|
300
|
+
> [!CAUTION]
|
|
301
|
+
> `adhoc-patch` does not create a backup of the Claude Code installation that is modified. You'll need to use `--apply` first to get a backup created if you want to be able to use `--restore`/`--revert` after an `adhoc-patch`.
|
|
128
302
|
|
|
129
|
-
|
|
303
|
+
## API
|
|
130
304
|
|
|
131
|
-
|
|
305
|
+
tweakcc can be used as an npm dependency and provides an easy API that projects can use to patch Claude Code without worrying about where it's installed and whether it's native or npm-based. The functions are divided into 5 groups: config, installation, I/O, backup, and utilities.
|
|
306
|
+
|
|
307
|
+
<details>
|
|
308
|
+
<summary><b>Config</b> • Functions to access tweakcc's own config, if it exists on the machine.</summary>
|
|
309
|
+
|
|
310
|
+
```ts
|
|
311
|
+
/**
|
|
312
|
+
* Returns the absolute path to tweakcc's config dir. By default it's
|
|
313
|
+
* `~/.tweakcc` but it also can use `~/.claude/tweakcc` and it also respects
|
|
314
|
+
* `XDG_CONFIG_HOME`—see [Configuration Directory](#configuration-directory).
|
|
315
|
+
*/
|
|
316
|
+
function getTweakccConfigDir(): string;
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* Returns the absolute path to tweakcc's config file. It's named `config.json`
|
|
320
|
+
* and lives in the config dir as returned by `getTweakccConfigDir`.
|
|
321
|
+
*/
|
|
322
|
+
function getTweakccConfigPath(): string;
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* Returns the absolute path to the directory containing the user-editable
|
|
326
|
+
* system prompt markdown files. It's named `system-prompts/` and lives in the
|
|
327
|
+
* config dir.
|
|
328
|
+
*/
|
|
329
|
+
function getTweakccSystemPromptsDir(): string;
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* Reads and returns the tweakcc config (as determined by `getTweakccConfigDir`).
|
|
333
|
+
*/
|
|
334
|
+
function readTweakccConfig(): Promise<TweakccConfig | null>;
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
Demo:
|
|
338
|
+
|
|
339
|
+
```js
|
|
340
|
+
> tweakcc.getTweakccConfigDir()
|
|
341
|
+
'/home/user/.tweakcc'
|
|
342
|
+
|
|
343
|
+
> tweakcc.getTweakccConfigPath()
|
|
344
|
+
'/home/user/.tweakcc/config.json'
|
|
345
|
+
|
|
346
|
+
> tweakcc.getTweakccSystemPromptsDir()
|
|
347
|
+
'/home/user/.tweakcc/system-prompts'
|
|
348
|
+
|
|
349
|
+
> await tweakcc.readTweakccConfig()
|
|
350
|
+
{
|
|
351
|
+
ccVersion: '2.1.32',
|
|
352
|
+
ccInstallationPath: '/home/user/.local/bin/claude',
|
|
353
|
+
lastModified: '2026-02-05T21:18:48.551Z',
|
|
354
|
+
changesApplied: true,
|
|
355
|
+
settings: { ... }
|
|
356
|
+
}
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
</details>
|
|
360
|
+
|
|
361
|
+
<details>
|
|
362
|
+
<summary><b>Installation</b> • Utilities to find installed versions of Claude Code.</summary>
|
|
363
|
+
|
|
364
|
+
```ts
|
|
365
|
+
/**
|
|
366
|
+
* Finds all Claude Code installations on the machine via `$PATH` and hard-coded
|
|
367
|
+
* search directories.
|
|
368
|
+
*/
|
|
369
|
+
async function findAllInstallations(): Promise<Installation[]>;
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* Prompts the user to select one of the specified Claude Code installations
|
|
373
|
+
* interactively using the same UI tweakcc uses, powered by [Ink + React](https://github.com/vadimdemedes/ink).
|
|
374
|
+
*/
|
|
375
|
+
async function showInteractiveInstallationPicker(
|
|
376
|
+
candidates: Installation[]
|
|
377
|
+
): Promise<Installation | null>;
|
|
378
|
+
|
|
379
|
+
/**
|
|
380
|
+
* Attempts to detect the user's preferred Claude Code installation. Detection procedure:
|
|
381
|
+
* 0. options.path
|
|
382
|
+
* 1. Uses $TWEAKCC_CC_INSTALLATION_PATH if set.
|
|
383
|
+
* 2. Uses ccInstallationPath in tweakcc config.
|
|
384
|
+
* 3. Discovers installation from `claude` in PATH
|
|
385
|
+
* 4. Looks in hard-coded search paths:
|
|
386
|
+
* a. If the search yields one installation, uses it
|
|
387
|
+
* b. If it yields multiple and options.interactive is true, display a picker
|
|
388
|
+
* via showInteractiveInstallationPicker().
|
|
389
|
+
*/
|
|
390
|
+
async function tryDetectInstallation(
|
|
391
|
+
options: DetectInstallationOptions = {}
|
|
392
|
+
): Promise<Installation>;
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
Demo:
|
|
396
|
+
|
|
397
|
+
```js
|
|
398
|
+
> const insts = await tweakcc.findAllInstallations()
|
|
399
|
+
[
|
|
400
|
+
{
|
|
401
|
+
path: 'C:\\Users\\user\\.local\\share\\claude\\versions\\2.0.60',
|
|
402
|
+
version: '2.0.60',
|
|
403
|
+
kind: 'native'
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
path: 'C:\\Users\\user\\.local\\share\\claude\\versions\\2.0.76',
|
|
407
|
+
version: '2.0.76',
|
|
408
|
+
kind: 'native'
|
|
409
|
+
},
|
|
410
|
+
{
|
|
411
|
+
path: 'C:\\Users\\user\\AppData\\Local\\Volta\\tools\\image\\packages\\@anthropic-ai\\claude-code\\node_modules\\@anthropic-ai\\claude-code\\cli.js',
|
|
412
|
+
version: '2.1.32',
|
|
413
|
+
kind: 'npm'
|
|
414
|
+
}
|
|
415
|
+
]
|
|
416
|
+
|
|
417
|
+
> await tweakcc.tryDetectInstallation()
|
|
418
|
+
{
|
|
419
|
+
path: 'C:\\Users\\user\\AppData\\Local\\Volta\\tools\\image\\packages\\@anthropic-ai\\claude-code\\node_modules\\@anthropic-ai\\claude-code\\cli.js',
|
|
420
|
+
version: '2.1.32',
|
|
421
|
+
kind: 'npm'
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
> await tweakcc.showInteractiveInstallationPicker(insts)
|
|
425
|
+
No claude executable was found in PATH, but multiple Claude Code installations were found on this machine. Please select one:
|
|
426
|
+
|
|
427
|
+
❯ C:\Users\user\.local\share\claude\versions\2.0.60 (native-binary, v2.0.60)
|
|
428
|
+
C:\Users\user\.local\share\claude\versions\2.0.76 (native-binary, v2.0.76)
|
|
429
|
+
C:\Users\user\AppData\Local\Volta\tools\image\packages\@anthropic-ai\claude-code\node_modules\@anthropic-ai\claude-code\cli.js (npm-based, v2.1.32)
|
|
430
|
+
|
|
431
|
+
Your choice will be saved to ccInstallationPath in ~\.tweakcc/config.json.
|
|
432
|
+
|
|
433
|
+
Use ↑↓ arrows to navigate, Enter to select, Esc to quit
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
</details>
|
|
437
|
+
|
|
438
|
+
<details>
|
|
439
|
+
<summary><b>I/O</b> • Functions to read and write the content of an npm-based or native (Bun-based) installation.</summary>
|
|
440
|
+
|
|
441
|
+
```ts
|
|
442
|
+
/**
|
|
443
|
+
* Read Claude Code's JavaScript content.
|
|
444
|
+
*
|
|
445
|
+
* - npm installs: reads cli.js directly
|
|
446
|
+
* - native installs: extracts embedded JS from binary
|
|
447
|
+
*/
|
|
448
|
+
async function readContent(installation: Installation): Promise<string>;
|
|
449
|
+
|
|
450
|
+
/**
|
|
451
|
+
* Write modified JavaScript content back to Claude Code.
|
|
452
|
+
*
|
|
453
|
+
* - npm installs: writes to cli.js (handles permissions, hard links)
|
|
454
|
+
* - native installs: repacks JS into binary
|
|
455
|
+
*/
|
|
456
|
+
async function writeContent(
|
|
457
|
+
installation: Installation,
|
|
458
|
+
content: string
|
|
459
|
+
): Promise<void>;
|
|
460
|
+
```
|
|
461
|
+
|
|
462
|
+
Demo:
|
|
463
|
+
|
|
464
|
+
```js
|
|
465
|
+
> const native2076Inst = { path: 'C:\\Users\\user\\.local\\share\\claude\\versions\\2.0.76', kind: 'native' };
|
|
466
|
+
|
|
467
|
+
// Reading native content:
|
|
468
|
+
> let content = await tweakcc.readContent(native2076Inst);
|
|
469
|
+
> content.length
|
|
470
|
+
10639722 // 10.6 MB
|
|
471
|
+
> content.slice(4153122, 4153122+236)
|
|
472
|
+
"var be$=\"You are Claude Code, Anthropic's official CLI for Claude.\",UBD=\"You are Claude Code, Anthropic's official CLI for Claude, running within the Claude Agent SDK.\",GBD=\"You are a Claude agent, built on Anthropic's Claude Agent SDK.\""
|
|
473
|
+
|
|
474
|
+
// Updating and re-reading native content:
|
|
475
|
+
> content = content.replace(/Claude Code/g, 'My App')
|
|
476
|
+
> content = content.replace(/Anthropic(?: PBC)?/g, 'My Corp')
|
|
477
|
+
> await tweakcc.writeContent(native2076Inst, content)
|
|
478
|
+
undefined
|
|
479
|
+
> (await tweakcc.readContent(native2076Inst)).slice(4153122+16, 4153122+172)
|
|
480
|
+
"var be$=\"You are My App, My Corp's official CLI for Claude.\",UBD=\"You are My App, My Corp's official CLI for Claude, running within the Claude Agent SDK.\",GBD=\"You are a Claude agent, built on My Corp's Claude Agent SDK.\""
|
|
481
|
+
|
|
482
|
+
```
|
|
483
|
+
|
|
484
|
+
</details>
|
|
485
|
+
|
|
486
|
+
<details>
|
|
487
|
+
<summary><b>Backup</b> • Simple utilities to handle creating and restoring backups of the native binary or `cli.js` in order to revert patches.</summary>
|
|
488
|
+
|
|
489
|
+
```ts
|
|
490
|
+
/**
|
|
491
|
+
* Backup a file to a specified location, creating parent directories if needed.
|
|
492
|
+
* Leaves the original file untouched.
|
|
493
|
+
*/
|
|
494
|
+
async function backupFile(
|
|
495
|
+
sourcePath: string,
|
|
496
|
+
backupPath: string
|
|
497
|
+
): Promise<void>;
|
|
498
|
+
|
|
499
|
+
/**
|
|
500
|
+
* Restore a file from a backup, breaking hard links, which are common with pnpm/bun
|
|
501
|
+
* installations, and preserving execute permissions.
|
|
502
|
+
*/
|
|
503
|
+
async function restoreBackup(
|
|
504
|
+
backupPath: string,
|
|
505
|
+
targetPath: string
|
|
506
|
+
): Promise<void>;
|
|
507
|
+
```
|
|
508
|
+
|
|
509
|
+
Demo:
|
|
510
|
+
|
|
511
|
+
```js
|
|
512
|
+
// Make a backup of the original install:
|
|
513
|
+
> const native2076Inst = { path: 'C:\\Users\\user\\.local\\share\\claude\\versions\\2.0.76', kind: 'native' };
|
|
514
|
+
> const backupPath = path.join(os.homedir(), ".myapp", `cc-${native2076Inst.kind}-backup`);
|
|
515
|
+
> await tweakcc.backupFile(native2076Inst.path, backupPath);
|
|
516
|
+
undefined
|
|
517
|
+
> fs.statSync(backupPath).size
|
|
518
|
+
234454688 // <-- It was made successfully; 234.5 MB.
|
|
519
|
+
|
|
520
|
+
// Now patch the original:
|
|
521
|
+
> await tweakcc.writeContent(native2076Inst, "(function(){console.log(\"Hi\")})");
|
|
522
|
+
> (await tweakcc.readContent(native2076Inst)).length
|
|
523
|
+
31 // <-- Original was successfully modified.
|
|
524
|
+
|
|
525
|
+
// Restore the backup:
|
|
526
|
+
> await tweakcc.restoreBackup(backupPath, native2076Inst.path)
|
|
527
|
+
> (await tweakcc.readContent(native2076Inst)).length
|
|
528
|
+
234454688 // Original, unpatched size.
|
|
529
|
+
```
|
|
530
|
+
|
|
531
|
+
</details>
|
|
532
|
+
|
|
533
|
+
<details>
|
|
534
|
+
<summary><b>Utilities</b> • General utilities to help with patching.</summary>
|
|
535
|
+
|
|
536
|
+
````js
|
|
537
|
+
// Utilities to find various commonly-used variables in CC's code.
|
|
538
|
+
// See the docs for `tweakcc adhoc-patch --script` above for more details.
|
|
539
|
+
findChalkVar(fileContents: string): string | undefined;
|
|
540
|
+
getModuleLoaderFunction(fileContents: string): string | undefined;
|
|
541
|
+
getReactVar(fileContents: string): string | undefined;
|
|
542
|
+
getRequireFuncName(fileContents: string): string | undefined;
|
|
543
|
+
findTextComponent(fileContents: string): string | undefined;
|
|
544
|
+
findBoxComponent(fileContents: string): string | undefined;
|
|
545
|
+
/**
|
|
546
|
+
* Clears the process-global caches that some of the above functions populate
|
|
547
|
+
* to speed up subsequent repeated calls. Use this when processing multiple CC
|
|
548
|
+
* installs in one process.
|
|
549
|
+
*/
|
|
550
|
+
clearCaches(): void;
|
|
551
|
+
|
|
552
|
+
/**
|
|
553
|
+
* Debug function for showing diffs between old and new file contents using smart word-level diffing.
|
|
554
|
+
*
|
|
555
|
+
* Uses the `diff` library to compute word-level differences and displays them with
|
|
556
|
+
* chalk-styled colors: green background for additions, red background for removals, and
|
|
557
|
+
* dim text for unchanged portions.
|
|
558
|
+
*
|
|
559
|
+
* Only outputs when --verbose flag is set.
|
|
560
|
+
*
|
|
561
|
+
* @param oldFileContents - The original file content before modification
|
|
562
|
+
* @param newFileContents - The modified file content after patching
|
|
563
|
+
* @param injectedText - The text that was injected (used to calculate context window)
|
|
564
|
+
* @param startIndex - The start index where the modification occurred
|
|
565
|
+
* @param endIndex - The end index of the original content that was replaced
|
|
566
|
+
* @param numContextChars - Number of context characters to show before and after diff.
|
|
567
|
+
*/
|
|
568
|
+
export const showDiff = (
|
|
569
|
+
oldFileContents: string,
|
|
570
|
+
newFileContents: string,
|
|
571
|
+
injectedText: string,
|
|
572
|
+
startIndex: number,
|
|
573
|
+
endIndex: number,
|
|
574
|
+
numContextChars: number = 40
|
|
575
|
+
): void;
|
|
576
|
+
|
|
577
|
+
/**
|
|
578
|
+
* Performs a global replace on a string, finding all matches first, then replacing
|
|
579
|
+
* them in reverse order (to preserve indices), and calling showDiff for each replacement.
|
|
580
|
+
*
|
|
581
|
+
* @param content - The string to perform replacements on
|
|
582
|
+
* @param pattern - The regex pattern to match (should have 'g' flag for multiple matches)
|
|
583
|
+
* @param replacement - Either a string or a replacer function (same as String.replace)
|
|
584
|
+
* @returns The modified string with all replacements applied
|
|
585
|
+
*
|
|
586
|
+
* @example
|
|
587
|
+
* ```ts
|
|
588
|
+
* const result = globalReplace(
|
|
589
|
+
* content,
|
|
590
|
+
* /throw Error\(`something`\);/g,
|
|
591
|
+
* ''
|
|
592
|
+
* );
|
|
593
|
+
* ```
|
|
594
|
+
*/
|
|
595
|
+
export const globalReplace = (
|
|
596
|
+
content: string,
|
|
597
|
+
pattern: RegExp,
|
|
598
|
+
replacement: string | ((substring: string, ...args: unknown[]) => string)
|
|
599
|
+
): string;
|
|
600
|
+
````
|
|
601
|
+
|
|
602
|
+
Demo of `showDiff`:
|
|
603
|
+
|
|
604
|
+
```js
|
|
605
|
+
const pattern = /function [$\w]+\(\)\{return [$\w]+\("my_feature_flag"/;
|
|
606
|
+
const match = file.match(pattern)!;
|
|
607
|
+
const insertIndex = match.index + match[0].indexOf('{') + 1;
|
|
608
|
+
const insertion = 'return true;';
|
|
609
|
+
|
|
610
|
+
const newFile = file.slice(0, insertIndex) + insertion + file.slice(insertIndex);
|
|
611
|
+
|
|
612
|
+
showDiff(file, newFile, insertion, insertIndex, insertIndex);
|
|
613
|
+
```
|
|
614
|
+
|
|
615
|
+
Demo of `globalReplace`:
|
|
616
|
+
|
|
617
|
+
```js
|
|
618
|
+
newFile = globalReplace(newFile, /"Claude Code",/g, '"My App"');
|
|
619
|
+
```
|
|
620
|
+
|
|
621
|
+
</details>
|
|
132
622
|
|
|
133
623
|
## System prompts
|
|
134
624
|
|
|
@@ -143,13 +633,13 @@ tweakcc allows you to customize the various parts of Claude Code's system prompt
|
|
|
143
633
|
|
|
144
634
|
Because the system prompt is **dynamically composed** based on several factors, **it's not one string** that can be simply modified in a text editor. It's a bunch of smaller strings sprinkled throughout Claude Code's source code.
|
|
145
635
|
|
|
146
|
-
tweakcc's method for modifying involves maintaining one markdown file for each individual portion of the prompt, resulting in a file for each tool description, each agent/utility prompt, and one for the main system prompt and a few more for various large notes inserted into other prompt parts.
|
|
636
|
+
tweakcc's method for modifying the system prompts involves maintaining one markdown file for each individual portion of the prompt, resulting in a file for each tool description, each agent/utility prompt, and one for the main system prompt and a few more for various large notes inserted into other prompt parts.
|
|
147
637
|
|
|
148
638
|
#### How the prompt files are created
|
|
149
639
|
|
|
150
640
|
When tweakcc starts up, it downloads a list of system prompt parts for your Claude Code installation from GitHub (the [`data/prompts`](https://github.com/Piebald-AI/tweakcc/tree/main/data/prompts) folder in the tweakcc repo). It then checks if each prompt part has a corresponding markdown file on disk, creating ones that don't exist and populating them with the default text for the version.
|
|
151
641
|
|
|
152
|
-
|
|
642
|
+
:star: **To customize any part of the system prompt,** simply edit the markdown files in `~/.tweakcc/system-prompts` (or `$XDG_CONFIG_HOME/tweakcc/system-prompts`) and then run `npx tweakcc --apply`.
|
|
153
643
|
|
|
154
644
|
#### What happens when Anthropic changes the prompts?
|
|
155
645
|
|
|
@@ -172,15 +662,560 @@ This is a great idea, and we recommend it; in fact, we have one ourselves [here.
|
|
|
172
662
|
|
|
173
663
|
Toolsets are collections of built-in tools that Claude is allowed to call. Unlike Claude Code's builtin permission system, however, built-in tools that are not in the currently active toolset are not even sent to the model. As a result, Claude has no idea of tools that are not enabled in the current toolset (unless they happen to be mentioned in other parts of the system prompt), and it's not able to call them.
|
|
174
664
|
|
|
175
|
-
Toolsets can be helpful both for using Claude in different modes, e.g. a research mode where you might only include `WebFetch` and `WebSearch`, and for
|
|
665
|
+
Toolsets can be helpful both for using Claude in different modes, e.g. a research mode where you might only include `WebFetch` and `WebSearch`, and for reducing the size of your system prompt by trimming out tools you don't ever want Claude to call. The description of each tool call is placed in the system prompt (see [here](https://github.com/Piebald-AI/claude-code-system-prompts#builtin-tool-descriptions)), and if there are multiple tools you don't care about (like `Skill`, `SlashCommand`, `BashOutput`, etc.), the accumulated size of their descriptions and parameters can bloat the context by several thousand tokens.
|
|
666
|
+
|
|
667
|
+
To create a toolset, run `npx tweakcc`, go to `Toolsets`, and hit `n` to create a new toolset. Set a name and enable/disable some tools, run `tweakcc --apply` to apply your customizations, and then run `claude`. If you marked a toolset as the default in tweakcc, it will be automatically selected.
|
|
668
|
+
|
|
669
|
+
## Feature: Thinking verbs customization
|
|
670
|
+
|
|
671
|
+
Customize the thinking verbs that appear while Claude is generating responses, along with the format string. You can change from the default `"Thinking… "` format to something more fun like `"Claude is {verb}ing..."` or anything else you prefer.
|
|
672
|
+
|
|
673
|
+
Here's a demo showing a custom thinking verb format in action:
|
|
674
|
+
|
|
675
|
+

|
|
676
|
+
|
|
677
|
+
To customize thinking verbs, you can use the tweakcc UI or edit [`~/.tweakcc/config.json`](#configuration-directory) manually.
|
|
678
|
+
|
|
679
|
+
**Via the UI:**
|
|
680
|
+
|
|
681
|
+
1. Run `npx tweakcc`
|
|
682
|
+
2. Navigate to the **"Thinking verbs"** section
|
|
683
|
+
3. Use the tab key to switch between **Format** and **Verbs** sections
|
|
684
|
+
4. Edit the format string: the `{}` placeholder will be replaced with a randomly selected verb
|
|
685
|
+
5. Add, edit, or remove verbs from the list
|
|
686
|
+
6. Apply changes when satisfied
|
|
687
|
+
|
|
688
|
+
**Via `config.json`:**
|
|
689
|
+
|
|
690
|
+
In `.settings.thinkingVerbs`, configure the `format` and `verbs`:
|
|
691
|
+
|
|
692
|
+
```json
|
|
693
|
+
"thinkingVerbs": {
|
|
694
|
+
"format": "{}… ",
|
|
695
|
+
"verbs": [
|
|
696
|
+
"Accomplishing",
|
|
697
|
+
"Baking",
|
|
698
|
+
"Cogitating",
|
|
699
|
+
"Fermenting",
|
|
700
|
+
"Moonwalking",
|
|
701
|
+
"Noodling"
|
|
702
|
+
]
|
|
703
|
+
}
|
|
704
|
+
```
|
|
705
|
+
|
|
706
|
+
Here's the schema:
|
|
707
|
+
|
|
708
|
+
```typescript
|
|
709
|
+
{
|
|
710
|
+
format: string; // Format string, use {} as placeholder for the verb
|
|
711
|
+
verbs: string[]; // Array of verbs (Claude randomly selects one)
|
|
712
|
+
}
|
|
713
|
+
```
|
|
714
|
+
|
|
715
|
+
**Examples of different formats:**
|
|
716
|
+
|
|
717
|
+
- Default format: `"{}… "` → displays as `"Thinking… "`
|
|
718
|
+
- Custom format: `"Claude is {verb}ing..."` → displays as `"Claude is Baking..."`
|
|
719
|
+
- Custom format: `"✻ {verb} (generating)"` → displays as `"✻ Baking (generating)"`
|
|
720
|
+
- Custom format: `"<{verb}> "` → displays as `"<Baking> "`
|
|
721
|
+
|
|
722
|
+
**Reset to defaults:**
|
|
723
|
+
|
|
724
|
+
To reset to the default verbs and format, run `npx tweakcc`, navigate to **Thinking verbs**, and press `Ctrl+R` to restore defaults (which include 200+ fun verbs like "Beboppin'", "Fermenting", "Moonwalking", etc.).
|
|
725
|
+
|
|
726
|
+
## Feature: Thinking indicator customizations
|
|
727
|
+
|
|
728
|
+
Customize the thinking indicator (spinner) animation that appears alongside the thinking verb. You can change the animation phases, speed, and whether it reverses direction.
|
|
729
|
+
|
|
730
|
+
The thinking indicator consists of a sequence of characters that cycle through while Claude is thinking, displayed alongside the thinking verb (e.g., `Thinking·` → `Thinking✢` → `Thinking✳` → etc.).
|
|
731
|
+
|
|
732
|
+
**Via `config.json`:**
|
|
733
|
+
|
|
734
|
+
In `.settings.thinkingStyle`, configure the animation:
|
|
735
|
+
|
|
736
|
+
```json
|
|
737
|
+
"thinkingStyle": {
|
|
738
|
+
"updateInterval": 120,
|
|
739
|
+
"phases": [
|
|
740
|
+
"·",
|
|
741
|
+
"✢",
|
|
742
|
+
"✳",
|
|
743
|
+
"✶",
|
|
744
|
+
"✻",
|
|
745
|
+
"✽"
|
|
746
|
+
],
|
|
747
|
+
"reverseMirror": true
|
|
748
|
+
}
|
|
749
|
+
```
|
|
750
|
+
|
|
751
|
+
Here's the schema:
|
|
752
|
+
|
|
753
|
+
```typescript
|
|
754
|
+
{
|
|
755
|
+
updateInterval: number; // Animation speed in milliseconds (lower = faster)
|
|
756
|
+
phases: string[]; // Array of characters that cycle through
|
|
757
|
+
reverseMirror: boolean; // Whether to reverse the animation sequence
|
|
758
|
+
}
|
|
759
|
+
```
|
|
760
|
+
|
|
761
|
+
**Examples of different animations:**
|
|
762
|
+
|
|
763
|
+
| Animation | Phases | Description |
|
|
764
|
+
| --------------- | ---------------------------------------------------- | ---------------------------- |
|
|
765
|
+
| Default stars | `['·', '✢', '✳', '✶', '✻', '✽']` | Classic star burst animation |
|
|
766
|
+
| Simple dots | `['.', '..', '...']` | Classic loading dots |
|
|
767
|
+
| Braille spinner | `['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏']` | Braille-style spinner |
|
|
768
|
+
| Arrow spinner | `['←', '↖', '↑', '↗', '→', '↘', '↓', '↙']` | Rotating arrow |
|
|
769
|
+
| Minimal | `['○', '◐', '◑', '●']` | Minimal circle animation |
|
|
770
|
+
|
|
771
|
+
**Speed customization:**
|
|
772
|
+
|
|
773
|
+
- `updateInterval: 60` → Very fast animation (60ms per phase)
|
|
774
|
+
- `updateInterval: 120` → Default speed (120ms per phase)
|
|
775
|
+
- `updateInterval: 250` → Slower animation (250ms per phase)
|
|
776
|
+
|
|
777
|
+
## Feature: Input pattern highlighters
|
|
778
|
+
|
|
779
|
+
For a few weeks, when you typed the word "ultrathink" into the Claude Code input box, it would be highlighted rainbow. That's gone now, but the underlying highlighting infrastructure is still present in Claude Code today, and tweakcc lets you specify custom highlighters comprised of a **regular expression**, **format string**, and **colors & styling**.
|
|
780
|
+
|
|
781
|
+
Here's a demo where every word is assigned a different color based on its first letter:
|
|
782
|
+
|
|
783
|
+

|
|
784
|
+
|
|
785
|
+
Here's one where various common patterns like environment variables, file paths, numbers, and markdown constructs are highlighted:
|
|
786
|
+
|
|
787
|
+

|
|
788
|
+
|
|
789
|
+
Finally, here's one showing how you can render extra characters that aren't really part of the prompt by customizing the **format string**. The first line shows a copy of what I've actually got typed into the prompt, and in the prompt itself you can see that `cluade` was _visually_ (but not _in reality_) replaced with `Claude Code, ...`, etc.
|
|
790
|
+
|
|
791
|
+

|
|
792
|
+
|
|
793
|
+
To add some patterns, you can use the tweakcc UI or edit [`~/.tweakcc/config.json`](#configuration-directory) manually.
|
|
794
|
+
|
|
795
|
+
**Via the UI:**
|
|
796
|
+
|
|
797
|
+
| Listing | Edit |
|
|
798
|
+
| ----------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
|
|
799
|
+
|  |  |
|
|
800
|
+
|
|
801
|
+
**Via `config.json`:**
|
|
802
|
+
|
|
803
|
+
In `.settings.inputPatternHighlighters` (an array), add a new object:
|
|
804
|
+
|
|
805
|
+
```json
|
|
806
|
+
"inputPatternHighlighters": [
|
|
807
|
+
...
|
|
808
|
+
{
|
|
809
|
+
"name": "File path",
|
|
810
|
+
"regex": "(?:[a-zA-Z]:)?[/\\\\]?[a-zA-Z0-9._\\-]+(?:[/\\\\][a-zA-Z0-9._\\-]+)+",
|
|
811
|
+
"regexFlags": "g",
|
|
812
|
+
"format": "{MATCH}",
|
|
813
|
+
"styling": [
|
|
814
|
+
"bold"
|
|
815
|
+
],
|
|
816
|
+
"foregroundColor": "rgb(71,194,10)",
|
|
817
|
+
"backgroundColor": null,
|
|
818
|
+
"enabled": true
|
|
819
|
+
},
|
|
820
|
+
]
|
|
821
|
+
```
|
|
822
|
+
|
|
823
|
+
Here's the schema for the object format:
|
|
824
|
+
|
|
825
|
+
```typescript
|
|
826
|
+
{
|
|
827
|
+
name: string; // User-friendly name
|
|
828
|
+
regex: string; // Regex pattern (stored as string)
|
|
829
|
+
regexFlags: string; // Flags for the regex, must include 'g' for matchAll
|
|
830
|
+
format: string; // Format string, use {MATCH} as placeholder
|
|
831
|
+
styling: string[]; // ['bold', 'italic', 'underline', 'strikethrough', 'inverse']
|
|
832
|
+
foregroundColor: string | null; // null = don't specify, otherwise rgb(r,g,b)
|
|
833
|
+
backgroundColor: string | null; // null = don't specify, otherwise rgb(r,g,b)
|
|
834
|
+
enabled: boolean; // Temporarily disable this pattern
|
|
835
|
+
}
|
|
836
|
+
```
|
|
837
|
+
|
|
838
|
+
## Feature: Opus Plan 1M mode
|
|
839
|
+
|
|
840
|
+
tweakcc adds support for a new model alias: **`opusplan[1m]`**. This combines the best of both worlds:
|
|
841
|
+
|
|
842
|
+
- **Plan mode**: Uses **Opus 4.5** for complex reasoning and architecture decisions
|
|
843
|
+
- **Execution mode**: Uses **Sonnet 4.5 with 1M context** for code generation
|
|
844
|
+
|
|
845
|
+
#### Why use this?
|
|
176
846
|
|
|
177
|
-
|
|
847
|
+
Claude Sonnet 4.5 is aware of its context window, so when it gets close to full, the model exhibits [context anxiety](https://cognition.ai/blog/devin-sonnet-4-5-lessons-and-challenges), where it thinks there may not be enough context to complete the given task, so it takes shortcuts or leaves subtasks incomplete.
|
|
848
|
+
|
|
849
|
+
By using the 1M context model, Claude thinks it has plenty of room and doesn't skip things, and as long as you ensure you stay under 200k tokens you'll be charged the normal input/output rates even though you're using the 1M model. However, once you exceed 200k tokens when using the 1M model, you'll be automatically charged premium rates (2x for input tokens and 1.5x for output tokens)—see [the 1M context window docs](https://platform.claude.com/docs/en/build-with-claude/context-windows#1-m-token-context-window).
|
|
850
|
+
|
|
851
|
+
#### How to use it
|
|
852
|
+
|
|
853
|
+
After applying tweakcc patches, you can use `opusplan[1m]` like any other model alias:
|
|
854
|
+
|
|
855
|
+
```bash
|
|
856
|
+
# Via CLI flag
|
|
857
|
+
claude --model opusplan[1m]
|
|
858
|
+
|
|
859
|
+
# Or set it permanently via /model command in Claude Code
|
|
860
|
+
/model opusplan[1m]
|
|
861
|
+
```
|
|
862
|
+
|
|
863
|
+
| Mode | Model Used | Context Window |
|
|
864
|
+
| --------------------------- | ---------- | -------------- |
|
|
865
|
+
| Plan mode (Shift+Tab twice) | Opus 4.5 | 200k |
|
|
866
|
+
| Execution mode (default) | Sonnet 4.5 | **1M** |
|
|
867
|
+
|
|
868
|
+
## Feature: MCP startup optimization
|
|
869
|
+
|
|
870
|
+
If you use multiple MCP servers, Claude Code's startup can be slow—waiting 10-15+ seconds for all servers to connect before you can start typing.
|
|
871
|
+
|
|
872
|
+
tweakcc fixes this with two optimizations (based on [this blog post](https://cuipengfei.is-a.dev/blog/2026/01/24/claude-code-mcp-startup-optimization/)):
|
|
873
|
+
|
|
874
|
+
1. **Non-blocking MCP connections** (enabled by default): Start typing immediately while MCP servers connect in the background
|
|
875
|
+
2. **Configurable batch size**: Connect more servers in parallel (default: 3, configurable from 1-20)
|
|
876
|
+
|
|
877
|
+
#### Results
|
|
878
|
+
|
|
879
|
+
| Configuration | Startup Time | Improvement |
|
|
880
|
+
| ------------------- | ------------ | --------------- |
|
|
881
|
+
| Default Claude Code | ~15s | — |
|
|
882
|
+
| With non-blocking | ~7s | **~50% faster** |
|
|
883
|
+
|
|
884
|
+
#### Configuration
|
|
885
|
+
|
|
886
|
+
**Via the UI:** Run `npx tweakcc`, go to **Misc**, and adjust:
|
|
887
|
+
|
|
888
|
+
- **Non-blocking MCP startup** — Toggle on/off (default: on)
|
|
889
|
+
- **MCP server batch size** — Use ←/→ arrows to adjust (1-20)
|
|
890
|
+
|
|
891
|
+
**Via `config.json`:**
|
|
892
|
+
|
|
893
|
+
```json
|
|
894
|
+
{
|
|
895
|
+
"settings": {
|
|
896
|
+
"misc": {
|
|
897
|
+
"mcpConnectionNonBlocking": true,
|
|
898
|
+
"mcpServerBatchSize": 8
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
```
|
|
903
|
+
|
|
904
|
+
| Setting | Default | Description |
|
|
905
|
+
| -------------------------- | ------------------------------- | --------------------------------------------- |
|
|
906
|
+
| `mcpConnectionNonBlocking` | `true` | Start immediately, connect MCPs in background |
|
|
907
|
+
| `mcpServerBatchSize` | `null` (uses CC's default of 3) | Number of parallel MCP connections (1-20) |
|
|
908
|
+
|
|
909
|
+
## Feature: Table format
|
|
910
|
+
|
|
911
|
+
Recent Claude Code versions render tables using Unicode box-drawing characters. While these have a more elegant look compared to the traditional plain markdown table rendering, they take up more room due to the row dividers:
|
|
912
|
+
|
|
913
|
+
**`default`** — Original box-drawing with all row separators:
|
|
914
|
+
|
|
915
|
+
```
|
|
916
|
+
┌───────────┬───────────────────────────────┬───────┐
|
|
917
|
+
│ Library │ Purpose │ Size │
|
|
918
|
+
├───────────┼───────────────────────────────┼───────┤
|
|
919
|
+
│ React │ UI components, virtual DOM │ ~40kb │
|
|
920
|
+
├───────────┼───────────────────────────────┼───────┤
|
|
921
|
+
│ Vue │ Progressive framework │ ~34kb │
|
|
922
|
+
├───────────┼───────────────────────────────┼───────┤
|
|
923
|
+
│ Svelte │ Compile-time framework │ ~2kb │
|
|
924
|
+
└───────────┴───────────────────────────────┴───────┘
|
|
925
|
+
```
|
|
926
|
+
|
|
927
|
+
tweakcc provides three alternative formats:
|
|
928
|
+
|
|
929
|
+
**`ascii`** — ASCII/Markdown style using `|` and `-` (easy to copy-paste):
|
|
930
|
+
|
|
931
|
+
```
|
|
932
|
+
| Library | Purpose | Size |
|
|
933
|
+
|-----------|-------------------------------|-------|
|
|
934
|
+
| React | UI components, virtual DOM | ~40kb |
|
|
935
|
+
| Vue | Progressive framework | ~34kb |
|
|
936
|
+
| Svelte | Compile-time framework | ~2kb |
|
|
937
|
+
```
|
|
938
|
+
|
|
939
|
+
**`clean`** — Box-drawing without top/bottom borders or row separators:
|
|
940
|
+
|
|
941
|
+
```
|
|
942
|
+
│ Library │ Purpose │ Size │
|
|
943
|
+
├───────────┼───────────────────────────────┼───────┤
|
|
944
|
+
│ React │ UI components, virtual DOM │ ~40kb │
|
|
945
|
+
│ Vue │ Progressive framework │ ~34kb │
|
|
946
|
+
│ Svelte │ Compile-time framework │ ~2kb │
|
|
947
|
+
```
|
|
948
|
+
|
|
949
|
+
**`clean-top-bottom`** — Box-drawing with top/bottom borders but no row separators:
|
|
950
|
+
|
|
951
|
+
```
|
|
952
|
+
┌───────────┬───────────────────────────────┬───────┐
|
|
953
|
+
│ Library │ Purpose │ Size │
|
|
954
|
+
├───────────┼───────────────────────────────┼───────┤
|
|
955
|
+
│ React │ UI components, virtual DOM │ ~40kb │
|
|
956
|
+
│ Vue │ Progressive framework │ ~34kb │
|
|
957
|
+
│ Svelte │ Compile-time framework │ ~2kb │
|
|
958
|
+
└───────────┴───────────────────────────────┴───────┘
|
|
959
|
+
```
|
|
960
|
+
|
|
961
|
+
**Via the UI:** Run `npx tweakcc`, go to `Misc`, and cycle through the **Table format** options with spacebar. Then apply your customizations.
|
|
962
|
+
|
|
963
|
+
**Via `config.json`:**
|
|
964
|
+
|
|
965
|
+
```json
|
|
966
|
+
{
|
|
967
|
+
"settings": {
|
|
968
|
+
"misc": {
|
|
969
|
+
"tableFormat": "ascii"
|
|
970
|
+
}
|
|
971
|
+
}
|
|
972
|
+
}
|
|
973
|
+
```
|
|
974
|
+
|
|
975
|
+
Valid values are `"default"`, `"ascii"`, `"clean"`, and `"clean-top-bottom"`.
|
|
976
|
+
|
|
977
|
+
## Feature: Swarm mode (native multi-agent)
|
|
978
|
+
|
|
979
|
+
Claude Code 2.1.16+ includes native multi-agent features that are gated behind the `tengu_brass_pebble` Statsig flag. tweakcc patches this gate to enable these features for everyone.
|
|
980
|
+
|
|
981
|
+

|
|
982
|
+

|
|
983
|
+
|
|
984
|
+
**Features unlocked:**
|
|
985
|
+
|
|
986
|
+
| Feature | Description |
|
|
987
|
+
| -------------------- | ---------------------------------------------------------- |
|
|
988
|
+
| **TeammateTool** | Tool for spawning and coordinating teammate agents |
|
|
989
|
+
| **Delegate mode** | Task tool mode option for delegating work |
|
|
990
|
+
| **Swarm spawning** | `launchSwarm` + `teammateCount` parameters in ExitPlanMode |
|
|
991
|
+
| **Teammate mailbox** | Inter-agent messaging system |
|
|
992
|
+
| **Task teammates** | Task list teammate display and coordination |
|
|
993
|
+
|
|
994
|
+
**Enable/disable**
|
|
995
|
+
|
|
996
|
+
**Via the UI:** Run `npx tweakcc`, go to **Misc**, and check/uncheck **Enable swarm mode (native multi-agent)**. Then **Apply customizations**.
|
|
997
|
+
|
|
998
|
+
**Via `config.json`:**
|
|
999
|
+
|
|
1000
|
+
```json
|
|
1001
|
+
{
|
|
1002
|
+
"settings": {
|
|
1003
|
+
"misc": {
|
|
1004
|
+
"enableSwarmMode": true
|
|
1005
|
+
}
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
1008
|
+
```
|
|
1009
|
+
|
|
1010
|
+
## Feature: Token count rounding
|
|
1011
|
+
|
|
1012
|
+
In the generation status, where the thinking verb is displayed, e.g. `✻ Improvising… (35s · ↓ 279 tokens)`, the token count estimate will increase very rapidly at times. While it's helpful to know that the connection isn't stalled, such frequent UI updates can cause rendering issues in slow terminals, and if Claude Code is being run from a network, frequent updates can clog the network.
|
|
1013
|
+
|
|
1014
|
+
tweakcc can automatically round the token counters to the nearest multiple of a custom base number. For example, here are two demo clips showing the token count rounded to multiples of 50, and multiples of 1000:
|
|
1015
|
+
|
|
1016
|
+
| Description | GIF |
|
|
1017
|
+
| --------------------- | -------------------------------------------- |
|
|
1018
|
+
| **Multiples of 50** |  |
|
|
1019
|
+
| **Multiples of 1000** |  |
|
|
1020
|
+
|
|
1021
|
+
**Configuration via UI:** Go to _Misc → Token count rounding_ towards the bottom.
|
|
1022
|
+
|
|
1023
|
+

|
|
1024
|
+
|
|
1025
|
+
**Configuration via `config.json`:** While the tweakcc UI only allows common values like 10, 25, 500, 1000, etc., you can use any integer value for the setting itself in `config.json`. Open `~/.tweakcc/config.json` and set the `settings.misc.tokenCountRounding` field to your desired rounding base:
|
|
1026
|
+
|
|
1027
|
+
```json
|
|
1028
|
+
{
|
|
1029
|
+
"settings": {
|
|
1030
|
+
"misc": {
|
|
1031
|
+
"tokenCountRounding": 123
|
|
1032
|
+
}
|
|
1033
|
+
}
|
|
1034
|
+
}
|
|
1035
|
+
```
|
|
1036
|
+
|
|
1037
|
+
Now token counts will be rounded to the nearest multiple of 123, e.g. 123, 246, 369, etc.
|
|
1038
|
+
|
|
1039
|
+
## Feature: Statusline update customization
|
|
1040
|
+
|
|
1041
|
+
Claude Code's statusline feature operates by running a specific command (e.g. a shell script) whenever the conversation history changes (i.e., a message is added), capturing the command's output—including ANSI escape codes for coloring—and rendering it in Claude Code under the input box.
|
|
1042
|
+
|
|
1043
|
+
It's neat functionality but the updates occur at what appear to be sporadic intervals. According to [the docs](https://code.claude.com/docs/en/statusline#:~:text=Updates%20run%20at%20most%20every%20300%20ms), _"Updates run at most every 300 ms,"_ but this is inaccurate—technically, updates are _queued_ for 300 milliseconds, meaning an update is triggered each time the chat history is updated, but is then delayed before execution for 300ms.
|
|
1044
|
+
|
|
1045
|
+
In the majority of cases, this behavior is fine. However, if you have a specialized use case, you may need updates to be throttled at 300ms like the documentation states, or even have updates automatically triggered at a specific interval.
|
|
1046
|
+
|
|
1047
|
+
tweakcc can patch Claude Code to correct this erratic queuing behavior, making it properly throttle updates at a customizable interval. It can also pace the updating, making it be performed at a regular interval, independent of changes to the chat history.
|
|
1048
|
+
|
|
1049
|
+
Here are two demos showing 1) updates triggered every 150ms, and 2) updates triggered by history updates, throttled at 1s. The `update = X` is a custom statusline, where _X_ increments each time the statusline is re-rendered.
|
|
1050
|
+
|
|
1051
|
+
| 150ms interval | 1000ms throttling |
|
|
1052
|
+
| -------------------------------------------------- | ----------------------------------------------- |
|
|
1053
|
+
|  |  |
|
|
1054
|
+
|
|
1055
|
+
**Configuration via UI:** Go to _Misc → Statusline throttle_
|
|
1056
|
+
|
|
1057
|
+

|
|
1058
|
+
|
|
1059
|
+
**Configuration via `config.json`:** While the tweakcc UI only allows increments of 50ms for the statusline update interval, you can use any integer value for it by editing `config.json`. Open `~/.tweakcc/config.json` and set the `settings.misc.statuslineThrottleMs` field to your desired interval, and set `settings.misc.statuslineUseFixedInterval` to `true` for a fixed-pace interval or `false` for throttling.
|
|
1060
|
+
|
|
1061
|
+
```json
|
|
1062
|
+
{
|
|
1063
|
+
"settings": {
|
|
1064
|
+
"misc": {
|
|
1065
|
+
"statuslineThrottleMs": 500,
|
|
1066
|
+
"statuslineUseFixedInterval": false
|
|
1067
|
+
}
|
|
1068
|
+
}
|
|
1069
|
+
}
|
|
1070
|
+
```
|
|
1071
|
+
|
|
1072
|
+
## Feature: AGENTS.md support
|
|
1073
|
+
|
|
1074
|
+
<sub><i>Supported Claude Code versions: 1.0.24 (and likely older) to 2.1.32+.</i></sub>
|
|
1075
|
+
|
|
1076
|
+
Claude Code is the only coding agent that doesn't support `AGENTS.md`; it only supports `CLAUDE.md` and `CLAUDE.local.md`. ([This issue](https://github.com/anthropics/claude-code/issues/6235) has over 2200 upvotes.) tweakcc automatically patches Claude Code to fall back to `AGENTS.md` and several others when `CLAUDE.md` doesn't exist.
|
|
1077
|
+
|
|
1078
|
+
The patch happens automatically, with a default set of `AGENTS.md`, `GEMINI.md`, `CRUSH.md`, `QWEN.md`, `IFLOW.md`, `WARP.md`, and `copilot-instructions.md`—you don't need to configure it specifically. However, if you'd like to support other file names, you can do so easily:
|
|
1079
|
+
|
|
1080
|
+
**Via UI:** Run `npx tweakcc@latest` and go to `CLAUDE.md alternate names`. Use <kbd>e</kbd> to edit a name, <kbd>d</kbd> to delete one, <kbd>n</kbd> to add a new one, <kbd>u</kbd>/<kbd>j</kbd> to move one up/down, and <kbd>ctrl + r</kbd> to reset to the default list mentioned above:
|
|
1081
|
+
|
|
1082
|
+

|
|
1083
|
+
|
|
1084
|
+
**Via `config.json`:** To configure the list of alternate `CLAUDE.md` names headlessly, set `settings.claudeMdAltNames` to a list of your desired names, in descending order of priority:
|
|
1085
|
+
|
|
1086
|
+
```json
|
|
1087
|
+
{
|
|
1088
|
+
"settings": {
|
|
1089
|
+
"claudeMdAltNames": ["AGENTS.md", "context.md"]
|
|
1090
|
+
}
|
|
1091
|
+
}
|
|
1092
|
+
```
|
|
1093
|
+
|
|
1094
|
+
Note that `CLAUDE.md` is always used above all alternatives when it's available, so it's not required to include it in the list.
|
|
1095
|
+
|
|
1096
|
+
Here's a demo video of `AGENTS.md` working:
|
|
1097
|
+
|
|
1098
|
+
https://github.com/user-attachments/assets/27513489-bb89-4174-b62f-ab17b0fce7bd
|
|
1099
|
+
|
|
1100
|
+
## Feature: Bypass permissions check in sudo
|
|
1101
|
+
|
|
1102
|
+
⚠️ **Warning**: This feature disables a security check. Only enable it if you understand the implications.
|
|
1103
|
+
|
|
1104
|
+
By default, Claude Code prevents the use of `--dangerously-skip-permissions` when running under `sudo` to avoid accidental system-wide permission bypasses. This patch removes that restriction.
|
|
1105
|
+
|
|
1106
|
+
**Why you might need this**: Some system administration tasks or automated deployment scripts may require running Claude Code with elevated privileges while also bypassing permission checks. For example, when deploying to restricted directories or modifying system configuration files.
|
|
1107
|
+
|
|
1108
|
+
**Security implications**: When enabled, you can run Claude Code with sudo and bypass permission checks, potentially allowing Claude to perform system-level operations without prompts. Use extreme caution.
|
|
1109
|
+
|
|
1110
|
+
**Via the UI:** Run `npx tweakcc`, go to **Misc**, and toggle **Allow bypass permissions in sudo**.
|
|
1111
|
+
|
|
1112
|
+
**Via `config.json`:**
|
|
1113
|
+
|
|
1114
|
+
```json
|
|
1115
|
+
{
|
|
1116
|
+
"settings": {
|
|
1117
|
+
"misc": {
|
|
1118
|
+
"allowBypassPermissionsInSudo": true
|
|
1119
|
+
}
|
|
1120
|
+
}
|
|
1121
|
+
}
|
|
1122
|
+
```
|
|
1123
|
+
|
|
1124
|
+
**Usage:**
|
|
1125
|
+
|
|
1126
|
+
`sudo claude --dangerously-skip-permissions`
|
|
1127
|
+
|
|
1128
|
+
## Feature: Auto-accept plan mode
|
|
1129
|
+
|
|
1130
|
+
<sub><i>Supported Claude Code versions: 2.1.22 to 2.1.32+.</i></sub>
|
|
1131
|
+
|
|
1132
|
+
When Claude finishes writing a plan and calls `ExitPlanMode`, you're normally shown a "Ready to code?" dialog with options to approve or continue editing. This patch automatically selects "Yes, clear context and auto-accept edits" without requiring user interaction.
|
|
1133
|
+
|
|
1134
|
+
**Via UI:** Run `npx tweakcc@latest` and navigate to `Miscellaneous Settings`. Scroll down to find `Auto-accept plan mode` and press space to enable it.
|
|
1135
|
+
|
|
1136
|
+
**Via `config.json`:** Set `settings.misc.autoAcceptPlanMode` to `true`:
|
|
1137
|
+
|
|
1138
|
+
```json
|
|
1139
|
+
{
|
|
1140
|
+
"settings": {
|
|
1141
|
+
"misc": {
|
|
1142
|
+
"autoAcceptPlanMode": true
|
|
1143
|
+
}
|
|
1144
|
+
}
|
|
1145
|
+
}
|
|
1146
|
+
```
|
|
1147
|
+
|
|
1148
|
+
## Feature: Suppress native installer warning
|
|
1149
|
+
|
|
1150
|
+
When Claude Code detects that you've installed via npm, it warns you to use the native installer.
|
|
1151
|
+
**Via the UI:** Run `npx tweakcc`, go to **Misc**, and toggle **Suppress native installer warning**.
|
|
1152
|
+
|
|
1153
|
+
**Via `config.json`:**
|
|
1154
|
+
|
|
1155
|
+
```json
|
|
1156
|
+
{
|
|
1157
|
+
"settings": {
|
|
1158
|
+
"misc": {
|
|
1159
|
+
"suppressNativeInstallerWarning": true
|
|
1160
|
+
}
|
|
1161
|
+
}
|
|
1162
|
+
}
|
|
1163
|
+
```
|
|
1164
|
+
|
|
1165
|
+
## Feature: Scroll escape sequence filter
|
|
1166
|
+
|
|
1167
|
+
Some terminals may experience unwanted scrolling behavior caused by certain cursor positioning escape sequences (e.g., `\x1b[H` and `\x1b[A`). This patch filters out these problematic escape sequences from Claude Code's output to prevent scrolling issues.
|
|
1168
|
+
|
|
1169
|
+
**Via the UI:** Run `npx tweakcc`, go to **Misc**, and toggle **Filter scroll escape sequences**.
|
|
1170
|
+
|
|
1171
|
+
**Via `config.json`:**
|
|
1172
|
+
|
|
1173
|
+
```json
|
|
1174
|
+
{
|
|
1175
|
+
"settings": {
|
|
1176
|
+
"misc": {
|
|
1177
|
+
"filterScrollEscapeSequences": true
|
|
1178
|
+
}
|
|
1179
|
+
}
|
|
1180
|
+
}
|
|
1181
|
+
```
|
|
1182
|
+
|
|
1183
|
+
## Configuration directory
|
|
1184
|
+
|
|
1185
|
+
tweakcc stores its configuration files in one of the following locations, in order of priority:
|
|
1186
|
+
|
|
1187
|
+
1. **`TWEAKCC_CONFIG_DIR`** environment variable if set, or
|
|
1188
|
+
2. **`~/.tweakcc/`** if it exists, or
|
|
1189
|
+
3. **`~/.claude/tweakcc`** if it exists, or
|
|
1190
|
+
4. **`$XDG_CONFIG_HOME/tweakcc`** if the `XDG_CONFIG_HOME` environment variable is set.
|
|
1191
|
+
|
|
1192
|
+
If none of the above exist, `~/.tweakcc` will be created and used. If you version control `~/.claude` for Claude Code configuration and want your tweakcc config and system prompts there too, then manually create the directory first, or move your existing `~/.tweakcc` directory there:
|
|
1193
|
+
|
|
1194
|
+
```bash
|
|
1195
|
+
# For new users
|
|
1196
|
+
mkdir -p ~/.claude/tweakcc
|
|
1197
|
+
|
|
1198
|
+
# For existing users
|
|
1199
|
+
mv ~/.tweakcc ~/.claude/tweakcc
|
|
1200
|
+
```
|
|
1201
|
+
|
|
1202
|
+
## Building from source
|
|
1203
|
+
|
|
1204
|
+
You can use tweakcc by running `npx tweakcc`, or `npm install -g tweakcc` and then `tweakcc`. Or build and run it locally:
|
|
1205
|
+
|
|
1206
|
+
```bash
|
|
1207
|
+
git clone https://github.com/Piebald-AI/tweakcc.git
|
|
1208
|
+
cd tweakcc
|
|
1209
|
+
pnpm i
|
|
1210
|
+
pnpm build
|
|
1211
|
+
node dist/index.mjs
|
|
1212
|
+
```
|
|
178
1213
|
|
|
179
1214
|
## Troubleshooting
|
|
180
1215
|
|
|
181
1216
|
tweakcc stores a backup of your Claude Code `cli.js`/binary for when you want to revert your customizations and for reapplying patches. Before it applies your customizations, it restores the original `cli.js`/binary so that it can start from a clean slate. Sometimes things can get confused and your `claude` can be corrupted.
|
|
182
1217
|
|
|
183
|
-
In particular, you may run into a situation where you have a tweakcc-patched (or maybe a formatted) `claude` but no tweakcc backup. And then it makes a backup of that modified `claude`. If you then try to reinstall Claude Code and apply your customizations, tweakcc will restore its backup of the old _modified_ `claude`.
|
|
1218
|
+
In particular, you may run into a situation where you have a tweakcc-patched (or maybe a prettier-formatted) `claude` but no tweakcc backup. And then it makes a backup of that modified `claude`. If you then try to reinstall Claude Code and apply your customizations, tweakcc will restore its backup of the old _modified_ `claude`.
|
|
184
1219
|
|
|
185
1220
|
To break out of this loop you can install a different version of Claude Code, which will cause tweakcc to discard its existing backup and take a fresh backup of the new `claude` file. Or you can simply delete tweakcc's backup file (located at `~/.tweakcc/cli.backup.js` or `~/.tweakcc/native-binary.backup`). If you do delete `cli.backup.js` or `native-binary.backup`, make sure you reinstall Claude Code _before_ you run tweakcc again, because if your `claude` is still the modified version, it will get into the same loop again.
|
|
186
1221
|
|
|
@@ -241,8 +1276,36 @@ Could you have forgotten to actually set Claude Code's theme to your new theme?
|
|
|
241
1276
|
|
|
242
1277
|
</details>
|
|
243
1278
|
|
|
1279
|
+
## Contributing
|
|
1280
|
+
|
|
1281
|
+
Contributions are welcome! Whether you're fixing a bug, adding a new feature, improving documentation, or adding tests, we appreciate your help.
|
|
1282
|
+
|
|
1283
|
+
For detailed guidelines on development setup, code style, testing, and submitting pull requests, see the [CONTRIBUTING.md](https://github.com/Piebald-AI/tweakcc/blob/main/CONTRIBUTING.md) file.
|
|
1284
|
+
|
|
1285
|
+
**Quick Start:**
|
|
1286
|
+
|
|
1287
|
+
1. Fork the repository and create a new branch
|
|
1288
|
+
2. Make your changes following the code style guidelines
|
|
1289
|
+
3. Run tests and linting: `pnpm test && pnpm lint`
|
|
1290
|
+
4. Submit a pull request with a clear description
|
|
1291
|
+
|
|
1292
|
+
## Related projects
|
|
1293
|
+
|
|
1294
|
+
- [**cc-mirror**](https://github.com/numman-ali/cc-mirror) - Create multiple isolated Claude Code variants with custom providers (Z.ai, MiniMax, OpenRouter, LiteLLM). Uses tweakcc to customize system prompts, themes, thinking styles, and toolsets.
|
|
1295
|
+
|
|
1296
|
+
Other tools for customizing Claude Code or adding functionality to it:
|
|
1297
|
+
|
|
1298
|
+
- [**clotilde**](https://github.com/fgrehm/clotilde) - Wrapper for Claude Code that adds powerful manual session naming, resuming, forking, and incognito (ephemeral) session management to Claude Code.
|
|
1299
|
+
- [**ccstatusline**](https://github.com/sirmalloc/ccstatusline) - Highly customizable status line formatter for Claude Code CLI that displays model info, git branch, token usage, and other metrics in your terminal.
|
|
1300
|
+
- [**claude-powerline**](https://github.com/Owloops/claude-powerline) - Vim-style powerline statusline for Claude Code with real-time usage tracking, git integration, and custom themes.
|
|
1301
|
+
- [**CCometixLine**](https://github.com/Haleclipse/CCometixLine) - A high-performance Claude Code statusline tool written in Rust with Git integration, usage tracking, interactive TUI configuration, and Claude Code enhancement utilities.
|
|
1302
|
+
|
|
1303
|
+
Forks:
|
|
1304
|
+
|
|
1305
|
+
- [**tweakgc-cli**](https://github.com/DanielNappa/tweakgc-cli) - CLI tool to extend the GitHub Copilot CLI to accept more selectable models.
|
|
1306
|
+
|
|
244
1307
|
## License
|
|
245
1308
|
|
|
246
1309
|
[MIT](https://github.com/Piebald-AI/tweakcc/blob/main/LICENSE)
|
|
247
1310
|
|
|
248
|
-
Copyright ©
|
|
1311
|
+
Copyright © 2026 [Piebald LLC](https://piebald.ai).
|