Twin Browser + Claude Code
Claude Code is Anthropic’s agentic coding tool that runs in the terminal and supports MCP servers. Registered MCP tools become available to the agent so it can take real actions — including browser automation — as part of a coding task.
How Twin plugs into Claude Code
Register the Twin MCP server with Claude Code and its agent can call `run`, `compile_skill`, and `run_skill`. That turns “check that the deployed page works” or “grab the data behind this login” into a single tool call. Compiled skills replay deterministically with zero LLM calls, so a verification step you run on every change costs a fraction of an exploratory agent run.
Twin is the browser execution layer your stack calls. The first run cold-compiles a skill; every similar request after that is matched from the cache and replayed deterministically, so your marginal cost per run trends toward zero.
- Receive goal from Claude Codedone
- Compile DOM → token-efficient indexed statedone
- Match the semantic dispatch cacherunning
- Replay compiled skill — 0 LLM callsqueued
What you get through Claude Code
Every integration is a thin wrapper over the same execution layer, so the cache, replay, and corpus benefits apply no matter how you call in.
Semantic dispatch cache
A re-phrased goal fuzzy-matches an already-compiled skill, so most calls never touch the LLM.
Deterministic replay
A compiled skill replays the exact action path with zero LLM calls — fast, repeatable, cheap.
Cross-tenant skill corpus
A skill compiled once can be safely reused across tenants, so the hit rate climbs as the network runs.
One Bearer key
Auth, usage-based billing, and an audit log run on every call — the same key works from every integration.
Drop Twin into Claude Code
Copy, paste, and swap in your Bearer key. The first run compiles a skill; repeats hit the semantic dispatch cache and replay deterministically.
claude mcp add twin-browser \
--url https://twin-browser.com/api/v1/mcp \
--header "Authorization: Bearer tw_live_xxx"
# Then, inside Claude Code:
# "With twin-browser, run the signup flow on the preview URL and
# compile it into a skill so we can replay it on every deploy."Base URL https://twin-browser.com/api/v1 · auth Authorization: Bearer tw_live_… · MCP tools run, compile_skill, run_skill.
Connect Claude Code in 4 steps
Install → configure your key → make the first call. The cache takes over from there.
- 1Add the server
Run claude mcp add or edit the MCP config to include the Twin server.
- 2Provide the key
Set the Authorization header to your Twin Bearer key.
- 3Confirm the tools
Claude Code lists run, compile_skill, and run_skill on startup.
- 4Use it in a task
Ask Claude Code to perform or verify a web flow; it calls Twin.
Why this stays cheap at scale
Most browser infrastructure re-runs the LLM on every execution, so cost climbs with usage. Twin compiles a task once via skill compilation, matches re-phrased requests to it, and replays without the model — so repeated workflows stop scaling with your token bill.
Claude Code on Twin — common questions
Why use Twin inside Claude Code instead of a headless browser script?
Can Claude Code compile skills for CI?
More ways to connect Twin
MCP (Model Context Protocol)
MCP is an open protocol that lets an LLM application discover and call external tools over a standard interface. An MCP client (Cursor, Claude Desktop, Claude Code, Cline) connects to an MCP server, lists its tools, and invokes them on the model’s behalf — no bespoke glue per app.
Cursor
Cursor is an AI-native code editor with a built-in agent that can call MCP tools. Once an MCP server is registered in Cursor’s settings, the agent can invoke its tools while you work — including driving a real browser.
REST API
Twin’s REST API is the universal integration path: a small set of HTTPS endpoints under `/api/v1/*` authenticated with a Bearer key. Any language that can make an HTTP request can drive the browser execution layer — no SDK required.
Wire up Claude Code in minutes
Free to start. Usage-based credits from $29/mo, with LLM cost metered and passed through at 1×.