Dev & Engineering

tweakcc Patch Creation Guide

A complete developer guide for writing and registering new patches for tweakcc, the Claude Code customization tool, enabling safe edits to Claude Code's minified source.

53/ 100
Use with care

Useful, but reliability, evidence or controls still have material gaps.

See how it was scored ↓
Works as-is in
Codex · Claude Code
Stars
★ 2.6k
Last updated
8d ago
License
MIT
claude-code-patchingmonkey-patchingcli-toolingminified-code-editing
+3regex-patternstypescriptsystem-prompt-customization

What does this skill do, and when should you use it?

This is the built-in patch-creation skill from the Piebald-AI/tweakcc repository — essentially a contributor-facing guide to patch development. It explains how to locate and replace code in Claude Code's minified cli.js (or the JS embedded in the native binary) using regular expressions, and how to register a new patch in tweakcc's config types, default settings, patch registry, and optional UI. It includes full code templates, a registration checklist, high-performance regex writing tips, and a testing workflow. It targets developers who want to add new customization capabilities to tweakcc, not end users.

Walks developers through a five-step process: create a patch file under src/patches/ (matching minified code with a regex and doing string replacement, returning null on failure and calling showDiff for debugging); add config types and defaults in src/types.ts and src/defaultSettings.ts for configurable patches; register the patch in src/patches/index.ts's PATCH_DEFINITIONS array and patchImplementations object; optionally add UI controls in MiscView.tsx; then build with npm run build and verify with npx tweakcc --apply.

Good fit
  • Open-source contributors adding new feature patches to tweakcc, such as unlocking features or changing UI behavior
  • Maintainers adapting existing patch regexes after a new Claude Code release, handling multi-version differences
  • Developers extending tweakcc's settings system with their own configurable options
  • Contributors adding UI controls like toggles or inputs for new patches
  • Users deciding between a formal upstream patch and tweakcc's adhoc-patch/API routes after understanding the patch mechanism and its three groups (ALWAYS_APPLIED / MISC_CONFIGURABLE / FEATURES)

How do you install this skill?

Before you use it
  • Patches authored per this skill directly modify the Claude Code executable; always review the showDiff output before applying and ensure a backup exists (run tweakcc --apply first to create one).
  • Regex patterns are tightly coupled to specific Claude Code versions and may silently fail after upgrades; revalidate per version.
  • The project ecosystem includes high-risk examples such as permission-check bypasses; users must assess compliance and security implications themselves.
  • No execution was performed; this assessment is a static source review only.
Before you start
Your agent needs
  • Shell / CLI
  • Local filesystem
Install first
  • Node.js
  • pnpm/npm (npm run build, npx tweakcc)

The skill ships inside the tweakcc repository at .claude/skills/patch-creation/SKILL.md. Clone the repo to use it: git clone https://github.com/Piebald-AI/tweakcc.git && cd tweakcc. No separate installation command is documented in the source.

Generic route: install into Claude Code manually (macOS / Linux)
tmp="$(mktemp -d)"
git clone --depth 1 https://github.com/Piebald-AI/tweakcc.git "$tmp"
mkdir -p ~/.claude/skills
cp -R "$tmp/.claude/skills/patch-creation" ~/.claude/skills/
rm -rf "$tmp"

Generated from the source repository and skill path; it copies only this skill's folder. If the author's install steps above differ, follow those first. To scope it to one project, replace ~/.claude/skills with that project's .claude/skills.

How do you use this skill?

Follow SKILL.md's steps: 1) create src/patches/myPatch.ts, locating minified code with a regex like /,somePattern([$\w]+)/ and replacing it; 2) update src/types.ts and src/defaultSettings.ts if the patch is configurable; 3) import the function in src/patches/index.ts, add a PATCH_DEFINITIONS entry and a patchImplementations implementation; 4) run npm run build to compile, npx tweakcc --apply to apply, then run Claude Code to verify behavior.

What are this skill's strengths and limitations?

Pros
  • Complete copyable code templates and a step-by-step registration checklist make onboarding clear
  • Practical performance and correctness tips: use [$\w]+ for identifiers ($ is valid in minified JS) and start patterns with boundary characters, reducing match time from 1.5s to 30ms
  • Mandates showDiff debugging and returning null on failure, making patches observable and revertible
  • Offers guidance for handling multiple Claude Code versions where code patterns may change
