10e06220196ed89970f551b502d08b3786f9cbec
Co-authored-by: Theo Browne <[email protected]>
CodeThing (t3: Node + WebSocket + Browser)
CodeThing now runs as a local Node.js runtime that serves a browser UI and exposes a local WebSocket API.
Current implementation is:
- Codex-first: connects to
codex app-serverand streams turn/item events. - Provider-ready: renderer speaks a provider abstraction so Claude Code can plug in later.
- Typed end-to-end: contracts validate payloads across the WebSocket boundary.
Quickstart
npx t3
On launch, t3:
- starts a local WebSocket runtime (
127.0.0.1), - serves the web UI in your browser,
- auto-connects to your current working directory as the default project.
CLI flags:
--no-open— do not open a browser window automatically.--backend-port <port>— set WebSocket runtime port.--web-port <port>— set web UI port.--cwd <path>— choose launch project directory (defaults to current directory).--help— print CLI usage.
Optional environment variables:
T3_NO_OPEN=1— start runtime without auto-opening a browser window.T3_BACKEND_PORT— override local WebSocket runtime port (default4317).T3_WEB_PORT— override local web UI port (default4318).
Workspace layout
/apps/t3: CLI launcher + local WebSocket runtime server./apps/desktop: Runtime internals used byt3(no Electron app shell)./apps/renderer: React + Vite UI for session control, conversation, and protocol event stream./packages/contracts: shared Zod schemas + TypeScript types for WS protocol, provider events, and API contracts.
Codex prerequisites
- Install Codex CLI so
codexis on your PATH. - Authenticate Codex before running CodeThing (for example via API key or ChatGPT auth supported by Codex).
- CodeThing starts the server via
codex app-serverper session.
Runtime boundary model
t3starts a localhost-only WebSocket server.- Browser renderer talks through a typed
NativeApiadapter over that WebSocket. - Runtime validates request payloads with shared Zod contracts.
- Codex execution sandbox policy (
read-only,workspace-write,danger-full-access) is still selected per session startup options.
Runtime modes
CodeThing has a global runtime mode switch in the sidebar:
Full access(default): starts new sessions withapprovalPolicy: neverandsandboxMode: danger-full-access.Approval required: starts new sessions withapprovalPolicy: on-requestandsandboxMode: workspace-write, then prompts in-app for command/file approvals.
Mode changes apply across all threads. Existing live sessions are restarted so old and new threads use the selected mode.
Scripts
bun run dev: builds contracts, startst3runtime, opens browser UI.bun run build: builds contracts, renderer static assets, andt3CLI bundle.bun run typecheck: strict TypeScript checks for all packages.bun run test: runs workspace tests.bun run --cwd apps/t3 dev: run the CLI directly in dev mode.
Provider architecture
The renderer depends on nativeApi.providers.*:
startSessionsendTurninterruptTurnrespondToRequeststopSessionlistSessionsonEvent
Codex is the only implemented provider right now. claudeCode is reserved in contracts/UI but returns a not-implemented error in main-process dispatch.
Releases
7
Android APK · build 49
Latest
Languages
TypeScript
95.5%
MDX
2.1%
JavaScript
0.7%
Astro
0.3%
CSS
0.3%
Other
0.9%