Agent skill

Patch Creation

by Piebald-AI in Piebald-AI/tweakcc

Create and register new patches for tweakcc. An agent skill from Piebald-AI/tweakcc.

MITAuto-check passedAI & LLM Engineering

Install Patch Creation

skills CLI
$ npx skills add Piebald-AI/tweakcc --skill patch-creation -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Piebald-AI/tweakcc patch-creation --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Piebald-AI/tweakcc.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/patch-creation .claude/skills/patch-creation && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
patch-creation
GitHub stars
2.5k
Token cost
~1.6k tokens
SKILL.md length
367 words
Files
1
Skills in repo
1
Repo updated
First seen
Licence
MIT

At a glance

Create and register new patches for tweakcc. An agent skill from Piebald-AI/tweakcc.

  • Works in 5 steps: Create the patch file → Add config type (if patch is configurable) → Add default value → …
  • Adding new customizations to Claude Code
  • SKILL.md covers Overview, Creating a New Patch, Key Files and Registration Checklist, plus 5 more sections
  • Calls npm and npx

What it does

Patch Creation is an agent skill from Piebald-AI/tweakcc. Create and register new patches for tweakcc. Use when adding new customizations to Claude Code.

Its SKILL.md is about 1.6k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in AI & LLM Engineering, covering Prompt engineering. The repository describes itself as: Customize Claude Code's system prompts, create custom toolsets, input pattern highlighters, themes/thinking verbs/spinners, customize input box & user message styling, support… The licence is MIT.

When your agent uses it

  • Adding new customizations to Claude Code
  • Tasks that involve Prompt engineering

Example prompts

  • “/patch-creation”

Requirements

  • Node.js

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Create the patch file
  2. Add config type (if patch is configurable)
  3. Add default value
  4. Register in index.ts
  5. Add UI (optional)

What it can do on your machine

Read from SKILL.md and the folder at commit 5574fb4. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npm
    • npx

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use npm and npx, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Patch Creation loads about 1.6k tokens when it runs. Until then it costs about 28 tokens; SKILL.md has 367 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~28
When it runs · the whole SKILL.md, loaded when a task matches
~1.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from Piebald-AI/tweakcc at commit 5574fb4, republished under its MIT licence (© Piebald-AI). 367 words, ~1,564 tokens.

