v0.3.0 — the move to the parsed tree
patch-cc now locates and edits the Claude Code bundle through a parsed syntax tree instead of string and regex scanning. A patch finds an authored name — a property, a case label, an API string — and edits the grammar node it identifies, never the minified syntax between anchors, so a re-minified daily build changes nothing a matcher depends on.
Why upgrade now
- Opens current Claude again. The released 0.2.x line reads the entrypoint by a hardcoded list of module names, which the 2.1.229 rename (
…/src/entrypoints/cli.js→…/cli) broke — 0.2.x opens no build from 2.1.229 on. 0.3.0 reads the entrypoint the container itself declares (entry_point_id), the same index Bun resolves by.
What changed
- A parsed-tree toolkit (
patch_cc/js.py): an immutableSource, node-boundary edits, and an incremental reparse that doubles as a syntax gate — every batch of edits is parsed, and rubble is refused before it can reach a binary. - Discovery over hardcoding. Built-in agents and model aliases are read from the bundle itself (including
agentTypevalues upstream hoists into constants), so a new upstream agent or model appears without a code change. - Safety hardening. A temporal-dead-zone-aware scope check (a spliced identifier can no longer be read before its declaration), a from-scratch parse of the final image before writing, an ELF guard that refuses an allocated
SHT_NOBITSsection after.bun, and deduplication of Codex model ids at the cache/manifest boundary. - A documented corpus.
docs/corpus.mdlists the pristine backupsdoctorsweeps, with hashes, so every measured claim in the playbook is one command from re-verification.
Verified with patch-cc doctor green across every pristine backup on disk (2.1.216 → 2.1.233); CI (ruff, mypy) passes on Python 3.11–3.14.
Install
uvx patch-cc # run without installing
uv tool install patch-cc # or keep it on PATH
pip install patch-cc # ordinary PyPI packageFull details: docs/PLAYBOOK.md · docs/INTERNALS.md