Skip to content
Dashboard
Integrations

Anthropic Claude

Use Claude's computer-use capabilities with Lightcone browser sessions.

Use Anthropic Claude’s computer use with Lightcone cloud browsers. Claude sees screenshots of the browser and decides what to click, type, and scroll. Lightcone provides the sandboxed execution environment.

Terminal window
pip install tzafon playwright anthropic
playwright install chromium
import anthropic
from tzafon import Lightcone
from playwright.sync_api import sync_playwright
import base64
# Create a Lightcone browser session
lc = Lightcone()
session = lc.computers.create(kind="browser")
cdp_url = session.endpoints.get("cdp")
# Connect Playwright
with sync_playwright() as p:
browser = p.chromium.connect_over_cdp(cdp_url)
page = browser.contexts[0].pages[0]
page.goto("https://example.com")
screenshot = page.screenshot()
b64_screenshot = base64.b64encode(screenshot).decode()
# Ask Claude to analyze the page
client = anthropic.Anthropic()
response = client.messages.create(
model="claude-sonnet-4-20250514",
max_tokens=1024,
tools=[{
"type": "computer_20250124",
"name": "computer",
"display_width_px": 1280,
"display_height_px": 720,
"display_number": 1,
}],
messages=[{
"role": "user",
"content": [
{"type": "text", "text": "Click on the 'More information' link"},
{
"type": "image",
"source": {
"type": "base64",
"media_type": "image/png",
"data": b64_screenshot,
},
},
],
}],
)
# Process Claude's tool use response
for block in response.content:
if block.type == "tool_use":
action = block.input
if action.get("action") == "mouse_move" or action.get("action") == "left_click":
x, y = action["coordinate"]
page.mouse.click(x, y)
browser.close()
lc.computers.delete(session.id)
  • Cloud execution — No need to run browsers locally; Lightcone handles the infrastructure
  • Stealth mode — Access sites that block automation
  • Session persistence — Save login sessions for reuse
  • Scale — Run many agents in parallel on separate browser instances