Download SKILL.mdSave it as .claude/skills/patch-creation/SKILL.md (or your agent's skills folder).
name
patch-creation
description
Create and register new patches for tweakcc. Use when adding new customizations to Claude Code.

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:

typescript
// 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:

typescript
export interface MiscConfig {
  // ... existing fields ...
  myNewSetting: string | null; // null = disabled
}
3. Add default value

Edit src/defaultSettings.ts:

typescript
misc: {
  // ... existing fields ...
  myNewSetting: null,  // or a sensible default
},
4. Register in index.ts

Edit src/patches/index.ts:

4a. Add import:

typescript
import { writeMyPatch } from './myPatch';

4b. Add patch definition (in PATCH_DEFINITIONS array):

typescript
{
  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):

typescript
'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

FilePurpose
src/patches/*.tsIndividual patch implementations
src/patches/index.tsPatch registry, definitions, and application logic
src/types.tsConfig type definitions (MiscConfig, etc.)
src/defaultSettings.tsDefault values for all settings
src/ui/components/MiscView.tsxUI for misc settings

Registration Checklist

When adding a new patch, update these locations:

  • src/patches/myPatch.ts - Create the patch file with exported function
  • src/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_DEFINITIONS array (id, name, group, description)
    • Add to patchImplementations object (fn, condition)
  • src/ui/components/MiscView.tsx - Add UI controls (optional)

Patch Groups

  • PatchGroup.ALWAYS_APPLIED - Core patches that are always applied
  • PatchGroup.MISC_CONFIGURABLE - User-configurable misc settings
  • PatchGroup.FEATURES - Feature patches that can be enabled/disabled
Show full SKILL.md (159 more words)Show less

Pattern Writing Tips

  1. Use [$\w]+ for identifiers - Not \w+, because $ is valid in JS identifiers and common in minified code

  2. Start patterns with boundary characters - Use ,, ;, {, } at the start to dramatically speed up matching (can reduce 1.5s to 30ms)

  3. Don't use \b for word boundaries - It doesn't treat $ as a word character, so \b[$\w]+ won't match ,$=

  4. Extract function bodies carefully - Count braces to find matching } when you need the full function

  5. Use showDiff() for debugging - Always call it to log what the patch is changing

  6. Return null on failure - Let the patch system know the patch couldn't be applied

  7. Handle multiple CC versions - Code patterns may change between versions; try multiple patterns if needed

Example: Simple Toggle Patch

typescript
// 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

typescript
// 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

  1. Run npm run build to compile
  2. Run npx tweakcc --apply to apply patches
  3. Check console output for patch success/failure
  4. Run Claude Code to verify behavior

© Piebald-AI, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/patch-creation of Piebald-AI/tweakcc.

Open the folder on GitHubat commit 5574fb4

Compare with similar skills

Patch Creation next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Patch Creation compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Patch Creation this skillPiebald-AI/tweakcc2.5k—~1.6kAutomated safety check: PassMIT
Prompt Improverseverity1/claude-code-prompt-improver1.9k2 repos~1.7kAutomated safety check: PassMIT
Prompt Engineering Patternsynulihao/AgentSkillOS61714 repos~1.7kAutomated safety check: PassNone
LLM Application DevMoizIbnYousaf/ai-agent-skills1.1k2 repos~1.3kAutomated safety check: PassMIT
Senior Prompt Engineermaslennikov-ig/claude-code-orchestrator-kit2594 repos~1.4kAutomated safety check: PassCustom licence
Codex Fable5baskduf/FableCodex437—~1.6kAutomated safety check: PassAGPL-3.0

Similar skills

  • Prompt Improver

    severity1/claude-code-prompt-improver

    This skill enriches vague prompts with targeted research and clarification before execution.

    1.9k GitHub starsUsed in 2 repos~1.7k tokens
    AI & LLM EngineeringAuto-check passed
  • Prompt Engineering Patterns

    ynulihao/AgentSkillOS

    Master advanced prompt engineering techniques to maximize LLM performance, reliability, and controllability in production.

    617 GitHub starsUsed in 14 repos~1.7k tokens
    AI & LLM EngineeringAuto-check passed
  • LLM Application Dev

    MoizIbnYousaf/ai-agent-skills

    Building applications with Large Language Models - prompt engineering, RAG patterns, and LLM integration.

    1.1k GitHub starsUsed in 2 repos~1.3k tokens
    AI & LLM EngineeringAuto-check passed
  • Senior Prompt Engineer

    maslennikov-ig/claude-code-orchestrator-kit

    Provides reference guides and Python scripts for prompt optimization, RAG evaluation, and agent orchestration when building or tuning LLM systems.

    259 GitHub starsUsed in 4 repos~1.4k tokens
    AI & LLM EngineeringAuto-check passed
  • Codex Fable5

    baskduf/FableCodex

    Apply a Claude Fable 5 inspired operating style inside Codex.

    437 GitHub stars~1.6k tokensUpdated 2 mo ago
    AI & LLM EngineeringAuto-check passed
  • Reference for designing and tuning production LLM prompts: few-shot examples, chain-of-thought, structured outputs, templates and system prompts.

    40k GitHub stars~1.3k tokensUpdated 2 days ago
    AI & LLM EngineeringAuto-check passed

Questions about Patch Creation

What does Patch Creation do?

Create and register new patches for tweakcc. An agent skill from Piebald-AI/tweakcc. Patch Creation is an agent skill from Piebald-AI/tweakcc. Create and register new patches for tweakcc.

When should I use Patch Creation?

Patch Creation fits situations like: adding new customizations to Claude Code; tasks that involve Prompt engineering.

How do I install Patch Creation in Claude Code?

Run `npx skills add Piebald-AI/tweakcc --skill patch-creation -a claude-code`. Or copy the skill folder (.claude/skills/patch-creation in Piebald-AI/tweakcc) into .claude/skills/patch-creation in your project. Claude Code loads it when a task matches its description.

How do I install Patch Creation in Codex?

Run `npx skills add Piebald-AI/tweakcc --skill patch-creation -a codex`. Or copy the skill folder (.claude/skills/patch-creation in Piebald-AI/tweakcc) into .agents/skills/patch-creation in your project. Codex loads it when a task matches its description.

Can I use Patch Creation in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Piebald-AI/tweakcc --skill patch-creation -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/patch-creation, .gemini/skills/patch-creation, .github/skills/patch-creation and .opencode/skills/patch-creation in your project.

What does Patch Creation need to run?

Going by SKILL.md and its folder, Patch Creation needs the command-line tools its instructions call (npm and npx). Our summary lists: Node.js.

Does Patch Creation access the network?

SKILL.md contains no URLs. Its commands use npm and npx, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Patch Creation safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Patch Creation use?

Patch Creation is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Patch Creation use?

About 1.6k tokens (SKILL.md is roughly 6.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Patch Creation?

Skills that share tags, products or a category with Patch Creation: Prompt Improver (severity1/claude-code-prompt-improver, 1.9k stars), Prompt Engineering Patterns (ynulihao/AgentSkillOS, 617 stars), LLM Application Dev (MoizIbnYousaf/ai-agent-skills, 1.1k stars) and Senior Prompt Engineer (maslennikov-ig/claude-code-orchestrator-kit, 259 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Patch Creation?

Piebald-AI (a GitHub organization) maintains it in Piebald-AI/tweakcc, which has 2,534 GitHub stars. The repository was last updated on October 6, 2026.

Source: Piebald-AI/tweakcc on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.