|
| 1 | +# The unified launcher |
| 2 | + |
| 3 | +One bash launcher (`claudemax`) and one Windows launcher (`claudemax.win.js`) |
| 4 | +carry every fix in this repo. Each fix is on by default and independently |
| 5 | +switchable at runtime with an environment variable, so the same artifact serves |
| 6 | +"I want everything" and "I want only X" without editing code and without |
| 7 | +recompiling. The Windows launcher compiles to a single `claudemax.exe` with |
| 8 | +`pkg`. |
| 9 | + |
| 10 | +Both launchers are drop-in process wrappers: they find the real `claude`, peel |
| 11 | +the process-wrapper convention args, inject the thinking-display flag when a real |
| 12 | +agent run is detected, reconcile the webview bundle, then exec the real CLI. |
| 13 | + |
| 14 | +## Wiring (process wrapper) |
| 15 | + |
| 16 | +VS Code, official "Claude Code" extension: |
| 17 | + |
| 18 | +- Set `claudeCode.claudeProcessWrapper` to the full path of `launcher/claudemax` |
| 19 | + (or `claudemax.exe` on Windows), then reload the window. |
| 20 | +- In a multi-root `.code-workspace`, this setting is window-scoped: put it in the |
| 21 | + workspace file's `settings` block (or in User settings), not in a folder |
| 22 | + `.vscode/settings.json`. |
| 23 | + |
| 24 | +VS Code, third-party "Claude Code Chat" extension: |
| 25 | + |
| 26 | +- Set `claudeCodeChat.executable.path` to the launcher. |
| 27 | + |
| 28 | +Terminal: |
| 29 | + |
| 30 | +- Run `claudemax` in place of `claude`. |
| 31 | + |
| 32 | +## Toggles |
| 33 | + |
| 34 | +| Env var | Default | Effect | |
| 35 | +| --- | --- | --- | |
| 36 | +| `CC_WORKAROUNDS` | `1` | Master switch. `0` disables every fix (argument injection and bundle patches) and reverts the webview to a clean bundle on launch. | |
| 37 | +| `CC_RECONCILE` | `1` | `0` = do not read or write the webview bundle this launch (emergency bypass). Argument injection still runs. | |
| 38 | +| `CC_THINKING_DISPLAY` | `summarized` | `summarized` shows extended-thinking summaries; `omitted` hides them (no injection). | |
| 39 | +| `CC_PATCH_CONTEXT_ICON` | `1` | `0` leaves the context-usage icon unpatched (and reverts ours on the next launch). | |
| 40 | + |
| 41 | +Setting toggles without touching the script: |
| 42 | + |
| 43 | +- Use the extension's existing `claudeCode.environmentVariables` setting to set |
| 44 | + any `CC_*` toggle from the settings UI on any OS, including against the compiled |
| 45 | + `claudemax.exe`. |
| 46 | +- Source-script users can instead edit the `FEATURE DEFAULTS` block near the top |
| 47 | + of `claudemax` / `claudemax.win.js`. |
| 48 | + |
| 49 | +## Overriding the real binary |
| 50 | + |
| 51 | +- `CLAUDE_REAL_BIN` - full path to the real `claude`, if autodetection fails. |
| 52 | +- `CC_NODE_BIN` (Windows) - path to `node.exe`, used when resolving a `.cmd` / |
| 53 | + `.bat` shim without going through a shell. |
| 54 | + |
| 55 | +## Building the exe |
| 56 | + |
| 57 | +``` |
| 58 | +npm i -g pkg |
| 59 | +pkg launcher/claudemax.win.js --targets node18-win-x64 --output claudemax.exe |
| 60 | +``` |
| 61 | + |
| 62 | +The exe is distributed through GitHub Releases, not committed to the repo. |
0 commit comments