Skip to main content

dazzle-claude-code-patcher

PyPI Release Date PyPI Downloads Python 3.11+ License: MIT GitHub Discussions Installs Platform

Fix problematic Claude Code bugs in your local copy now, and keep the fixes working across updates.

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.

The Problem

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).

Patches

Patch Fixes Status
History past compaction 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
History across session files 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
Version label --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
Banner label (classic, flicker-free) 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
Compaction rows in the normal view The normal screen shows a Compact summary (ctrl+o to expand) line at each compaction, as the transcript does, so both views start at the same first row after a resume. Display only check passes on 2.1.278 to 2.1.295; not yet live-tested

Installation

Python 3.11 or newer. The one dependency, dazzle-lib, is itself standard-library only.

pip install dazzle-claude-code-patcher
dcc-patcher -h                   # the commands, grouped by what they act on
dcc-patcher validate             # lists the bundled patches
dcc-patcher update               # is this install current? (--fix updates it, after asking)

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\.

Usage

# Does every patch still apply to this build? (read-only)
dcc-patcher check %USERPROFILE%\.local\bin\claude.exe

# Build a patched copy into the builds folder, with a lockfile recording every edit
dcc-patcher apply %USERPROFILE%\.local\bin\claude.exe
#   wrote <builds>\claude-dcc-2.1.295+dcc0.1.11.exe
#     and <builds>\claude-dcc-2.1.295+dcc0.1.11.exe.dcc-lock.json
#   <builds>\claude-dcc.exe -> claude-dcc-2.1.295+dcc0.1.11.exe (hardlink)

# Run the patched copy instead of claude
<builds>\claude-dcc.exe --resume

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.

Make the patched build just claude

dcc-env                         # cmd or PowerShell; in Git Bash: . dcc-env
dcc-patcher status              # which claude this shell runs, and anything left to do

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 the claude, dazzle-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.

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.

Switching. dazzle-claude and claude-stock always run the patched and the official build, whatever claude means. To change what claude itself means:

dcc-env stock                   # in this shell only (also: patched, a build's file name, or default to undo)
dcc-env --help                  # the choices, without changing anything
dcc-patcher use stock           # everywhere, from the next start (also: patched, a build's file name)
dcc-patcher status              # says which one wins in this shell, and why

dcc-patcher uninstall-shim puts everything back. The details, including how to check or undo any of it by hand: docs/launcher.md.

How it works

  • 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.
  • 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.
  • 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.
  • 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.

Development

python -P -m pytest tests/ -v   # tests that need a local claude.exe are skipped without one
bash scripts/repokit-common/install-hooks.sh   # version sync and pre-push checks

Disclaimer

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.

License

dazzle-claude-code-patcher, copyright (C) 2026 Dustin Darcy.

This project is licensed under the MIT License - see the LICENSE file for details.

Metadata

Release files for dazzle-claude-code-patcher 0.2.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dazzle-claude-code-patcher 0.2.4
File Size Uploaded
dazzle_claude_code_patcher-0.2.4.tar.gz 72.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dazzle-claude-code-patcher 0.2.4
File Interpreter ABI Platform
dazzle_claude_code_patcher-0.2.4-py3-none-any.whl Python 3 none any Details

Total release size: 149.9 kB

Release files / dazzle_claude_code_patcher-0.2.4.tar.gz

Download URL dazzle_claude_code_patcher-0.2.4.tar.gz
Size 72.8 kB
Tags Source
SHA-256 checksum
How to use checksums
a4229c8846520e9de9568707193f4aa671c8177653f48f56748351b62c08eb25
BLAKE2b-256 checksum
How to use checksums
6acedf06200470466909bf70d53998fb2b0d46a4d25e4a34e3f718bef1c7b7b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 11, 2026.

Transparency log

Release files / dazzle_claude_code_patcher-0.2.4-py3-none-any.whl

Download URL dazzle_claude_code_patcher-0.2.4-py3-none-any.whl
Size 77.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a30ebaab2d1392273bcfffda8e1dbfbd8588c06b7b2f1c1b398d427f82334abb
BLAKE2b-256 checksum
How to use checksums
3903a9c79f08816690d8a2b86883af5d4ad865df84df10fcbe42751ac56f9426
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 11, 2026.

Transparency log

Release history Release notifications | RSS feed

0.2.5

2 release files

This release

0.2.4 This release

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page