dazzle-claude-code-patcher 0.2.0__tar.gz
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.
- dazzle_claude_code_patcher-0.2.0/CHANGELOG.md +190 -0
- dazzle_claude_code_patcher-0.2.0/LICENSE +21 -0
- dazzle_claude_code_patcher-0.2.0/MANIFEST.in +7 -0
- dazzle_claude_code_patcher-0.2.0/PKG-INFO +127 -0
- dazzle_claude_code_patcher-0.2.0/README.md +97 -0
- dazzle_claude_code_patcher-0.2.0/bin/dcc-env +9 -0
- dazzle_claude_code_patcher-0.2.0/bin/dcc-env.cmd +11 -0
- dazzle_claude_code_patcher-0.2.0/bin/dcc-env.ps1 +12 -0
- dazzle_claude_code_patcher-0.2.0/dazzle_claude_code_patcher.egg-info/PKG-INFO +127 -0
- dazzle_claude_code_patcher-0.2.0/dazzle_claude_code_patcher.egg-info/SOURCES.txt +41 -0
- dazzle_claude_code_patcher-0.2.0/dazzle_claude_code_patcher.egg-info/dependency_links.txt +1 -0
- dazzle_claude_code_patcher-0.2.0/dazzle_claude_code_patcher.egg-info/entry_points.txt +2 -0
- dazzle_claude_code_patcher-0.2.0/dazzle_claude_code_patcher.egg-info/requires.txt +4 -0
- dazzle_claude_code_patcher-0.2.0/dazzle_claude_code_patcher.egg-info/top_level.txt +1 -0
- dazzle_claude_code_patcher-0.2.0/dcc_patcher/__init__.py +2 -0
- dazzle_claude_code_patcher-0.2.0/dcc_patcher/__main__.py +7 -0
- dazzle_claude_code_patcher-0.2.0/dcc_patcher/_version.py +92 -0
- dazzle_claude_code_patcher-0.2.0/dcc_patcher/builds.py +100 -0
- dazzle_claude_code_patcher-0.2.0/dcc_patcher/cli.py +496 -0
- dazzle_claude_code_patcher-0.2.0/dcc_patcher/containers/__init__.py +85 -0
- dazzle_claude_code_patcher-0.2.0/dcc_patcher/containers/pe.py +128 -0
- dazzle_claude_code_patcher-0.2.0/dcc_patcher/diagnose.py +70 -0
- dazzle_claude_code_patcher-0.2.0/dcc_patcher/engine.py +200 -0
- dazzle_claude_code_patcher-0.2.0/dcc_patcher/install.py +535 -0
- dazzle_claude_code_patcher-0.2.0/dcc_patcher/launch.py +197 -0
- dazzle_claude_code_patcher-0.2.0/dcc_patcher/lock.py +45 -0
- dazzle_claude_code_patcher-0.2.0/dcc_patcher/originals.py +127 -0
- dazzle_claude_code_patcher-0.2.0/dcc_patcher/patches/B-banner-label/patch.toml +25 -0
- dazzle_claude_code_patcher-0.2.0/dcc_patcher/patches/B2-banner-label-flicker-free/patch.toml +27 -0
- dazzle_claude_code_patcher-0.2.0/dcc_patcher/patches/H-history-past-compaction/README.md +58 -0
- dazzle_claude_code_patcher-0.2.0/dcc_patcher/patches/H-history-past-compaction/patch.toml +68 -0
- dazzle_claude_code_patcher-0.2.0/dcc_patcher/patches/J-history-across-files/README.md +37 -0
- dazzle_claude_code_patcher-0.2.0/dcc_patcher/patches/J-history-across-files/patch.toml +35 -0
- dazzle_claude_code_patcher-0.2.0/dcc_patcher/patches/V-version-label/patch.toml +23 -0
- dazzle_claude_code_patcher-0.2.0/dcc_patcher/regfile.py +65 -0
- dazzle_claude_code_patcher-0.2.0/dcc_patcher/resolve.py +43 -0
- dazzle_claude_code_patcher-0.2.0/dcc_patcher/shims/claude.cmd.in +6 -0
- dazzle_claude_code_patcher-0.2.0/dcc_patcher/shims/claude.sh.in +4 -0
- dazzle_claude_code_patcher-0.2.0/dcc_patcher/spec.py +166 -0
- dazzle_claude_code_patcher-0.2.0/dcc_patcher/style.py +69 -0
- dazzle_claude_code_patcher-0.2.0/dcc_patcher/winpath.py +164 -0
- dazzle_claude_code_patcher-0.2.0/pyproject.toml +82 -0
- dazzle_claude_code_patcher-0.2.0/setup.cfg +4 -0
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
|
+
|
|
7
|
+
## [Unreleased]
|
|
8
|
+
|
|
9
|
+
## [0.2.0] - 2026-10-09
|
|
10
|
+
|
|
11
|
+
The first tagged release, on PyPI: `pip install dazzle-claude-code-patcher`. It carries everything from v0.1.5 to v0.1.11 (versioned builds, the launcher, `dcc-env`, `status`, PATH backups, kept originals, history across session files, the plugin signal, the bundled patches) on top of the tool and the history patch. No code changed since v0.1.11.
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
|
|
15
|
+
- **The README is down to what you need to use the tool**: install, `check` and `apply`, `dcc-env` and `status`, how it works. The detail moved to `docs/launcher.md`: the builds folder and every file in it, what `install-shim` changes step by step, choosing what `claude` runs, the `.reg` backups and `restore-path`, `status`, `uninstall-shim`, and how to check or undo all of it by hand, without dcc-patcher.
|
|
16
|
+
- README links are absolute, so the page renders on PyPI.
|
|
17
|
+
- `ROADMAP.md`, `docs/platform-support.md`, `CONTRIBUTING.md` and the patch READMEs say where things stand (every patch applies on 2.1.278 to 2.1.295; the history patch is in daily use).
|
|
18
|
+
- The source distribution carries the package, the `dcc-env` scripts, README, CHANGELOG and LICENSE, and nothing else (`MANIFEST.in`). Tests, checklists and docs stay in the repository.
|
|
19
|
+
- The PyPI workflow runs when a GitHub Release is published, and can also be run by hand from the Actions tab for a given tag; a re-run skips files already on PyPI.
|
|
20
|
+
|
|
21
|
+
## [0.1.11] - 2026-10-08
|
|
22
|
+
|
|
23
|
+
### Added
|
|
24
|
+
|
|
25
|
+
- **`dcc-env`: one word that sets up and fixes the shell you're in.** In cmd or PowerShell type `dcc-env`, in Git Bash `. dcc-env`. It runs `install-shim` if the launcher isn't set up yet, then puts it on `PATH` in that shell, including one that was open before the install (a program can't change its shell's `PATH`, so this is a script that runs inside the shell). pip installs the three scripts beside `dcc-patcher`. In PowerShell it needs an execution policy that runs local scripts; `status` gives the alternative when it doesn't.
|
|
26
|
+
- **A backup before every `PATH` change**, as a `.reg` file holding only `Path`, in the builds folder's `backups\`, named `<date>__<time>__path-<user|system>__before-<command>__<current build>.reg`. `reg import` restores it without dcc-patcher.
|
|
27
|
+
- **`dcc-patcher restore-path [file]`** puts the newest (or the named) backup back, after showing which entries come back and which go, and saves the current value first.
|
|
28
|
+
- **`status` is coloured on a terminal**: green done, yellow pending, red a problem, cyan the command to run, with each path in a brighter shade of its line's colour. A blank line separates the groups, and a row's explanation goes on its own line under the path, so narrow terminals don't wrap into the marks. Pipes and `NO_COLOR` get plain text. It also shows the backups, the Git Bash shim, and two hazards: an sh script on the Windows `PATH`, and `~/bin` on the Windows `PATH`.
|
|
29
|
+
|
|
30
|
+
### Changed
|
|
31
|
+
|
|
32
|
+
- **The Git Bash shims moved to `~/bin`**, which Git for Windows puts first on Git Bash's `PATH` and Windows never searches. In v0.1.10 they sat beside `claude.cmd` on the Windows `PATH`, where a resolver that tries the bare name first (Python 3.12.0's `shutil.which`) picked the sh script, and launching it failed with "not a valid Win32 application" (claude-session-backup's `resume`). `install-shim` removes the old ones it wrote and never overwrites a file in `~/bin` that isn't its own.
|
|
33
|
+
- **`uninstall-shim` now puts back everything outside the builds folder as it was**: besides its `PATH` entries, it removes the Git Bash shims from `~/bin` (and `~/bin` itself if `install-shim` created it and it's empty) and, when elevated, the admin copy of the shims in Program Files. It never removes a file that isn't its own. The builds folder (builds, kept originals, `PATH` backups, the `.cmd` shims) stays, so a later `dcc-env` puts everything back.
|
|
34
|
+
- **A shell opened before the install is told how to catch up** (`dcc-env`), instead of being told to run `install-shim` again.
|
|
35
|
+
- **The launcher's first start says "first start"**, and a start after an update says "Claude Code updated", before building.
|
|
36
|
+
|
|
37
|
+
## [0.1.10] - 2026-10-08
|
|
38
|
+
|
|
39
|
+
### Added
|
|
40
|
+
|
|
41
|
+
- **`install-shim` puts the launcher on `PATH` for you** (Windows), after asking (`--yes` skips the question, `--no-path` leaves `PATH` alone). It adds one entry to the user `PATH`, the shim folder, just before Claude Code's own folder, and changes nothing else: the registry type and `%VAR%` entries are kept, and the value is read back to confirm. When the system `PATH` has a `claude` of its own, an elevated run puts an admin-only copy of the shims just ahead of it; otherwise the system `PATH` is never touched. The first values seen and every change are recorded in the builds folder.
|
|
42
|
+
- **`dcc-patcher uninstall-shim`** removes only the entries `install-shim` added, so anything other installers added since stays.
|
|
43
|
+
- **`dcc-patcher status`**: which `claude` this shell runs (every candidate, in the order the shell searches), whether the user and system `PATH` are set up, whether this shell was opened before the change, what the next start will run, and whether every original build is kept. Each open item comes with the command that fixes it; the exit code is 1 while anything is open.
|
|
44
|
+
- **`dcc-patcher shellenv`** prints the one line that puts the launcher on `PATH` in the current shell (cmd, PowerShell or sh), so a shell opened before the install needn't be closed.
|
|
45
|
+
- **Every original Claude Code is kept** as `claude-cc-<version>.exe` in the builds folder: the input of every build, and the updater's own `claude.exe.old.*` backups, which it deletes after a while. `dcc-patcher archive` keeps any not kept yet.
|
|
46
|
+
|
|
47
|
+
### Changed
|
|
48
|
+
|
|
49
|
+
- **The launcher says it's rebuilding before it starts**, on the same single line that then reports the result.
|
|
50
|
+
|
|
51
|
+
### Fixed
|
|
52
|
+
|
|
53
|
+
- **Building from an updater backup (`claude.exe.old.<number>`) names the build `.exe`**, instead of using the number as its extension.
|
|
54
|
+
|
|
55
|
+
## [0.1.9] - 2026-10-07
|
|
56
|
+
|
|
57
|
+
### Changed
|
|
58
|
+
|
|
59
|
+
- **The bundled patches ship inside the package** (`dcc_patcher/patches/`), so an installed wheel finds them. Until now they sat at the repository's root, and only a source checkout could see them. The launcher's shim templates ship as package data too.
|
|
60
|
+
|
|
61
|
+
### Fixed
|
|
62
|
+
|
|
63
|
+
- **`validate`, `check` and `apply` refuse to run with no patch specs** (exit 2, one line), instead of reporting a clean run that checked nothing.
|
|
64
|
+
|
|
65
|
+
## [0.1.8] - 2026-10-07
|
|
66
|
+
|
|
67
|
+
### Added
|
|
68
|
+
|
|
69
|
+
- **Plugins can tell the history patch is in place.** A build with the history patch sets `DCC_PATCH_H=history-v1` in Claude Code's environment. A plugin reads it with `$.env.get("DCC_PATCH_H")` and can then scroll straight to a resumed session's earliest messages; on stock it reads nothing. The history patch's README has a section for plugin authors. Builds made before this version don't set it, so rebuild.
|
|
70
|
+
|
|
71
|
+
## [0.1.7] - 2026-10-07
|
|
72
|
+
|
|
73
|
+
### Added
|
|
74
|
+
|
|
75
|
+
- **`patches/J-history-across-files/`: history across session files.** A conversation that continued into a new session file, after running out of context or after a fork, now scrolls back into the file it came from, and on to the first message of the original conversation.
|
|
76
|
+
- When a session file points at a message it doesn't contain, the loader finds it in another `.jsonl` file of the same folder and loads that file's lines up to the message. It repeats for a grandparent session.
|
|
77
|
+
- A missing or damaged earlier file stops the search quietly, and the session loads as before.
|
|
78
|
+
- Needs the history patch (H).
|
|
79
|
+
- `check` passes on every saved build from 2.1.278 through 2.1.292. Not yet live-tested.
|
|
80
|
+
- Derived from ojura/claude-patches' Patch J (MIT), with credit in the patch and its README.
|
|
81
|
+
|
|
82
|
+
## [0.1.6] - 2026-10-07
|
|
83
|
+
|
|
84
|
+
### Added
|
|
85
|
+
|
|
86
|
+
- **A launcher, so the patched build is just `claude`.** `dcc-patcher install-shim` writes `claude` and `claude-stock` (plus `.cmd` versions on Windows) into `<builds>\bin`. Put that folder ahead of `~/.local/bin` on `PATH`.
|
|
87
|
+
- `claude` runs the current patched build. When the official `claude.exe` has changed, the next start rebuilds into the builds folder and switches to the new build.
|
|
88
|
+
- If a patch needs attention after an update, or the rebuild fails, `claude` runs stock, with one line on stderr naming the patch.
|
|
89
|
+
- `claude-stock` always runs the official build. It's a generated file, not a shell alias, so it works the same in cmd, PowerShell and POSIX shells.
|
|
90
|
+
- All the logic is in one Python module (`dcc_patcher.launch`). The shims come from two templates, one `.cmd` and one POSIX `sh`.
|
|
91
|
+
- The official exe's hash is cached against its size, modification time and file id, so a start with nothing changed doesn't re-read 250 MB.
|
|
92
|
+
- **`dcc-patcher use [stock | patched | <build>]`** chooses what `claude` runs from the next start; with no argument it shows the state. **`dcc-patcher rollback`** pins the build before the current one. `DCC_MODE=stock` or `DCC_MODE=patched` overrides the choice for one shell.
|
|
93
|
+
- With `CLAUDE_CONFIG_DIR` set (a test config), the launcher never rebuilds or changes its state.
|
|
94
|
+
- **The launcher never writes into `~/.local/bin` or `~/.claude`,** and `install-shim` refuses both. Claude Code's updater writes only to its own fixed path in `~/.local/bin` and never searches `PATH`, so it doesn't touch the shims.
|
|
95
|
+
|
|
96
|
+
## [0.1.5] - 2026-10-07
|
|
97
|
+
|
|
98
|
+
### Added
|
|
99
|
+
|
|
100
|
+
- **Versioned builds in one fixed folder.** `dcc-patcher apply <claude.exe>` with no `-o` names each build after both versions, for example `claude-dcc-2.1.292+dcc0.1.5.exe`, with its lockfile beside it. Older builds stay for rollback.
|
|
101
|
+
- The builds folder is the same whatever folder `apply` is run from: `private\builds\` in a checkout of this repository, otherwise `%LOCALAPPDATA%\dazzle-claude-code-patcher\builds\` (`~/.local/share/...` on Linux and macOS). `DCC_BUILDS_DIR` overrides it.
|
|
102
|
+
- `claude-dcc.exe` in that folder points at the newest build: a hardlink, or a copy where hardlinks aren't available.
|
|
103
|
+
- Rebuilding the same versions reports `already built` and writes nothing. Changed patches at the same versions rebuild.
|
|
104
|
+
- If `claude-dcc.exe` is running, the new build is kept, one line says the current name still points at the old one, and the exit code is 1.
|
|
105
|
+
|
|
106
|
+
### Changed
|
|
107
|
+
|
|
108
|
+
- **`apply` prints absolute paths,** so a misplaced build is obvious.
|
|
109
|
+
- **`apply` refuses to write inside Claude Code's own config folder** (`~/.claude`, or `CLAUDE_CONFIG_DIR`), with or without `-o`, and exits 2. A relative `-o` run from `~/.claude` once put a 258 MB build there.
|
|
110
|
+
- `-o` is now optional; with it, `apply` writes exactly that file, as before, with no `claude-dcc.exe` link.
|
|
111
|
+
|
|
112
|
+
## [0.1.4] - 2026-10-07
|
|
113
|
+
|
|
114
|
+
### Added
|
|
115
|
+
|
|
116
|
+
- **Banner label:** a patched build's session header reads, for example, `Dazzle Claude Code v2.1.291 · dcc 0.1.3` instead of `Claude Code v2.1.291`.
|
|
117
|
+
- Claude Code draws that header in two places, one for each rendering mode, so there are two small patches: `patches/B-banner-label/` for the classic header and `patches/B2-banner-label-flicker-free/` for the flicker-free one.
|
|
118
|
+
- Only the drawn text changes. The version constant, and the name Claude Code gives MCP and language servers, are untouched.
|
|
119
|
+
- Both apply unchanged on every saved build from 2.1.278 through 2.1.292.
|
|
120
|
+
|
|
121
|
+
## [0.1.3] - 2026-10-05
|
|
122
|
+
|
|
123
|
+
### Added
|
|
124
|
+
|
|
125
|
+
- **Patch spec format 1** (`dcc_patcher.spec`). A patch is a TOML file, not code.
|
|
126
|
+
- Each edit is a regular expression that names the minified identifiers it captures, so the same patch keeps matching when a release renames them.
|
|
127
|
+
- A name captured by one edit can be reused by later edits as `@@name@@`.
|
|
128
|
+
- An edit can be scoped to a window around a stable landmark string, and states how many matches it expects.
|
|
129
|
+
- Common authoring mistakes are refused with the field named: non-ASCII text, an unknown `@@name@@`, an invalid pattern, a zero match count.
|
|
130
|
+
- **Signatures and upstream-fixed detectors.** A patch can carry a signature comment, so a patched module is recognised and never patched twice. It can also carry an upstream-fixed detector, so a patch the bug fix made unnecessary is reported as fixed instead of broken.
|
|
131
|
+
- **Patches across several modules.** A patch can span several modules (`modules = n`), and `@@dcc_version@@` in a patch is filled with this tool's version. A patched module is recognised by its signature even when an edit removed the text used to find it, so re-applying is still a no-op.
|
|
132
|
+
- **`dcc-patcher validate [spec ...]`** checks patch specs (by default, every bundled patch). A malformed spec exits 2 with the field named.
|
|
133
|
+
- **`dcc-patcher check <exe>... [--baseline LOCK] [--lock-out DIR]`** is read-only and says, per build, whether each patch and edit applies. Wildcards such as `claude.exe*` are expanded by the tool, so they work from cmd.exe.
|
|
134
|
+
- With a baseline lockfile from a build where the patches applied, each failing edit shows a diff of its site. Minified names are normalised, so a rename doesn't show as a change and a real code change does.
|
|
135
|
+
- Exit codes: 0 when every patch is fine, 1 when one needs a human, 2 when a file can't be read.
|
|
136
|
+
- **`dcc-patcher apply <exe> -o <out> [--patch ...] [--debug]`** writes a patched copy, with a `.dcc-lock.json` record beside it holding each edit's site and the text it replaced.
|
|
137
|
+
- It reports every edit as `APPLIES`, `AMBIGUOUS`, `MISSING` or `LANDMARK-GONE`. When any edit doesn't apply, it writes nothing and exits 1.
|
|
138
|
+
- It never writes over its input. Run on its own output, it reports `already-applied` and writes nothing.
|
|
139
|
+
- **A missing or unreadable input file** is a one-line message with exit 2 in every command, not a traceback.
|
|
140
|
+
- **`patches/H-history-past-compaction/`: history past compaction.** After a restart or `--resume`, the conversation scrolls back past compactions to its first message.
|
|
141
|
+
- `check` passes it unchanged on every saved build from 2.1.278 through 2.1.289, and on 2.1.290.
|
|
142
|
+
- Live on 2.1.290, the model received the same request as stock: 563,935 tokens patched vs 563,939 stock.
|
|
143
|
+
- **`patches/V-version-label/`: a version label.** A patched build's `--version` reads, for example, `2.1.290 + dcc 0.1.3 (Dazzle Claude Code)`: which Claude Code it came from, which patcher built it, and that it is not the stock build. The version constant Claude Code itself checks is untouched.
|
|
144
|
+
- **`scripts/test_config.py`**: a throwaway Claude Code config folder for live tests (`CLAUDE_CONFIG_DIR`), so test sessions never touch `~/.claude`.
|
|
145
|
+
- Every copy it makes gets a session id starting `dcc0dcc0-` and an entry in its copies list.
|
|
146
|
+
- `move-in` refuses any session that is neither marked nor listed, because a fork Claude Code made looks the same from outside.
|
|
147
|
+
- Its commands are `env`, `copy`, `record`, `move-in`/`move-back`, and `list`.
|
|
148
|
+
- **`scripts/copy_session.py` and `scripts/compare_usage.py`** copy a session under a new id, and compare the request size two resumed copies sent. The history patch's checklist uses both.
|
|
149
|
+
- **A human test checklist:** `tests/checklists/v0.2.0__Phase2__history-past-compaction.md`.
|
|
150
|
+
|
|
151
|
+
### Changed
|
|
152
|
+
|
|
153
|
+
- **Python 3.11 or newer is required,** because `tomllib` reads the patch specs. CI no longer tests 3.10.
|
|
154
|
+
|
|
155
|
+
## [0.1.2] - 2026-10-05
|
|
156
|
+
|
|
157
|
+
### Added
|
|
158
|
+
|
|
159
|
+
- `dcc_patcher.containers`: a format-neutral `Container` interface and format detection. ELF (Linux) and Mach-O (macOS) are recognised and refused by name.
|
|
160
|
+
- `dcc_patcher.containers.pe`: reads and rewrites the Bun module graph inside the Windows `claude.exe`. Replacing a module's source drops its bytecode so Bun compiles the new source, and `verify` checks that every other module is byte-identical. Moved from the proof of concept.
|
|
161
|
+
- `dcc-patcher inspect <file> [--marker TEXT]`: format, Claude Code version, module count, Bun flags, and the modules containing a marker. Unsupported formats exit 2 with a one-line message.
|
|
162
|
+
|
|
163
|
+
## [0.1.1] - 2026-10-05
|
|
164
|
+
|
|
165
|
+
### Fixed
|
|
166
|
+
|
|
167
|
+
- Tests can import `dcc_patcher` when run as the pre-push hook runs them (`python -P -m pytest`, which leaves the current directory off the import path): pytest's `pythonpath` now names the project root.
|
|
168
|
+
|
|
169
|
+
## [0.1.0] - 2026-10-05
|
|
170
|
+
|
|
171
|
+
### Added
|
|
172
|
+
|
|
173
|
+
- Project scaffold from git-repokit-template, with git-repokit-common vendored at `scripts/repokit-common/`.
|
|
174
|
+
- `dcc_patcher` package with a `dcc-patcher` command (placeholder; the engine is not built yet).
|
|
175
|
+
- README, roadmap, and platform support notes.
|
|
176
|
+
|
|
177
|
+
[Unreleased]: https://github.com/DazzleML/dazzle-claude-code-patcher/compare/v0.2.0...HEAD
|
|
178
|
+
[0.2.0]: https://github.com/DazzleML/dazzle-claude-code-patcher/releases/tag/v0.2.0
|
|
179
|
+
[0.1.11]: https://github.com/DazzleML/dazzle-claude-code-patcher/compare/v0.1.10...v0.1.11
|
|
180
|
+
[0.1.10]: https://github.com/DazzleML/dazzle-claude-code-patcher/compare/v0.1.9...v0.1.10
|
|
181
|
+
[0.1.9]: https://github.com/DazzleML/dazzle-claude-code-patcher/compare/v0.1.8...v0.1.9
|
|
182
|
+
[0.1.8]: https://github.com/DazzleML/dazzle-claude-code-patcher/compare/v0.1.7...v0.1.8
|
|
183
|
+
[0.1.7]: https://github.com/DazzleML/dazzle-claude-code-patcher/compare/v0.1.6...v0.1.7
|
|
184
|
+
[0.1.6]: https://github.com/DazzleML/dazzle-claude-code-patcher/compare/v0.1.5...v0.1.6
|
|
185
|
+
[0.1.5]: https://github.com/DazzleML/dazzle-claude-code-patcher/compare/v0.1.4...v0.1.5
|
|
186
|
+
[0.1.4]: https://github.com/DazzleML/dazzle-claude-code-patcher/compare/v0.1.3...v0.1.4
|
|
187
|
+
[0.1.3]: https://github.com/DazzleML/dazzle-claude-code-patcher/compare/v0.1.2...v0.1.3
|
|
188
|
+
[0.1.2]: https://github.com/DazzleML/dazzle-claude-code-patcher/compare/v0.1.1...v0.1.2
|
|
189
|
+
[0.1.1]: https://github.com/DazzleML/dazzle-claude-code-patcher/compare/v0.1.0...v0.1.1
|
|
190
|
+
[0.1.0]: https://github.com/DazzleML/dazzle-claude-code-patcher/releases/tag/v0.1.0
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Dustin Darcy
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# What goes into the source distribution beyond the package itself.
|
|
2
|
+
# pyproject.toml's readme and license fields, and the package data, are included
|
|
3
|
+
# on their own. Tests, checklists and one-offs stay in the repository: setuptools
|
|
4
|
+
# would otherwise ship tests/test_*.py without the conftest they need.
|
|
5
|
+
include CHANGELOG.md
|
|
6
|
+
prune tests
|
|
7
|
+
prune docs
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: dazzle-claude-code-patcher
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: Windows-first patch tool for the native Claude Code CLI: apply, verify and diagnose community patches across releases.
|
|
5
|
+
Author-email: "Dustin Darcy (djdarcy)" <djdarcy@users.noreply.github.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/DazzleML/dazzle-claude-code-patcher
|
|
8
|
+
Project-URL: Repository, https://github.com/DazzleML/dazzle-claude-code-patcher
|
|
9
|
+
Project-URL: Issues, https://github.com/DazzleML/dazzle-claude-code-patcher/issues
|
|
10
|
+
Keywords: claude-code,patcher,bun,windows,anthropic,cli
|
|
11
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
12
|
+
Classifier: Environment :: Console
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Topic :: Software Development :: Build Tools
|
|
22
|
+
Classifier: Topic :: Utilities
|
|
23
|
+
Requires-Python: >=3.11
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
License-File: LICENSE
|
|
26
|
+
Provides-Extra: dev
|
|
27
|
+
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
28
|
+
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
|
|
29
|
+
Dynamic: license-file
|
|
30
|
+
|
|
31
|
+
# dazzle-claude-code-patcher
|
|
32
|
+
|
|
33
|
+
[](https://github.com/DazzleML/dazzle-claude-code-patcher/blob/main/LICENSE)
|
|
34
|
+
[](https://www.python.org/downloads/)
|
|
35
|
+
[-lightgrey.svg)](https://github.com/DazzleML/dazzle-claude-code-patcher/blob/main/docs/platform-support.md)
|
|
36
|
+
|
|
37
|
+
> **Fix problematic Claude Code bugs in your local copy now, and keep the fixes working across updates.**
|
|
38
|
+
|
|
39
|
+
`dcc-patcher` diagnoses, verifies, and applies patches to the native Claude Code CLI (`claude.exe`). When Claude Code updates (roughly every two days), one command tells you which patches re-apply as-is and which need attention, and shows exactly what changed. Once set up, `claude` runs the patched build and re-patches each update by itself.
|
|
40
|
+
|
|
41
|
+
> [!NOTE]
|
|
42
|
+
> **Pre-alpha, Windows only.** Five patches apply unchanged on every Claude Code build from 2.1.278 to 2.1.295. The history patch is in daily use: a resumed session scrolls back past every compaction, and the model still receives exactly the same request as stock Claude Code. See the [Roadmap](https://github.com/DazzleML/dazzle-claude-code-patcher/issues/1).
|
|
43
|
+
|
|
44
|
+
## The Problem
|
|
45
|
+
|
|
46
|
+
Some Claude Code bugs sit in code you can't configure around. For example, after a restart or `claude --resume`, everything before the last compaction disappears from the screen. It's still in the session file, but nothing brings it back. Waiting for an upstream improvement or fix can take a while, and patching by hand doesn't survive the next update (Claude Code is minified, so almost every internal name changes from one release to the next).
|
|
47
|
+
|
|
48
|
+
## Patches
|
|
49
|
+
|
|
50
|
+
| Patch | Fixes | Status |
|
|
51
|
+
|---|---|---|
|
|
52
|
+
| [History past compaction](https://github.com/DazzleML/dazzle-claude-code-patcher/blob/main/dcc_patcher/patches/H-history-past-compaction/README.md) | After a restart or `--resume`, scroll back past compactions to the start of the session file | `check` passes on 2.1.278 to 2.1.295; live-tested on 2.1.289 to 2.1.295 |
|
|
53
|
+
| [History across session files](https://github.com/DazzleML/dazzle-claude-code-patcher/blob/main/dcc_patcher/patches/J-history-across-files/README.md) | A conversation that continued into a new session file (after running out of context, or a fork) scrolls back into the file it came from, and on to its first message. Needs the history patch. Derived from ojura/claude-patches' Patch J | `check` passes on 2.1.278 to 2.1.295; not yet live-tested |
|
|
54
|
+
| [Version label](https://github.com/DazzleML/dazzle-claude-code-patcher/blob/main/dcc_patcher/patches/V-version-label/patch.toml) | `--version` says it is a patched build and which patcher made it: `2.1.295 + dcc 0.1.11 (Dazzle Claude Code)`. Only the displayed text changes; the version Claude Code checks against is untouched | `check` passes on 2.1.278 to 2.1.295 |
|
|
55
|
+
| Banner label ([classic](https://github.com/DazzleML/dazzle-claude-code-patcher/blob/main/dcc_patcher/patches/B-banner-label/patch.toml), [flicker-free](https://github.com/DazzleML/dazzle-claude-code-patcher/blob/main/dcc_patcher/patches/B2-banner-label-flicker-free/patch.toml)) | The header at the top of every session reads `Dazzle Claude Code v2.1.295 · dcc 0.1.11`, in both rendering modes. Only the drawn text changes | `check` passes on 2.1.278 to 2.1.295; flicker-free live-tested on 2.1.291 to 2.1.295 |
|
|
56
|
+
|
|
57
|
+
> [!CAUTION]
|
|
58
|
+
> **This project ships the tool and patch definitions only *NEVER* patched binaries.** You patch your own copy of Claude Code, locally. Use at your own risk. No warranty. Backup anything important first. I'd recommend: [claude-session-backup](https://github.com/DazzleML/Claude-Session-Backup).
|
|
59
|
+
|
|
60
|
+
## Installation
|
|
61
|
+
|
|
62
|
+
Python 3.11 or newer, and nothing else.
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
pip install dazzle-claude-code-patcher
|
|
66
|
+
dcc-patcher validate # lists the bundled patches
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
To work on it, install from source instead (`pip install -e ".[dev]"` in a clone). Builds then go to the checkout's `private\builds\` rather than `%LOCALAPPDATA%\dazzle-claude-code-patcher\builds\`.
|
|
70
|
+
|
|
71
|
+
## Usage
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
# Does every patch still apply to this build? (read-only)
|
|
75
|
+
dcc-patcher check %USERPROFILE%\.local\bin\claude.exe
|
|
76
|
+
|
|
77
|
+
# Build a patched copy into the builds folder, with a lockfile recording every edit
|
|
78
|
+
dcc-patcher apply %USERPROFILE%\.local\bin\claude.exe
|
|
79
|
+
# wrote <builds>\claude-dcc-2.1.295+dcc0.1.11.exe
|
|
80
|
+
# and <builds>\claude-dcc-2.1.295+dcc0.1.11.exe.dcc-lock.json
|
|
81
|
+
# <builds>\claude-dcc.exe -> claude-dcc-2.1.295+dcc0.1.11.exe (hardlink)
|
|
82
|
+
|
|
83
|
+
# Run the patched copy instead of claude
|
|
84
|
+
<builds>\claude-dcc.exe --resume
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
The official `claude.exe` is never modified. Older builds stay in the builds folder for rollback, and the original Claude Code each build was made from is kept beside it. After an update, `check` again; if an edit fails, nothing is written and `check --baseline` shows what changed. Where everything goes, and every option: [docs/launcher.md](https://github.com/DazzleML/dazzle-claude-code-patcher/blob/main/docs/launcher.md).
|
|
88
|
+
|
|
89
|
+
### Make the patched build just `claude`
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
dcc-env # cmd or PowerShell; in Git Bash: . dcc-env
|
|
93
|
+
dcc-patcher status # which claude this shell runs, and anything left to do
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
`dcc-env` exists because no program can change the `PATH` of the shell that started it: it's a small script that runs inside your shell, so it works in one that was already open. The first time, it writes `claude` and `claude-stock` shims and adds their folder to your user `PATH` (after asking, and after saving the old value as a `.reg` file). Every time, it puts that folder on the `PATH` of the shell you typed it in. Shells opened afterwards don't need it.
|
|
97
|
+
|
|
98
|
+
From then on, `claude` runs the current patched build. When Claude Code updates, the next start says so, rebuilds in a few seconds, and runs the new build; if a patch no longer applies, it runs stock instead and says which patch needs attention. `claude-stock` always runs the official build; `dcc-patcher use stock` makes `claude` do the same; `dcc-patcher uninstall-shim` puts everything back. The details, including how to check or undo any of it by hand: [docs/launcher.md](https://github.com/DazzleML/dazzle-claude-code-patcher/blob/main/docs/launcher.md).
|
|
99
|
+
|
|
100
|
+
## How it works
|
|
101
|
+
|
|
102
|
+
- **Patches are written by structure, not by exact text.** Each patch names a stable landmark (a string that survives builds), the shape of the code to change near it, and a replacement. Minified names are wildcards, captured once and reused by later edits. Measured on the 7 Claude Code builds from 2.1.278 to 2.1.289 (2026-09-19 to 10-03): the same edits written as exact text applied in full on only one build, while the structural patch applies unchanged on all seven.
|
|
103
|
+
- **It fails closed.** Every edit must match exactly the number of times it expects, or nothing is written. The output is a new file beside the official `claude.exe`, never an in-place change, and everything except the patched module is verified byte-identical.
|
|
104
|
+
- **It knows when to stop.** A patched module carries a signature, so a patch is never applied twice; and a patch can say how to recognise that Anthropic fixed the bug, so it reports *fixed upstream* instead of *broken*.
|
|
105
|
+
- **It diagnoses.** When an edit no longer matches, `check` shows a diff of that code region against the last build where the patch worked, with minified names normalised so that only real code changes show.
|
|
106
|
+
|
|
107
|
+
## Development
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
python -P -m pytest tests/ -v # tests that need a local claude.exe are skipped without one
|
|
111
|
+
bash scripts/repokit-common/install-hooks.sh # version sync and pre-push checks
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## Related Projects
|
|
115
|
+
|
|
116
|
+
- [ojura/claude-patches](https://github.com/ojura/claude-patches): patches for the Claude Code VS Code extension, and the inspiration for this project's approach (structural matching, failing closed, byte-stable verification). This project is its Windows-first, native-CLI counterpart.
|
|
117
|
+
- [claude-session-logger](https://github.com/DazzleML/claude-session-logger), [Claude-Session-Backup](https://github.com/DazzleML/Claude-Session-Backup), [claude-bookmarks](https://github.com/DazzleML/claude-bookmarks): other DazzleML Claude Code tools.
|
|
118
|
+
|
|
119
|
+
## Disclaimer
|
|
120
|
+
|
|
121
|
+
Not affiliated with or endorsed by Anthropic. Patching modifies your local copy of Claude Code and removes its code signature; use it at your own risk, and keep the official `claude.exe` in place.
|
|
122
|
+
|
|
123
|
+
## License
|
|
124
|
+
|
|
125
|
+
dazzle-claude-code-patcher, copyright (C) 2026 Dustin Darcy.
|
|
126
|
+
|
|
127
|
+
This project is licensed under the MIT License - see the [LICENSE](https://github.com/DazzleML/dazzle-claude-code-patcher/blob/main/LICENSE) file for details.
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# dazzle-claude-code-patcher
|
|
2
|
+
|
|
3
|
+
[](https://github.com/DazzleML/dazzle-claude-code-patcher/blob/main/LICENSE)
|
|
4
|
+
[](https://www.python.org/downloads/)
|
|
5
|
+
[-lightgrey.svg)](https://github.com/DazzleML/dazzle-claude-code-patcher/blob/main/docs/platform-support.md)
|
|
6
|
+
|
|
7
|
+
> **Fix problematic Claude Code bugs in your local copy now, and keep the fixes working across updates.**
|
|
8
|
+
|
|
9
|
+
`dcc-patcher` diagnoses, verifies, and applies patches to the native Claude Code CLI (`claude.exe`). When Claude Code updates (roughly every two days), one command tells you which patches re-apply as-is and which need attention, and shows exactly what changed. Once set up, `claude` runs the patched build and re-patches each update by itself.
|
|
10
|
+
|
|
11
|
+
> [!NOTE]
|
|
12
|
+
> **Pre-alpha, Windows only.** Five patches apply unchanged on every Claude Code build from 2.1.278 to 2.1.295. The history patch is in daily use: a resumed session scrolls back past every compaction, and the model still receives exactly the same request as stock Claude Code. See the [Roadmap](https://github.com/DazzleML/dazzle-claude-code-patcher/issues/1).
|
|
13
|
+
|
|
14
|
+
## The Problem
|
|
15
|
+
|
|
16
|
+
Some Claude Code bugs sit in code you can't configure around. For example, after a restart or `claude --resume`, everything before the last compaction disappears from the screen. It's still in the session file, but nothing brings it back. Waiting for an upstream improvement or fix can take a while, and patching by hand doesn't survive the next update (Claude Code is minified, so almost every internal name changes from one release to the next).
|
|
17
|
+
|
|
18
|
+
## Patches
|
|
19
|
+
|
|
20
|
+
| Patch | Fixes | Status |
|
|
21
|
+
|---|---|---|
|
|
22
|
+
| [History past compaction](https://github.com/DazzleML/dazzle-claude-code-patcher/blob/main/dcc_patcher/patches/H-history-past-compaction/README.md) | After a restart or `--resume`, scroll back past compactions to the start of the session file | `check` passes on 2.1.278 to 2.1.295; live-tested on 2.1.289 to 2.1.295 |
|
|
23
|
+
| [History across session files](https://github.com/DazzleML/dazzle-claude-code-patcher/blob/main/dcc_patcher/patches/J-history-across-files/README.md) | A conversation that continued into a new session file (after running out of context, or a fork) scrolls back into the file it came from, and on to its first message. Needs the history patch. Derived from ojura/claude-patches' Patch J | `check` passes on 2.1.278 to 2.1.295; not yet live-tested |
|
|
24
|
+
| [Version label](https://github.com/DazzleML/dazzle-claude-code-patcher/blob/main/dcc_patcher/patches/V-version-label/patch.toml) | `--version` says it is a patched build and which patcher made it: `2.1.295 + dcc 0.1.11 (Dazzle Claude Code)`. Only the displayed text changes; the version Claude Code checks against is untouched | `check` passes on 2.1.278 to 2.1.295 |
|
|
25
|
+
| Banner label ([classic](https://github.com/DazzleML/dazzle-claude-code-patcher/blob/main/dcc_patcher/patches/B-banner-label/patch.toml), [flicker-free](https://github.com/DazzleML/dazzle-claude-code-patcher/blob/main/dcc_patcher/patches/B2-banner-label-flicker-free/patch.toml)) | The header at the top of every session reads `Dazzle Claude Code v2.1.295 · dcc 0.1.11`, in both rendering modes. Only the drawn text changes | `check` passes on 2.1.278 to 2.1.295; flicker-free live-tested on 2.1.291 to 2.1.295 |
|
|
26
|
+
|
|
27
|
+
> [!CAUTION]
|
|
28
|
+
> **This project ships the tool and patch definitions only *NEVER* patched binaries.** You patch your own copy of Claude Code, locally. Use at your own risk. No warranty. Backup anything important first. I'd recommend: [claude-session-backup](https://github.com/DazzleML/Claude-Session-Backup).
|
|
29
|
+
|
|
30
|
+
## Installation
|
|
31
|
+
|
|
32
|
+
Python 3.11 or newer, and nothing else.
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
pip install dazzle-claude-code-patcher
|
|
36
|
+
dcc-patcher validate # lists the bundled patches
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
To work on it, install from source instead (`pip install -e ".[dev]"` in a clone). Builds then go to the checkout's `private\builds\` rather than `%LOCALAPPDATA%\dazzle-claude-code-patcher\builds\`.
|
|
40
|
+
|
|
41
|
+
## Usage
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
# Does every patch still apply to this build? (read-only)
|
|
45
|
+
dcc-patcher check %USERPROFILE%\.local\bin\claude.exe
|
|
46
|
+
|
|
47
|
+
# Build a patched copy into the builds folder, with a lockfile recording every edit
|
|
48
|
+
dcc-patcher apply %USERPROFILE%\.local\bin\claude.exe
|
|
49
|
+
# wrote <builds>\claude-dcc-2.1.295+dcc0.1.11.exe
|
|
50
|
+
# and <builds>\claude-dcc-2.1.295+dcc0.1.11.exe.dcc-lock.json
|
|
51
|
+
# <builds>\claude-dcc.exe -> claude-dcc-2.1.295+dcc0.1.11.exe (hardlink)
|
|
52
|
+
|
|
53
|
+
# Run the patched copy instead of claude
|
|
54
|
+
<builds>\claude-dcc.exe --resume
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
The official `claude.exe` is never modified. Older builds stay in the builds folder for rollback, and the original Claude Code each build was made from is kept beside it. After an update, `check` again; if an edit fails, nothing is written and `check --baseline` shows what changed. Where everything goes, and every option: [docs/launcher.md](https://github.com/DazzleML/dazzle-claude-code-patcher/blob/main/docs/launcher.md).
|
|
58
|
+
|
|
59
|
+
### Make the patched build just `claude`
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
dcc-env # cmd or PowerShell; in Git Bash: . dcc-env
|
|
63
|
+
dcc-patcher status # which claude this shell runs, and anything left to do
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
`dcc-env` exists because no program can change the `PATH` of the shell that started it: it's a small script that runs inside your shell, so it works in one that was already open. The first time, it writes `claude` and `claude-stock` shims and adds their folder to your user `PATH` (after asking, and after saving the old value as a `.reg` file). Every time, it puts that folder on the `PATH` of the shell you typed it in. Shells opened afterwards don't need it.
|
|
67
|
+
|
|
68
|
+
From then on, `claude` runs the current patched build. When Claude Code updates, the next start says so, rebuilds in a few seconds, and runs the new build; if a patch no longer applies, it runs stock instead and says which patch needs attention. `claude-stock` always runs the official build; `dcc-patcher use stock` makes `claude` do the same; `dcc-patcher uninstall-shim` puts everything back. The details, including how to check or undo any of it by hand: [docs/launcher.md](https://github.com/DazzleML/dazzle-claude-code-patcher/blob/main/docs/launcher.md).
|
|
69
|
+
|
|
70
|
+
## How it works
|
|
71
|
+
|
|
72
|
+
- **Patches are written by structure, not by exact text.** Each patch names a stable landmark (a string that survives builds), the shape of the code to change near it, and a replacement. Minified names are wildcards, captured once and reused by later edits. Measured on the 7 Claude Code builds from 2.1.278 to 2.1.289 (2026-09-19 to 10-03): the same edits written as exact text applied in full on only one build, while the structural patch applies unchanged on all seven.
|
|
73
|
+
- **It fails closed.** Every edit must match exactly the number of times it expects, or nothing is written. The output is a new file beside the official `claude.exe`, never an in-place change, and everything except the patched module is verified byte-identical.
|
|
74
|
+
- **It knows when to stop.** A patched module carries a signature, so a patch is never applied twice; and a patch can say how to recognise that Anthropic fixed the bug, so it reports *fixed upstream* instead of *broken*.
|
|
75
|
+
- **It diagnoses.** When an edit no longer matches, `check` shows a diff of that code region against the last build where the patch worked, with minified names normalised so that only real code changes show.
|
|
76
|
+
|
|
77
|
+
## Development
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
python -P -m pytest tests/ -v # tests that need a local claude.exe are skipped without one
|
|
81
|
+
bash scripts/repokit-common/install-hooks.sh # version sync and pre-push checks
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Related Projects
|
|
85
|
+
|
|
86
|
+
- [ojura/claude-patches](https://github.com/ojura/claude-patches): patches for the Claude Code VS Code extension, and the inspiration for this project's approach (structural matching, failing closed, byte-stable verification). This project is its Windows-first, native-CLI counterpart.
|
|
87
|
+
- [claude-session-logger](https://github.com/DazzleML/claude-session-logger), [Claude-Session-Backup](https://github.com/DazzleML/Claude-Session-Backup), [claude-bookmarks](https://github.com/DazzleML/claude-bookmarks): other DazzleML Claude Code tools.
|
|
88
|
+
|
|
89
|
+
## Disclaimer
|
|
90
|
+
|
|
91
|
+
Not affiliated with or endorsed by Anthropic. Patching modifies your local copy of Claude Code and removes its code signature; use it at your own risk, and keep the official `claude.exe` in place.
|
|
92
|
+
|
|
93
|
+
## License
|
|
94
|
+
|
|
95
|
+
dazzle-claude-code-patcher, copyright (C) 2026 Dustin Darcy.
|
|
96
|
+
|
|
97
|
+
This project is licensed under the MIT License - see the [LICENSE](https://github.com/DazzleML/dazzle-claude-code-patcher/blob/main/LICENSE) file for details.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# dcc-env: put the dcc-patcher launcher on PATH in THIS shell, setting it up first if needed.
|
|
2
|
+
# Source it: `. dcc-env` (run as a plain command it would only change a child shell).
|
|
3
|
+
# pip installs it beside dcc-patcher.
|
|
4
|
+
if DCC_ENV=1 dcc-patcher install-shim --if-needed; then
|
|
5
|
+
_dcc_folder="$(dcc-patcher shellenv sh --folder)"
|
|
6
|
+
[ -n "$_dcc_folder" ] && export PATH="$_dcc_folder:$PATH"
|
|
7
|
+
unset _dcc_folder
|
|
8
|
+
dcc-patcher status --brief
|
|
9
|
+
fi
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
@echo off
|
|
2
|
+
rem dcc-env: put the dcc-patcher launcher on PATH in THIS cmd window, setting it up first if needed.
|
|
3
|
+
rem pip installs it beside dcc-patcher.exe. No setlocal: the PATH change has to outlive this script.
|
|
4
|
+
set "DCC_ENV=1"
|
|
5
|
+
dcc-patcher install-shim --if-needed
|
|
6
|
+
set "DCC_ENV_CODE=%ERRORLEVEL%"
|
|
7
|
+
set "DCC_ENV="
|
|
8
|
+
if not "%DCC_ENV_CODE%"=="0" (set "DCC_ENV_CODE=" & exit /b 1)
|
|
9
|
+
set "DCC_ENV_CODE="
|
|
10
|
+
for /f "delims=" %%i in ('dcc-patcher shellenv cmd --folder') do set "PATH=%%i;%PATH%"
|
|
11
|
+
dcc-patcher status --brief
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# dcc-env: put the dcc-patcher launcher on PATH in THIS PowerShell, setting it up first if needed.
|
|
2
|
+
# pip installs it beside dcc-patcher.exe. $env:Path belongs to the whole PowerShell process, so the
|
|
3
|
+
# change outlives this script. Needs an execution policy that runs local scripts (RemoteSigned or
|
|
4
|
+
# looser); otherwise use: dcc-patcher shellenv powershell | Invoke-Expression
|
|
5
|
+
$env:DCC_ENV = '1'
|
|
6
|
+
dcc-patcher install-shim --if-needed
|
|
7
|
+
$dccCode = $LASTEXITCODE
|
|
8
|
+
Remove-Item Env:\DCC_ENV -ErrorAction SilentlyContinue
|
|
9
|
+
if ($dccCode -ne 0) { return }
|
|
10
|
+
$dccFolder = dcc-patcher shellenv powershell --folder
|
|
11
|
+
if ($dccFolder) { $env:Path = "$dccFolder;" + $env:Path }
|
|
12
|
+
dcc-patcher status --brief
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: dazzle-claude-code-patcher
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: Windows-first patch tool for the native Claude Code CLI: apply, verify and diagnose community patches across releases.
|
|
5
|
+
Author-email: "Dustin Darcy (djdarcy)" <djdarcy@users.noreply.github.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/DazzleML/dazzle-claude-code-patcher
|
|
8
|
+
Project-URL: Repository, https://github.com/DazzleML/dazzle-claude-code-patcher
|
|
9
|
+
Project-URL: Issues, https://github.com/DazzleML/dazzle-claude-code-patcher/issues
|
|
10
|
+
Keywords: claude-code,patcher,bun,windows,anthropic,cli
|
|
11
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
12
|
+
Classifier: Environment :: Console
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Topic :: Software Development :: Build Tools
|
|
22
|
+
Classifier: Topic :: Utilities
|
|
23
|
+
Requires-Python: >=3.11
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
License-File: LICENSE
|
|
26
|
+
Provides-Extra: dev
|
|
27
|
+
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
28
|
+
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
|
|
29
|
+
Dynamic: license-file
|
|
30
|
+
|
|
31
|
+
# dazzle-claude-code-patcher
|
|
32
|
+
|
|
33
|
+
[](https://github.com/DazzleML/dazzle-claude-code-patcher/blob/main/LICENSE)
|
|
34
|
+
[](https://www.python.org/downloads/)
|
|
35
|
+
[-lightgrey.svg)](https://github.com/DazzleML/dazzle-claude-code-patcher/blob/main/docs/platform-support.md)
|
|
36
|
+
|
|
37
|
+
> **Fix problematic Claude Code bugs in your local copy now, and keep the fixes working across updates.**
|
|
38
|
+
|
|
39
|
+
`dcc-patcher` diagnoses, verifies, and applies patches to the native Claude Code CLI (`claude.exe`). When Claude Code updates (roughly every two days), one command tells you which patches re-apply as-is and which need attention, and shows exactly what changed. Once set up, `claude` runs the patched build and re-patches each update by itself.
|
|
40
|
+
|
|
41
|
+
> [!NOTE]
|
|
42
|
+
> **Pre-alpha, Windows only.** Five patches apply unchanged on every Claude Code build from 2.1.278 to 2.1.295. The history patch is in daily use: a resumed session scrolls back past every compaction, and the model still receives exactly the same request as stock Claude Code. See the [Roadmap](https://github.com/DazzleML/dazzle-claude-code-patcher/issues/1).
|
|
43
|
+
|
|
44
|
+
## The Problem
|
|
45
|
+
|
|
46
|
+
Some Claude Code bugs sit in code you can't configure around. For example, after a restart or `claude --resume`, everything before the last compaction disappears from the screen. It's still in the session file, but nothing brings it back. Waiting for an upstream improvement or fix can take a while, and patching by hand doesn't survive the next update (Claude Code is minified, so almost every internal name changes from one release to the next).
|
|
47
|
+
|
|
48
|
+
## Patches
|
|
49
|
+
|
|
50
|
+
| Patch | Fixes | Status |
|
|
51
|
+
|---|---|---|
|
|
52
|
+
| [History past compaction](https://github.com/DazzleML/dazzle-claude-code-patcher/blob/main/dcc_patcher/patches/H-history-past-compaction/README.md) | After a restart or `--resume`, scroll back past compactions to the start of the session file | `check` passes on 2.1.278 to 2.1.295; live-tested on 2.1.289 to 2.1.295 |
|
|
53
|
+
| [History across session files](https://github.com/DazzleML/dazzle-claude-code-patcher/blob/main/dcc_patcher/patches/J-history-across-files/README.md) | A conversation that continued into a new session file (after running out of context, or a fork) scrolls back into the file it came from, and on to its first message. Needs the history patch. Derived from ojura/claude-patches' Patch J | `check` passes on 2.1.278 to 2.1.295; not yet live-tested |
|
|
54
|
+
| [Version label](https://github.com/DazzleML/dazzle-claude-code-patcher/blob/main/dcc_patcher/patches/V-version-label/patch.toml) | `--version` says it is a patched build and which patcher made it: `2.1.295 + dcc 0.1.11 (Dazzle Claude Code)`. Only the displayed text changes; the version Claude Code checks against is untouched | `check` passes on 2.1.278 to 2.1.295 |
|
|
55
|
+
| Banner label ([classic](https://github.com/DazzleML/dazzle-claude-code-patcher/blob/main/dcc_patcher/patches/B-banner-label/patch.toml), [flicker-free](https://github.com/DazzleML/dazzle-claude-code-patcher/blob/main/dcc_patcher/patches/B2-banner-label-flicker-free/patch.toml)) | The header at the top of every session reads `Dazzle Claude Code v2.1.295 · dcc 0.1.11`, in both rendering modes. Only the drawn text changes | `check` passes on 2.1.278 to 2.1.295; flicker-free live-tested on 2.1.291 to 2.1.295 |
|
|
56
|
+
|
|
57
|
+
> [!CAUTION]
|
|
58
|
+
> **This project ships the tool and patch definitions only *NEVER* patched binaries.** You patch your own copy of Claude Code, locally. Use at your own risk. No warranty. Backup anything important first. I'd recommend: [claude-session-backup](https://github.com/DazzleML/Claude-Session-Backup).
|
|
59
|
+
|
|
60
|
+
## Installation
|
|
61
|
+
|
|
62
|
+
Python 3.11 or newer, and nothing else.
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
pip install dazzle-claude-code-patcher
|
|
66
|
+
dcc-patcher validate # lists the bundled patches
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
To work on it, install from source instead (`pip install -e ".[dev]"` in a clone). Builds then go to the checkout's `private\builds\` rather than `%LOCALAPPDATA%\dazzle-claude-code-patcher\builds\`.
|
|
70
|
+
|
|
71
|
+
## Usage
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
# Does every patch still apply to this build? (read-only)
|
|
75
|
+
dcc-patcher check %USERPROFILE%\.local\bin\claude.exe
|
|
76
|
+
|
|
77
|
+
# Build a patched copy into the builds folder, with a lockfile recording every edit
|
|
78
|
+
dcc-patcher apply %USERPROFILE%\.local\bin\claude.exe
|
|
79
|
+
# wrote <builds>\claude-dcc-2.1.295+dcc0.1.11.exe
|
|
80
|
+
# and <builds>\claude-dcc-2.1.295+dcc0.1.11.exe.dcc-lock.json
|
|
81
|
+
# <builds>\claude-dcc.exe -> claude-dcc-2.1.295+dcc0.1.11.exe (hardlink)
|
|
82
|
+
|
|
83
|
+
# Run the patched copy instead of claude
|
|
84
|
+
<builds>\claude-dcc.exe --resume
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
The official `claude.exe` is never modified. Older builds stay in the builds folder for rollback, and the original Claude Code each build was made from is kept beside it. After an update, `check` again; if an edit fails, nothing is written and `check --baseline` shows what changed. Where everything goes, and every option: [docs/launcher.md](https://github.com/DazzleML/dazzle-claude-code-patcher/blob/main/docs/launcher.md).
|
|
88
|
+
|
|
89
|
+
### Make the patched build just `claude`
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
dcc-env # cmd or PowerShell; in Git Bash: . dcc-env
|
|
93
|
+
dcc-patcher status # which claude this shell runs, and anything left to do
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
`dcc-env` exists because no program can change the `PATH` of the shell that started it: it's a small script that runs inside your shell, so it works in one that was already open. The first time, it writes `claude` and `claude-stock` shims and adds their folder to your user `PATH` (after asking, and after saving the old value as a `.reg` file). Every time, it puts that folder on the `PATH` of the shell you typed it in. Shells opened afterwards don't need it.
|
|
97
|
+
|
|
98
|
+
From then on, `claude` runs the current patched build. When Claude Code updates, the next start says so, rebuilds in a few seconds, and runs the new build; if a patch no longer applies, it runs stock instead and says which patch needs attention. `claude-stock` always runs the official build; `dcc-patcher use stock` makes `claude` do the same; `dcc-patcher uninstall-shim` puts everything back. The details, including how to check or undo any of it by hand: [docs/launcher.md](https://github.com/DazzleML/dazzle-claude-code-patcher/blob/main/docs/launcher.md).
|
|
99
|
+
|
|
100
|
+
## How it works
|
|
101
|
+
|
|
102
|
+
- **Patches are written by structure, not by exact text.** Each patch names a stable landmark (a string that survives builds), the shape of the code to change near it, and a replacement. Minified names are wildcards, captured once and reused by later edits. Measured on the 7 Claude Code builds from 2.1.278 to 2.1.289 (2026-09-19 to 10-03): the same edits written as exact text applied in full on only one build, while the structural patch applies unchanged on all seven.
|
|
103
|
+
- **It fails closed.** Every edit must match exactly the number of times it expects, or nothing is written. The output is a new file beside the official `claude.exe`, never an in-place change, and everything except the patched module is verified byte-identical.
|
|
104
|
+
- **It knows when to stop.** A patched module carries a signature, so a patch is never applied twice; and a patch can say how to recognise that Anthropic fixed the bug, so it reports *fixed upstream* instead of *broken*.
|
|
105
|
+
- **It diagnoses.** When an edit no longer matches, `check` shows a diff of that code region against the last build where the patch worked, with minified names normalised so that only real code changes show.
|
|
106
|
+
|
|
107
|
+
## Development
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
python -P -m pytest tests/ -v # tests that need a local claude.exe are skipped without one
|
|
111
|
+
bash scripts/repokit-common/install-hooks.sh # version sync and pre-push checks
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## Related Projects
|
|
115
|
+
|
|
116
|
+
- [ojura/claude-patches](https://github.com/ojura/claude-patches): patches for the Claude Code VS Code extension, and the inspiration for this project's approach (structural matching, failing closed, byte-stable verification). This project is its Windows-first, native-CLI counterpart.
|
|
117
|
+
- [claude-session-logger](https://github.com/DazzleML/claude-session-logger), [Claude-Session-Backup](https://github.com/DazzleML/Claude-Session-Backup), [claude-bookmarks](https://github.com/DazzleML/claude-bookmarks): other DazzleML Claude Code tools.
|
|
118
|
+
|
|
119
|
+
## Disclaimer
|
|
120
|
+
|
|
121
|
+
Not affiliated with or endorsed by Anthropic. Patching modifies your local copy of Claude Code and removes its code signature; use it at your own risk, and keep the official `claude.exe` in place.
|
|
122
|
+
|
|
123
|
+
## License
|
|
124
|
+
|
|
125
|
+
dazzle-claude-code-patcher, copyright (C) 2026 Dustin Darcy.
|
|
126
|
+
|
|
127
|
+
This project is licensed under the MIT License - see the [LICENSE](https://github.com/DazzleML/dazzle-claude-code-patcher/blob/main/LICENSE) file for details.
|