Apple native — initial audit (2026-11-20)
Scope: what the existing Claude Remote / Codex Remote platform really offers, read from the code at
claude-remote.git @ ae3306f and from the two production instances, before any native code was written.
Platform as found
| Item | Finding (source) |
|---|---|
| Code | One pnpm monorepo: packages/shared (zod DTOs, wire formats, states, agent profiles), apps/runtime, apps/server (Fastify, ~5.4 k lines), apps/web (Next 16 static export) |
| Instances | Two, same code, on node M5M36: Claude (:8620, db claude_remote, https://claude.spboucher.ai) and Codex (CR_AGENT=codex, :8630, db codex_remote, https://codex.spboucher.ai). Both main, clean, in sync with origin |
| Privilege boundary | Server never spawns anything; the runtime (unix socket 0600 + bearer) is the only process that touches tmux, PTY, files, git. Public path: browser → Caddy (BHS64) → server |
| Sessions | Real CLI in tmux cr-<uuid>; a client = one tmux attach through node-pty; history replay + live screen on every attach, painted in the normal buffer. States set from CLI hooks, never from parsing output |
| REST / WS | /api/v1: auth, projects, sessions, files (+git), tasks, cluster, skills/MCP, system, notifications, settings, OpenAPI. WS: terminal stream (binary PTY + JSON control), task log stream, events |
| Authentication | Password (argon2id) + mandatory second factor (TOTP or passkey); a passkey with user verification is also accepted on its own (/auth/passkey/login/* without a session). @simplewebauthn/server v14, UV required, resident key required |
| WebAuthn RP | RP ID = host of CR_PUBLIC_ORIGIN: claude.spboucher.ai and codex.spboucher.ai; expected origin = the same https origin |
| Production accounts | Each instance: 1 administrator, 1 registered passkey, no TOTP (database counts, 2026-11-20). The two instances have separate accounts and separate passkeys |
| Browser session | Cookie __Host-cr_sid (HttpOnly, Secure, SameSite=Strict), CSRF header + exact Origin on mutations and WS upgrades; idle 12 h, absolute 30 d |
| Devices | GET/DELETE /auth/devices list passkeys and browser sessions; revocation closes WebSockets (4401) |
Gaps for native clients
| Gap | Evidence | Decision |
|---|---|---|
| No Apple App Site Association | GET /.well-known/apple-app-site-association → 403 on production |
Add a public AASA route (webcredentials + applinks) — required for native passkeys on the same RP ID |
| No credential usable outside a browser | docs/api.md: "no API token … cookie only"; guard requires cookie + Origin + CSRF |
Add native sessions: bearer token, client_kind='native', short-lived token rotated with a device-bound P-256 key (Secure Enclave). Cookie rules untouched; a bearer needs no CSRF because it is not an ambient credential |
| Sessionless passkey challenge lives in a cookie | __Host-cr_pre in factors.ts |
Native variant returns an opaque single-use challengeToken |
| No push | notifications/service.ts: "Web Push is NOT implemented"; no APNs |
Device-token registration + APNs HTTP/2 sender fed by the existing Notifier; payloads never carry terminal content |
| No lightweight status for widgets / menu bar | — | GET /native/summary |
| Device list knows only browsers | Device.kind = passkey / session |
Additive native kind with platform, model, app version |
Specified in NATIVE-API-CONTRACT.md.
Documentation claims that are not production facts
- Passkeys were verified with a software authenticator only; the registered production passkeys were created by the owner in a browser. Where each one is stored (iCloud Keychain or another provider) cannot be read from the server; a passkey kept outside iCloud Keychain or a compatible credential provider will not be offered to the native apps on other devices.
- Never verified on the platform: real iPhone, Web Push, registry install, local models, a real remote task.
docs/authentication.mdstill says no administrator exists; both instances have one.
Decisions
- Separate repository on the Mac (
~/Desktop/Cluster/apple/MacLustr/ClaudeRemote, spbgitclaude-remote-apple.git) instead ofapps/apple/in the monorepo: the monorepo's working copies are the deployed directories on a node without Xcode, and nothing may live under~/Desktopthere; Apple projects are the documented laptop exception. - One code base, four apps: the agent profile (base URL, RP ID, names, accent, URL scheme) is build configuration; Claude Remote and Codex Remote differ only by it, exactly as the two web instances do.
- Sign-in mirrors the web: same account, same passkey (Touch ID / Face ID through AuthenticationServices), password + second factor, TOTP when enrolled. No new credential database.
- Bundle ids
ai.spboucher.clauderemote,ai.spboucher.codexremote(shared by macOS and iOS), team3YM54G49SN; capabilities registered 2026-11-20: Associated Domains, Push Notifications, App Groups.