Limitations
  • Covers only internal tweakcc patch development, not the repo's 4.0.0 adhoc-patch / API routes (consult the README separately)
  • Techniques are experiential (e.g., counting braces to find function ends) with no automated tooling
  • No automated test suite documented; verification relies on manually running Claude Code
  • It is contributor documentation, not an end-user feature guide — regular users don't need this skill

How does this skill compare with similar options?

Side by side with related skills; every score comes from the same FSRS standard.

Skill FS score Stars Last updated License
tweakcc Patch Creation Guide this page 53 · Use with care ★ 2.6k 8d ago MIT
Tool Rename Compatibility Check ✓ Microsoft · Official 63 · Recommended ★ 194k 6d ago MIT
Angular New App Skill 52 · Use with care ★ 705 7d ago —
Angular Developer Skill 63 · Recommended ★ 705 7d ago —
FreeHire Tech Job Search Skill 63 · Recommended ★ 70k 1d ago MIT

The repository itself offers two alternative routes: tweakcc adhoc-patch for one-off patches via string/regex/sandboxed-script modes without forking or opening a PR, and the npm-installable tweakcc API for programmatic patching. This skill covers the third route — writing the patch formally into tweakcc's codebase.

How did FollowSkills review this skill?

FollowSkills review · FSRS-2.0
Use with care
53/ 100 5-point scale 2.7 / 5
The upstream repository has new commits since this review. The score still applies to the reviewed revision shown and may not cover the latest changes.
1Trust14 / 25 · 2.8/5

This is developer documentation for tweakcc contributors; it executes nothing and requests no permissions. Generated patches use showDiff for transparency and return null on failure. However, patches inherently modify the Claude Code executable, and the surrounding project enables risky capabilities (permission-check bypass, installer warning suppression); the skill itself offers no confirmation or rollback guidance, so points are deducted.

2Reliability9 / 20 · 2.3/5

Internally consistent: failure handling (return null with console.error), registration checklist, and testing steps are given, making the main path plausible. Nothing was executed; multi-version pattern drift is only hand-waved ('try multiple patterns'), and failure feedback for edge cases is thin, hence deductions within the static cap.

3Adaptability9 / 15 · 3.0/5

Trigger condition is clear ('use when adding new customizations to Claude Code via tweakcc'), audience well-defined (tweakcc contributors). But heavy dependence on Claude Code's minified internals means patterns break across versions; non-fit boundaries and Chinese-environment considerations are absent, so points are deducted.

4Convention11 / 15 · 3.7/5

Well layered: overview, step-by-step guide, key-files table, registration checklist, patch groups, pattern tips, examples, and testing instructions. Repository has MIT license, versioning (4.3.3), CI and tests. The skill itself lacks version/changelog and maintenance ownership is only inferable from the repo, so deductions apply.

5Effectiveness6 / 15 · 2.0/5

Provides a uniform template plus concrete correctness/performance tips ([$\w]+ identifiers, boundary-character anchoring), giving clear marginal value for contributors. But outputs are code sketches requiring per-version adaptation, and representative outputs could not be verified statically, so effectiveness stays below the cap.

6Verifiability4 / 10 · 2.0/5

Examples cross-check against the repository structure (src/patches, types.ts, defaultSettings.ts, index.ts), and the repo includes vitest tests and CI. However, tests do not cover the skill's own key path (the patch-authoring workflow) and no third-party execution evidence exists, so verifiability remains capped.

1 2 3 4 5 6

Open a dimension to read why it scored that way

Reviewed Sep 18, 2026 Reviewed revision 69a1ad1ac8b5 Review evidence[1][2][3][4][5][6][7][8][9]

Evidence confidence:Low — Mostly static review, author material or a limited demo; useful for discovery, not high-risk decisions.

See the full review method →

FAQ

What are the prerequisites for using this skill?
You need to clone and build the tweakcc repository (pnpm/npm), be comfortable reading minified JavaScript and writing regexes, and have a patchable Claude Code installation locally (npm or native — tweakcc supports both).
What happens if my patch is wrong?
A patch function should return null when the pattern isn't found; the system prints 'failed to find pattern' and skips it. tweakcc restores cli.js/the binary from backup before applying, and you can revert with tweakcc --restore.
How does this differ from adhoc-patch?
Patches created per this guide enter tweakcc's formal patch registry — configurable and maintainable across versions, suitable for upstream contribution. adhoc-patch applies one-off script patches that don't enter the codebase, better for quick personal use.
Will patches survive Claude Code updates?
Minified code patterns can change between versions; the guide recommends trying multiple patterns per logic to handle different CC versions. System-prompt patches are more resilient because tweakcc maintains per-version prompt data.

Related skills