patch-creation
Skill2.5k starsChanged 10 months agoMITView on GitHub
Create and register new patches for tweakcc. Use when adding new customizations to Claude Code.
Trending
Less talk lately.about the whole repository
Who's talking about Piebald-AI/tweakcc
- A Hacker News story“Tweakcc”Hacker News · Oct 23, 2025 · 22 points
- anthropics/claude-code“:rocket: Introducing tweakcc - customize your Claude Code installation”GitHub · Jul 25, 2025 · 8 reactions
- Ven0m0/claude-config“Add a structured external integration plan to the root TODO backlog”GitHub · Mar 18, 2026 · 4 reactions
- A Hacker News story“Show HN: tweakcc (OSS)–customize Claude Code's system prompt and LSP and /title”Hacker News · Nov 19, 2025 · 3 points
- A Hacker News story“Show HN: Tweakcc – Customize Claude Code's CLI (themes, verbs, spinner)”Hacker News · Aug 26, 2025 · 3 points
The biggest 5 of 25 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 25
Talked about on GitHub, Hacker News and Bluesky (25 times).
On GitHub · 19
- Jul 25, 2025:rocket: Introducing tweakcc - customize your Claude Code installation — anthropics/claude-code8 reactions · 6 comments
- Mar 18, 2026Add a structured external integration plan to the root TODO backlog — Ven0m0/claude-config4 reactions · 4 comments
- Mar 26, 2026tweakcc alternative to hooks — jgravelle/jcodemunch-mcp1 reaction · 5 comments
- Jan 31, 2026TODO list — Ven0m0/claude-config1 reaction · 18 comments
- Nov 18, 2025Build for Windows 11 arm64 — Piebald-AI/node-lief1 reaction · 1 comment
14 more on GitHub
- Nov 10, 2025Error: /lib64/libc.so.6: version `GLIBC_2.38' not found (required by node-lief.node) on Oracle Linux 9 — Piebald-AI/node-lief1 reaction · 1 comment
- Jul 25, 2025Add tweakcc — customize your Claude Code installation — hesreallyhim/awesome-claude-code1 reaction
- Oct 1, 2026agent-skills.github.piebald-ai.tweakcc: init at 4.3.3 — sudosubin/agents.nix0 reactions
- Aug 11, 2026launch: local API proxy to intercept/rewrite Claude Code's system prompt — phaedrus1992/llmenv0 reactions
- Jul 7, 2026fix(cc): pin tweakcc to v4.3.0 + native-binary startup smoke in validateFork — opencues/opencues0 reactions · 1 comment
- May 19, 2026Support for 2.1.144 — BenIsLegit/tweakcc-system-prompts-unnerfed0 reactions · 1 comment
- Apr 27, 2026feat(tweakcc): adopt llm-agents.nix updater pattern — Bad3r/nixos0 reactions · 3 comments
- Mar 26, 2026toc-native runtime: adopt patterns from Claude Code's prompt architecture — louismorgner/tiny-oc0 reactions
- Jan 13, 2026Feature request: Remove turn completion verbs — ominiverdi/claude-depester0 reactions · 1 comment
- Dec 2, 2025Explore tweakcc — PaulRBerg/dot-claude0 reactions
- Nov 22, 2025[FEATURE] Overridable Plan mode system prompt — anthropics/claude-code0 reactions · 5 comments
- Aug 27, 2025Add tweakcc - TUI to customize your Claude Code themes, thinking verbs, and more — rothgar/awesome-tuis0 reactions
- Jul 27, 2025Add tweakcc to Who's Using Ink? — vadimdemedes/ink0 reactions
- Jul 25, 2025Add tweakcc — jqueryscript/awesome-claude-code0 reactions · 2 comments
On Hacker News · 4
- Oct 23, 2025Tweakcc22 points · 3 comments
- Nov 19, 2025Show HN: tweakcc (OSS)–customize Claude Code's system prompt and LSP and /title3 points · 1 comment
- Aug 26, 2025Show HN: Tweakcc – Customize Claude Code's CLI (themes, verbs, spinner)3 points · 5 comments
- Oct 23, 2025Show HN: Customize Claude Code's System Prompt with Tweakcc1 point
On Bluesky · 2
- Mar 13, 2026I don't use claude code anymore but when I did the first thing I did was use tweakcc to change the system prompt. There's so much unwanted… — @jmcodes.bsky.social1 likes and repost
- Sep 15, 2025Claude CodeのテーマなどをカスタマイズできるCLIツール。brew install tweakcc — @matsuu.bsky.social1 likes and repost
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 3 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 131
When adding a new patch, update these locations:
- Very specific: line 152
Start patterns with boundary characters: - Use ,, ;, {, } at the start to dramatically speed up matching (can reduce 1.5s to 30ms)
- Very specific: line 158
Use
showDiff()for debugging: - Always call it to log what the patch is changing - Very specific: line 210
Run npm run build to compile
- Very specific: line 211
Run npx tweakcc --apply to apply patches
- Distinctive: line 212
Check console output for patch success/failure
- Distinctive: line 213
Run Claude Code to verify behavior
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Patch Creation & Registration
Overview
Patches are code modifications applied to Claude Code's cli.js (or native binary). Each patch finds specific patterns in the minified code and replaces/injects new behavior.
Creating a New Patch
1. Create the patch file
Create src/patches/myPatch.ts:
// Please see the note about writing patches in ./index
import { showDiff } from './index';
/**
* Description of what this patch does.
*
* CC X.Y.Z:
* ```diff
* // Show before/after of the code change
* -oldCode
* +newCode
* ```
*/
export const writeMyPatch = (
file: string,
configValue: string // Add parameters as needed
): string | null => {
// Pattern to find in minified code
// IMPORTANT: Use [$\w]+ for identifiers (not \w+) because $ is valid in JS identifiers
// IMPORTANT: Start patterns with a boundary char (,;}{) for HIGH performance (e.g. 1.5s -> 30ms)
const pattern = /,somePattern([$\w]+)/;
const match = file.match(pattern);
if (!match || match.index === undefined) {
console.error('patch: myPatch: failed to find pattern');
return null;
}
const replacement = `,newCode${match[1]}`;
const startIndex = match.index;
const endIndex = startIndex + match[0].length;
const newFile =
file.slice(0, startIndex) + replacement + file.slice(endIndex);
showDiff(file, newFile, replacement, startIndex, endIndex);
return newFile;
};2. Add config type (if patch is configurable)
Edit src/types.ts - add to MiscConfig or create a new interface:
export interface MiscConfig {
// ... existing fields ...
myNewSetting: string | null; // null = disabled
}3. Add default value
Edit src/defaultSettings.ts:
misc: {
// ... existing fields ...
myNewSetting: null, // or a sensible default
},4. Register in index.ts
Edit src/patches/index.ts:
4a. Add import:
import { writeMyPatch } from './myPatch';4b. Add patch definition (in PATCH_DEFINITIONS array):
{
id: 'my-patch',
name: 'My patch',
group: PatchGroup.FEATURES, // or ALWAYS_APPLIED, MISC_CONFIGURABLE
description: 'What this patch does for the user',
},4c. Add patch implementation (in patchImplementations object):
'my-patch': {
fn: c => writeMyPatch(c, config.settings.misc!.myNewSetting!),
condition: !!config.settings.misc?.myNewSetting,
},5. Add UI (optional)
Edit src/ui/components/MiscView.tsx to add a toggle or input for the setting.
Key Files
| File | Purpose |
src/patches/*.ts | Individual patch implementations |
src/patches/index.ts | Patch registry, definitions, and application logic |
src/types.ts | Config type definitions (MiscConfig, etc.) |
src/defaultSettings.ts | Default values for all settings |
src/ui/components/MiscView.tsx | UI for misc settings |
Registration Checklist
When adding a new patch, update these locations:
src/patches/myPatch.ts- Create the patch file with exported functionsrc/types.ts- Add config type (if configurable)src/defaultSettings.ts- Add default value (if configurable)src/patches/index.ts:- Import the patch function
- Add to
PATCH_DEFINITIONSarray (id, name, group, description) - Add to
patchImplementationsobject (fn, condition)
src/ui/components/MiscView.tsx- Add UI controls (optional)
Patch Groups
PatchGroup.ALWAYS_APPLIED- Core patches that are always appliedPatchGroup.MISC_CONFIGURABLE- User-configurable misc settingsPatchGroup.FEATURES- Feature patches that can be enabled/disabled
Pattern Writing Tips
- Use
[$\w]+for identifiers - Not\w+, because$is valid in JS identifiers and common in minified code - Start patterns with boundary characters - Use
,,;,{,}at the start to dramatically speed up matching (can reduce 1.5s to 30ms) - Don't use
\bfor word boundaries - It doesn't treat$as a word character, so\b[$\w]+won't match,$= - Extract function bodies carefully - Count braces to find matching
}when you need the full function - Use
showDiff()for debugging - Always call it to log what the patch is changing - Return
nullon failure - Let the patch system know the patch couldn't be applied - Handle multiple CC versions - Code patterns may change between versions; try multiple patterns if needed
Example: Simple Toggle Patch
// Bypass a feature flag check
const pattern = /function [$\w]+\(\)\{return [$\w]+\("my_feature_flag"/;
const match = file.match(pattern);
if (!match || match.index === undefined) {
console.error('patch: myPatch: failed to find feature flag');
return null;
}
const insertIndex = match.index + match[0].indexOf('{') + 1;
const insertion = 'return true;';
const newFile =
file.slice(0, insertIndex) + insertion + file.slice(insertIndex);
showDiff(file, newFile, insertion, insertIndex, insertIndex);
return newFile;Example: Replace a Value
// Replace a hardcoded value
const pattern = /(someConfig=)\d+(;)/;
const match = file.match(pattern);
if (!match || match.index === undefined) {
console.error('patch: myPatch: failed to find config value');
return null;
}
const replacement = match[1] + newValue + match[2];
const startIndex = match.index;
const endIndex = startIndex + match[0].length;
const newFile = file.slice(0, startIndex) + replacement + file.slice(endIndex);
showDiff(file, newFile, replacement, startIndex, endIndex);
return newFile;Testing
- Run
npm run buildto compile - Run
npx tweakcc --applyto apply patches - Check console output for patch success/failure
- Run Claude Code to verify behavior
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

