Skip to content

refactor(launcher): unify the three launchers into one env-toggled launcher per platform#5

Merged
phase3dev merged 9 commits into
mainfrom
launcher-refactor
Jun 10, 2026
Merged

refactor(launcher): unify the three launchers into one env-toggled launcher per platform#5
phase3dev merged 9 commits into
mainfrom
launcher-refactor

Conversation

@phase3dev

Copy link
Copy Markdown
Owner

Summary

Consolidates the three separate launchers (claudemax, claude-think, claude-context) into a single env-toggled launcher per platform (launcher/claudemax + launcher/claudemax.win.js), and generalizes the hard-coded context-icon patch into a feature registry + per-file reconcile engine (undo-all-reverse -> apply-enabled-forward -> write-if-changed).

  • Every fix is independently switchable: CC_WORKAROUNDS (master), CC_RECONCILE (bypass), CC_THINKING_DISPLAY, CC_PATCH_CONTEXT_ICON - all on by default.
  • Context-icon now writes an ownership-marked form, and the reconcile undoes only the marked form.
  • Repo restructured into launcher/ + fixes/<name>/ (+ fixes/_template/); the single-fix launchers are removed.
  • Whole-file pristine snapshot suffix .bak-context-icon -> .bak-cc-workarounds.

Breaking change (see migration below). This is PR 1 of 2 in a coordinated breaking release; the markdown copy/export feature follows in PR 2.

Migration (clean break)

Old New
claudemax (both fixes) launcher/claudemax (same name, now carries every fix)
claude-think (thinking only) launcher/claudemax with CC_PATCH_CONTEXT_ICON=0
claude-context (context icon only) launcher/claudemax with CC_THINKING_DISPLAY=omitted

Repoint claudeCode.claudeProcessWrapper (VS Code) at the new launcher/claudemax path and reload.

Test plan

  • python3 -m unittest discover -s tests (32 cases: reconcile matrix + bash/node parity)
  • bash -n / ShellCheck (--severity=warning) / node --check / py_compile
  • CI green on this PR

🤖 Generated with Claude Code

phase3dev and others added 9 commits June 10, 2026 01:55
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ship marker

Replaces the single hard-coded context-icon sed with a generic registry whose
bundle-patch features register idempotent, ownership-marked apply/undo pairs.
Per-file reconcile undoes all known features (reverse) then re-applies enabled
ones (forward), writing only on change. Adds CC_WORKAROUNDS master switch and
CC_RECONCILE emergency bypass. New tests/test_reconcile.py covers the matrix.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Ports the bash reconcile engine into claudemax.win.js with the same ownership
marker, master switch (CC_WORKAROUNDS), and emergency bypass (CC_RECONCILE),
preserving the Windows .cmd/.bat shim resolution and discovery hardening.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… form

Keeps fix-context-icon.py byte-consistent with the launcher, so the launcher's
reconcile recognizes a standalone-patched bundle (no spurious anchor warning).
--revert stays backup-based in this PR.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…x template

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…d launcher

Retargets all launcher names/paths/toggles to launcher/claudemax and the
fixes/<name>/ layout, adds the toggle table and clean-break migration note,
documents the per-file reconcile model, ownership marker, and the .bak-cc-
workarounds emergency snapshot. Updates the launcher header comments to match.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ise walk-up

Codex audit follow-ups, folded into the reconcile mechanism so md-copy builds
on a clean base.

Finding 1 (legacy bare-101): the old launcher/standalone wrote a bare,
unmarked `>=101)return null}`. The marker-only undo treated that as foreign, so
every default launch warned "context-icon anchor not found (extension
changed?)" and `CC_PATCH_CONTEXT_ICON=0` could not revert it (breaking the
migration table). undo now recognizes the bare form as a second ownership
fingerprint (`>=101` is dead upstream code, so it only ever appears as our own
output). A legacy bundle now self-heals: a default launch reverts bare -> `>=50`
then re-applies the marked form, capturing the correct pristine snapshot, with
no warning; a disabled launch reverts cleanly. The genuine "extension changed"
warning still fires for an unrecognized bundle.

Finding 2 (Windows precise discovery): reconcile was called with only
wrapperBin, ignoring the resolved `claude` (CLAUDE_REAL_BIN / autodetected).
An extension whose root sits outside the HOME fallback scan was left unpatched
on a terminal launch, contradicting the documented discovery model and bash's
walk from REAL_CLAUDE. Now reconcile(wrapperBin || claude), at parity with bash.

Tests: replace the obsolete "bare-101 is upstream" assertion with legacy
adoption + stderr-quiet coverage (upgrade-when-enabled, revert-when-disabled,
revert-by-master-switch, unrecognized-still-warns) across bash and node, plus a
precise-walk-up test with an extension root outside the fallback scan on both
platforms. 24 -> 32 tests, all green; bash -n / shellcheck --severity=warning /
node --check / py_compile clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@phase3dev phase3dev merged commit 90bdfad into main Jun 10, 2026
1 check passed
@phase3dev phase3dev deleted the launcher-refactor branch June 10, 2026 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant