Claude Code Patching — Native Mobile Integration Guide
Audience: future Swift / iOS and Kotlin / Android developers + DevOps engineers asking “what happens when Claude Code updates and breaks the VSRelay integration?”
TL;DR
VSRelay depends on patched files inside the Claude Code VS Code extension (extension.js, webview/index.js). Claude Code updates roughly every 1-2 weeks; the minifier reshuffles variable names and the patches break. The native mobile binary has zero knowledge of patches, so the recovery flow lives entirely on the desktop side via two channels:
- In-extension applier (primary, Phase D-α): extension contains bundled
patches/+ applies them via avscode.window.showInformationMessage({ modal: true })consent prompt. Phone taps a button → desktop modal pops → user clicks Allow → patches apply. npx @vsrelay/doctor repairCLI (fallback, Phase D-β): npm-published package with bundled manifests. Works from any terminal without the repo.
What the native app does
Nothing. The native binary renders recoveryActions (including the invoke_extension_command primitive) generically. It forwards the command string verbatim in the wire message. The native app fetches data, sends data, renders data — it never patches, never executes, never invokes anything on the device.
What the desktop extension does
- Probes
claude-integration-healthevery 30 s. Detects unpatched files. - Emits
ClaudeIntegrationStatus { status: 'recovery_required', recoveryActions: [...] }. - On
invoke_extension_command_requestfrom phone: validates thecommandstring against avsrelay.*allowlist (deny by default; transitionalagentic-ides.*alias also accepted during rebrand). Invokes viavscode.commands.executeCommand. - The invoked command (
vsrelay.applyPatches) reads the bundled manifest at<extensionPath>/patches/v<version>/manifest.json, shows the consent modal (once per Claude Code version, persisted incontext.globalState), and applies via the shared@vsrelay/patch-applier.applyManifest()function.
Why this is App-Store-safe
| App Store concern | Truthful answer |
|---|---|
| Does the native app execute remote code? | No. Forwards command strings via wire; never invokes. |
| Does the native app modify the device filesystem? | No. The desktop modifies its own Claude Code install on the user’s laptop — entirely off-device from the App-Store perspective. |
| Does the native app download executable manifests? | No. Manifests live in the VS Code extension and in the npm-published @vsrelay/doctor package — both desktop-side, both updated through their respective Marketplace/npm registry channels. |
Why we keep the npx CLI fallback
Some users:
- Click Block on the consent modal (intentional or accidental).
- Have policies forbidding extensions from mutating other extensions’ files.
- Want to verify exactly what’s being patched before authorizing.
npx @vsrelay/doctor repair lets them recover from a terminal without engaging the extension’s auto-apply path.
The patch lifecycle
- Anthropic ships Claude Code 2.1.X.
- VSRelay developer detects the break (locally and via diagnostic log monitoring).
- Developer decodes the minifier renames and creates the new anchor + replacement files manually.
- New
patches/v2.1.X/manifest.jsoncommitted to the monorepo. - New VSRelay extension version published to Marketplace with the bundled manifest.
- New
@vsrelay/doctorversion published to npm with the bundled manifest. - End users get either path via their respective auto-update channels.
No App Store / Play Store update needed for the native client at any point.
Cross-references
RecoveryActions— the v1 + v2 RecoveryAction primitives + theinvoke_extension_commandshape.ProductionDeploymentArchitecture— four trust tiers; patching is orthogonal.patches/README(source repo) — manifest schema + how-to-add-a-version.- Spec:
docs/superpowers/specs/2026-05-21-end-user-production-installer-design(source repo).