Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ $ pnpm dlx tweakcc

tweakcc works by patching Claude Code's minified `cli.js` file. For npm-based installations this file is modified directly, but for native installation it's extracted from the binary, 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`.

tweakcc is verified to work with Claude Code **2.1.31.** 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.
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.

## Feature: Input pattern highlighters

Expand Down Expand Up @@ -428,7 +428,7 @@ Here are two demos showing 1) updates triggered every 150ms, and 2) updates trig

## Feature: AGENTS.md support

<sm><i>Supported Claude Code versions: 1.0.24 (and likely older) to 2.1.29+.</i></sm>
<sm><i>Supported Claude Code versions: 1.0.24 (and likely older) to 2.1.32+.</i></sm>

Claude Code is the only coding agent that doesn't support `AGENTS.md`; they only support `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 fallback to `AGENTS.md` and several others when `CLAUDE.md` doesn't exist.

Expand Down Expand Up @@ -456,7 +456,7 @@ https://github.com/user-attachments/assets/27513489-bb89-4174-b62f-ab17b0fce7bd

## Feature: Auto-accept plan mode

<sm><i>Supported Claude Code versions: 2.1.22 to 2.1.31+.</i></sm>
<sm><i>Supported Claude Code versions: 2.1.22 to 2.1.32+.</i></sm>

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.

Expand Down
5 changes: 3 additions & 2 deletions src/patches/modelSelector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { escapeIdent, showDiff } from './index';
// Models to inject/make available.
// prettier-ignore
export const CUSTOM_MODELS: { value: string; label: string; description: string }[] = [
{ value: 'claude-opus-4-6', label: 'Opus 4.6', description: "Claude Opus 4.6 (February 2026)" },
{ value: 'claude-opus-4-5-20251101', label: 'Opus 4.5', description: "Claude Opus 4.5 (November 2025)" },
{ value: 'claude-sonnet-4-5-20250929', label: 'Sonnet 4.5', description: "Claude Sonnet 4.5 (September 2025)" },
{ value: 'claude-opus-4-1-20250805', label: 'Opus 4.1', description: "Claude Opus 4.1 (August 2025)" },
Expand All @@ -23,7 +24,7 @@ const findCustomModelListInsertionPoint = (
): { insertionIndex: number; modelListVar: string } | null => {
// 1. Find the custom model push pattern
const pushPattern =
/\b([$\w]+)\.push\(\{value:[$\w]+,label:[$\w]+,description:"Custom model"\}\)/;
/ ([$\w]+)\.push\(\{value:[$\w]+,label:[$\w]+,description:"Custom model"\}\)/;
const pushMatch = fileContents.match(pushPattern);
if (!pushMatch || pushMatch.index === undefined) {
console.error(
Expand All @@ -41,7 +42,7 @@ const findCustomModelListInsertionPoint = (

// 4. Find the LAST occurrence of the function with let modelListVar=...;
const funcPattern = new RegExp(
`function [$\\w]+\\(\\)\\{let ${escapeIdent(modelListVar)}=.+?;`,
`function [$\\w]+\\([^)]*\\)\\{let ${escapeIdent(modelListVar)}=.+?;`,
'g'
);
let lastMatch: RegExpExecArray | null = null;
Expand Down
12 changes: 11 additions & 1 deletion src/patches/swarmMode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@
// }
// ```

// CC 2.1.32:
// ```diff
// function F8() {
// + return true;
// if (!$6(process.env.CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS)) return !1;
// if (!x8("tengu_amber_flint", !1)) return !1;
// return !0;
// }
// ```

import { showDiff } from './index';

/**
Expand All @@ -32,7 +42,7 @@ export const writeSwarmMode = (oldFile: string): string | null => {
// Match: function XX(){if(Yz(process.env.CLAUDE_CODE_AGENT_SWARMS))...
// Capture group 1 is the 'i' in 'if' - we insert before it
const pattern =
/function [$\w]+\(\)\{if\([$\w]+\(process.env.CLAUDE_CODE_AGENT_SWARMS\)\)/;
/function [$\w]+\(\)\{if\(!?[$\w]+\(process.env.(?:CLAUDE_CODE_AGENT_SWARMS|CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS)\)\)/;

const match = oldFile.match(pattern);

Expand Down