Skip to content

docs(superpowers): cc-cloud thin-client PoC — PASS (v2.1.167) - #229

Open
imryao wants to merge 2 commits into
mainfrom
spec/cc-cloud-thin-client-poc
Open

imryao wants to merge 2 commits into
mainfrom
spec/cc-cloud-thin-client-poc

Conversation

@imryao

@imryao imryao commented Jun 7, 2026

Copy link
Copy Markdown
Member

Re-verifies the 2026-05-05 finding that Claude Code's public binary
has no thin-client TUI mode. The finding no longer holds. v2.1.167
ships a real --cloud thin-client; this PR carries the design spec,
implementation plan, and PoC outcome.

TL;DR

  • PASS with 2 same-length binary patches + 9 mock HTTP routes.
  • Patches: P1_url_allowlist (99 B) replaces the ANTHROPIC_BASE_URL
    ternary; P2_rd_includes (16 B) short-circuits the
    CLAUDE_CODE_CUSTOM_OAUTH_URL allowlist check.
  • claude --cloud 'hello' is fire-and-forget: binary uploads the
    prompt embedded in POST /v1/sessions, prints Created remote session / View / Resume with: claude --teleport <sid> and exits 0.
  • The bridge:repl WebSocket is wired in the binary but exercised by
    the resume client (claude --teleport or claude.ai/code web), not
    the CLI launcher. We registered the WS route in the mock but it
    wasn't opened in this run.

Strategic implication

Small. The codex-primary stance from agent_integration_strategy.md
never depended on "no thin client exists" alone — it depended on
patch maintenance cost per release, mock-surface drift, fake-OAuth
handling, and lack of on-demand sandbox provisioning. None of those
got cheaper. cc-broker stays on claude -p headless; no pivot.

Repo footprint

  • docs/superpowers/specs/2026-06-06-cc-cloud-thin-client-poc-design.md
    — spec + filled-in section 11 outcome (patch bytes, proof excerpts,
    implications).
  • docs/superpowers/plans/2026-06-07-cc-cloud-thin-client-poc.md —
    the executed plan.

PoC artifacts (patch_cli.py, mock_gateway.py, run_poc.sh,
claude-167-patched, logs, 9 iteration journals) live under
/tmp/cc-cloud-poc/ and are deliberately NOT committed — the PoC's
value is the conclusion and the patch recipe (preserved in spec §11
and updated memory), not re-runnable code.

🤖 Generated with Claude Code

mryao and others added 2 commits June 6, 2026 21:44
…ect PoC

Reverses the 2026-05-05 conclusion (Claude Code TUI has no thin-client
mode, cc-app path abandoned) after re-verifying against v2.1.167:

- isThinClient symbol is wired into the TUI render path
- routeThinClientCommand / isThinClientSafe / isBridgeDispatchable
  classifiers are present
- bridge:repl carries inbound user messages + outbound assistant frames
- teleportToRemote / pollRemoteSessionEvents / awaitRemoteSessionResult
  form a real submit-and-subscribe protocol against /v1/code/sessions
- new --cloud top-level flag is the user-facing entrypoint

Spec designs a 1-2 day PoC: patched binary + Python mock gateway,
proving (or disproving) that the new thin-client mode can be redirected
at our own gateway. PoC artifacts live in /tmp; only this spec and
follow-up memory updates land in the repo.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
v2.1.167 --cloud thin-client mode redirected to a local mock gateway
with 2 same-length binary patches and 9 mock HTTP routes:

  P1_url_allowlist (99 B): replace the ANTHROPIC_BASE_URL ternary so
    both api-staging halves point at the mock; prod fallback preserved.
  P2_rd_includes   (16 B): short-circuit the CLAUDE_CODE_CUSTOM_OAUTH_URL
    allowlist check (!Rd$.includes(K) -> (0&&Rd$.incl(K))).

`claude --cloud 'hello'` completes fire-and-forget against the mock:
binary uploads the prompt as an embedded session event in POST
/v1/sessions, gets back the envelope, prints `Created remote session
/ View / Resume with: claude --teleport <sid>` and exits 0. Telemetry
NDJSON confirms tengu_remote_create_session_success and
tengu_ccr_session_link, no failed-events file written.

The CLI launcher itself is fire-and-forget — it never opens the
WebSocket. The bridge:repl WS path exists in the binary (isThinClient
is wired) but is exercised by the resume client (claude --teleport or
claude.ai/code web), not the launcher. Verifying the WS half is left
as a follow-on if anyone ever needs it.

Strategic implication is small: the 2026-05-05 "no thin client exists"
premise is invalidated, but the codex-primary stance is unchanged —
patch maintenance per release, mock-surface drift, and lack of
on-demand sandbox provisioning are all still real costs. See spec
section 11 for the full patch set, gateway log proof, and
implications; see updated cc_binary_internals.md memory for the
patch recipe.

PoC artifacts (patch_cli.py, mock_gateway.py, run_poc.sh,
claude-167-patched, 9 iteration journals) live under
/tmp/cc-cloud-poc/ and are deliberately NOT committed.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
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