From a8a0dbefc1628cb14c70bbdd9d37d8b4bf68073b Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 8 Jan 2026 18:26:37 +0000 Subject: [PATCH 1/7] Add Claude Agent SDK integration documentation Co-authored-by: danny --- docs.json | 1 + integrations/claude-agent-sdk.mdx | 99 +++++++++++++++++++++++++++++++ integrations/overview.mdx | 1 + 3 files changed, 101 insertions(+) create mode 100644 integrations/claude-agent-sdk.mdx diff --git a/docs.json b/docs.json index dedd1b8..625ef63 100644 --- a/docs.json +++ b/docs.json @@ -115,6 +115,7 @@ "pages": [ "integrations/overview", "integrations/browser-use", + "integrations/claude-agent-sdk", { "group": "Computer Use", "pages": [ diff --git a/integrations/claude-agent-sdk.mdx b/integrations/claude-agent-sdk.mdx new file mode 100644 index 0000000..5d1f6ea --- /dev/null +++ b/integrations/claude-agent-sdk.mdx @@ -0,0 +1,99 @@ +--- +title: "Claude Agent SDK" +--- + +The [Claude for Chrome extension](https://chromewebstore.google.com/detail/claude/hbhbdkfkmpfgjfegglflhflgjpojgnll) brings Claude's powerful AI capabilities directly into your browser. With Kernel's Claude Agent SDK integration, you can run the Claude extension in cloud-hosted browsers, enabling automated interactions with Claude without managing local browser infrastructure. + +By integrating the Claude Agent SDK with Kernel, you can programmatically send messages to Claude, receive responses, and build AI-powered automations that leverage Claude's capabilities in the browser. + +## Quick setup with Claude Agent SDK + +Get started with the Claude Agent SDK using the Kernel CLI: + +### Step 1: Extract the extension from your local Chrome + +First, extract the Claude extension and authentication data from your local Chrome installation: + +```bash +# Extract extension + auth data to a bundle file +kernel claude extract -o claude-bundle.zip + +# Extract without auth (will require login in browser) +kernel claude extract -o claude-bundle.zip --no-auth + +# Use a specific Chrome profile +kernel claude extract -o claude-bundle.zip --chrome-profile "Profile 1" +``` + +### Step 2: Launch a Kernel browser with Claude pre-loaded + +Launch a cloud browser with the Claude extension automatically loaded and authenticated: + +```bash +# Launch browser with Claude extension +kernel claude launch -b claude-bundle.zip + +# Launch with custom timeout +kernel claude launch -b claude-bundle.zip -t 7200 + +# Launch and navigate to a specific URL +kernel claude launch -b claude-bundle.zip --url https://example.com +``` + +### Step 3: Interact with Claude + +Once your browser is running, you can interact with Claude programmatically: + +```bash +# Check extension status +kernel claude status + +# Send a single message (scriptable) +kernel claude send "What is 2+2?" + +# Send from stdin +echo "Explain this error" | kernel claude send + +# Send from file +kernel claude send -f prompt.txt + +# Interactive chat TUI +kernel claude chat +``` + +### Loading into an existing browser + +You can also load the Claude extension into an existing Kernel browser session: + +```bash +# Load Claude into an existing browser session +kernel claude load -b claude-bundle.zip +``` + +## Available commands + +| Command | Description | +|---------|-------------| +| `kernel claude extract` | Extract the Claude extension and authentication data from a local Chrome installation | +| `kernel claude launch` | Launch a new Kernel browser with the extension pre-loaded and authenticated | +| `kernel claude load` | Load the extension into an existing Kernel browser | +| `kernel claude status` | Check the extension's state in a browser | +| `kernel claude send` | Send single messages programmatically (scriptable) | +| `kernel claude chat` | Interactive chat with Claude via a TUI | + +## Benefits of using Kernel with Claude Agent SDK + +- **No local browser management**: Run Claude automations without installing or maintaining browsers locally +- **Authenticated sessions**: Extract and reuse your Claude authentication across cloud browsers +- **Scriptable interactions**: Send messages and receive responses programmatically for automation workflows +- **Interactive chat**: Use the built-in TUI for interactive conversations with Claude +- **Scalability**: Launch multiple browser sessions in parallel for concurrent AI agents +- **Live view**: Debug your Claude agents with real-time browser viewing +- **Cloud infrastructure**: Run AI-powered automations without local resource constraints + +## Next steps + +- Check out [live view](/browsers/live-view) for debugging your Claude automations +- Learn about [browser extensions](/browsers/extensions) for loading custom extensions +- Learn how to properly [terminate browser sessions](/browsers/termination) +- Learn about [profiles](/browsers/profiles) to maintain browser state across runs diff --git a/integrations/overview.mdx b/integrations/overview.mdx index 398a349..7f2ca25 100644 --- a/integrations/overview.mdx +++ b/integrations/overview.mdx @@ -18,6 +18,7 @@ Kernel browsers work with any framework or tool that supports the Chrome DevTool Kernel provides detailed guides for popular agent frameworks: - **[Browser Use](/integrations/browser-use)** - AI browser agent framework +- **[Claude Agent SDK](/integrations/claude-agent-sdk)** - Run Claude for Chrome extension in cloud browsers - **[Stagehand](/integrations/stagehand)** - AI browser automation with natural language - **[Computer Use (Anthropic)](/integrations/computer-use/anthropic)** - Claude's computer use capability - **[Computer Use (OpenAI)](/integrations/computer-use/openai)** - OpenAI's computer use capability From b010df91a08daebb696ff2b03739c9c8a895eafe Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 8 Jan 2026 19:31:57 +0000 Subject: [PATCH 2/7] Refactor: Update Claude Agent SDK integration documentation Co-authored-by: danny --- integrations/claude-agent-sdk.mdx | 155 +++++++++++++++++++----------- 1 file changed, 101 insertions(+), 54 deletions(-) diff --git a/integrations/claude-agent-sdk.mdx b/integrations/claude-agent-sdk.mdx index 5d1f6ea..f178235 100644 --- a/integrations/claude-agent-sdk.mdx +++ b/integrations/claude-agent-sdk.mdx @@ -2,98 +2,145 @@ title: "Claude Agent SDK" --- -The [Claude for Chrome extension](https://chromewebstore.google.com/detail/claude/hbhbdkfkmpfgjfegglflhflgjpojgnll) brings Claude's powerful AI capabilities directly into your browser. With Kernel's Claude Agent SDK integration, you can run the Claude extension in cloud-hosted browsers, enabling automated interactions with Claude without managing local browser infrastructure. +The [Claude Agent SDK](https://platform.claude.com/docs/en/agent-sdk/overview) provides a powerful way to build AI agents that can autonomously perform tasks. By integrating the Claude Agent SDK with Kernel, you can create agents that browse the web and interact with websites using cloud-hosted browser infrastructure. -By integrating the Claude Agent SDK with Kernel, you can programmatically send messages to Claude, receive responses, and build AI-powered automations that leverage Claude's capabilities in the browser. +This integration combines Claude's agent capabilities with Kernel's Playwright Execution API to enable browser automation without managing local browser infrastructure. ## Quick setup with Claude Agent SDK -Get started with the Claude Agent SDK using the Kernel CLI: +Get started with Claude Agent SDK and Kernel using our pre-configured app template: -### Step 1: Extract the extension from your local Chrome +```bash +kernel create --name my-claude-agent-app --template claude-agent-sdk +``` -First, extract the Claude extension and authentication data from your local Chrome installation: +Choose `TypeScript` or `Python` as the programming language. -```bash -# Extract extension + auth data to a bundle file -kernel claude extract -o claude-bundle.zip +Then follow the [Quickstart guide](/quickstart/) to deploy and run your Claude Agent SDK automation on Kernel's infrastructure. + +## Prerequisites + +### Claude Code Installation -# Extract without auth (will require login in browser) -kernel claude extract -o claude-bundle.zip --no-auth +The Claude Agent SDK requires Claude Code to be installed. Follow the [official installation guide](https://platform.claude.com/docs/en/agent-sdk/overview#get-started): -# Use a specific Chrome profile -kernel claude extract -o claude-bundle.zip --chrome-profile "Profile 1" +```bash +# macOS/Linux/WSL +curl -fsSL https://claude.ai/install.sh | bash ``` -### Step 2: Launch a Kernel browser with Claude pre-loaded + +When deploying to Kernel, the app automatically installs Claude Code on the remote infrastructure. + + +### API Keys + +You'll need: +- **ANTHROPIC_API_KEY**: Get from the [Anthropic Console](https://console.anthropic.com/) +- **KERNEL_API_KEY**: Get from the [Kernel Dashboard](https://dashboard.kernel.sh/api-keys) -Launch a cloud browser with the Claude extension automatically loaded and authenticated: +## Running locally + + ```bash -# Launch browser with Claude extension -kernel claude launch -b claude-bundle.zip +# Install dependencies +pnpm install -# Launch with custom timeout -kernel claude launch -b claude-bundle.zip -t 7200 +# Set up environment variables +cp .env.example .env +# Edit .env with your API keys -# Launch and navigate to a specific URL -kernel claude launch -b claude-bundle.zip --url https://example.com +# Run with default task +pnpm exec tsx index.ts + +# Run with custom task +pnpm exec tsx index.ts "Go to duckduckgo.com and search for 'Kernel browser automation'" ``` + + +```bash +# Install dependencies +uv sync -### Step 3: Interact with Claude +# Set up environment variables +cp .env.example .env +# Edit .env with your API keys -Once your browser is running, you can interact with Claude programmatically: +# Run with default task +uv run main.py +# Run with custom task +uv run main.py "Go to duckduckgo.com and search for 'Kernel browser automation'" +``` + + + +## Deploying to Kernel + +Deploy and invoke the app on Kernel's infrastructure: + + + ```bash -# Check extension status -kernel claude status +# Login to Kernel +kernel login -# Send a single message (scriptable) -kernel claude send "What is 2+2?" +# Deploy the app with environment variables +kernel deploy index.ts --env-file .env -# Send from stdin -echo "Explain this error" | kernel claude send +# Invoke the action (logs stream automatically) +kernel invoke ts-claude-agent-sdk agent-task -p '{"task": "Go to https://news.ycombinator.com and get the top 3 stories"}' +``` + + +```bash +# Login to Kernel +kernel login -# Send from file -kernel claude send -f prompt.txt +# Deploy the app with environment variables +kernel deploy main.py --env-file .env -# Interactive chat TUI -kernel claude chat +# Invoke the action (logs stream automatically) +kernel invoke py-claude-agent-sdk agent-task -p '{"task": "Go to https://news.ycombinator.com and get the top 3 stories"}' ``` + + + +## How it works -### Loading into an existing browser +1. **Browser Creation**: A Kernel browser session is created with stealth mode enabled +2. **MCP Server**: An in-process MCP server is created with an `execute_playwright` tool +3. **Agent Execution**: The Claude Agent SDK runs with access to the Playwright tool +4. **Task Completion**: Claude autonomously uses the tool to complete the given task +5. **Cleanup**: The browser session is deleted when done -You can also load the Claude extension into an existing Kernel browser session: +## Example tasks ```bash -# Load Claude into an existing browser session -kernel claude load -b claude-bundle.zip -``` +# Get top Hacker News stories +"Go to https://news.ycombinator.com and tell me the top 3 stories" -## Available commands +# Search for something +"Go to duckduckgo.com and search for 'Kernel browser automation'" -| Command | Description | -|---------|-------------| -| `kernel claude extract` | Extract the Claude extension and authentication data from a local Chrome installation | -| `kernel claude launch` | Launch a new Kernel browser with the extension pre-loaded and authenticated | -| `kernel claude load` | Load the extension into an existing Kernel browser | -| `kernel claude status` | Check the extension's state in a browser | -| `kernel claude send` | Send single messages programmatically (scriptable) | -| `kernel claude chat` | Interactive chat with Claude via a TUI | +# Extract data from a page +"Go to https://github.com/trending and list the top 5 trending repositories" +``` ## Benefits of using Kernel with Claude Agent SDK -- **No local browser management**: Run Claude automations without installing or maintaining browsers locally -- **Authenticated sessions**: Extract and reuse your Claude authentication across cloud browsers -- **Scriptable interactions**: Send messages and receive responses programmatically for automation workflows -- **Interactive chat**: Use the built-in TUI for interactive conversations with Claude +- **No local browser management**: Run Claude Agent SDK automations without installing or maintaining browsers locally - **Scalability**: Launch multiple browser sessions in parallel for concurrent AI agents +- **Stealth mode**: Built-in anti-detection features for reliable web interactions +- **Session state**: Maintain browser state across runs via [Profiles](/browsers/profiles) - **Live view**: Debug your Claude agents with real-time browser viewing -- **Cloud infrastructure**: Run AI-powered automations without local resource constraints +- **Cloud infrastructure**: Run computationally intensive AI agents without local resource constraints ## Next steps -- Check out [live view](/browsers/live-view) for debugging your Claude automations -- Learn about [browser extensions](/browsers/extensions) for loading custom extensions +- Check out [live view](/browsers/live-view) for debugging your Claude Agent SDK automations +- Learn about [stealth mode](/browsers/bot-detection/stealth) for avoiding detection +- Learn about [Playwright Execution](/browsers/playwright-execution) for running Playwright code in the browser VM - Learn how to properly [terminate browser sessions](/browsers/termination) -- Learn about [profiles](/browsers/profiles) to maintain browser state across runs +- Learn how to [deploy](/apps/deploy) your Claude Agent SDK app to Kernel From b12dac84cc36a42318f95f55a6daa5f48f7a24cc Mon Sep 17 00:00:00 2001 From: Daniel Prevoznik Date: Thu, 8 Jan 2026 14:38:45 -0800 Subject: [PATCH 3/7] Update api keys links in dashboard --- browsers/bot-detection/overview.mdx | 2 +- integrations/claude-agent-sdk.mdx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/browsers/bot-detection/overview.mdx b/browsers/bot-detection/overview.mdx index 20010c1..a12daa2 100644 --- a/browsers/bot-detection/overview.mdx +++ b/browsers/bot-detection/overview.mdx @@ -45,7 +45,7 @@ Emulates native keyboard and mouse input directly at the OS level. Before you start automating your workflow, we recommend that you manually test your website to understand how it behaves with Kernel's browsers. Here's how to do that: -1. **Launch a browser from the [Kernel dashboard](https://www.dashboard.onkernel.com/browsers).** This opens a Kernel browser instance in a clean virtual machine. +1. **Launch a browser from the [Kernel dashboard](https://dashboard.onkernel.com/browsers).** This opens a Kernel browser instance in a clean virtual machine. 2. **Navigate to the target website** and perform the same actions you plan to automate — logging in, filling forms, loading dashboards, etc. 3. **Observe potential friction points:** - Are you immediately prompted for CAPTCHA or MFA? diff --git a/integrations/claude-agent-sdk.mdx b/integrations/claude-agent-sdk.mdx index f178235..556d97e 100644 --- a/integrations/claude-agent-sdk.mdx +++ b/integrations/claude-agent-sdk.mdx @@ -37,7 +37,7 @@ When deploying to Kernel, the app automatically installs Claude Code on the remo You'll need: - **ANTHROPIC_API_KEY**: Get from the [Anthropic Console](https://console.anthropic.com/) -- **KERNEL_API_KEY**: Get from the [Kernel Dashboard](https://dashboard.kernel.sh/api-keys) +- **KERNEL_API_KEY**: Get from the [Kernel Dashboard](https://dashboard.onkernel.com/api-keys) ## Running locally From a78fe866f40ac337247d5875cfa223f64842bd3e Mon Sep 17 00:00:00 2001 From: Daniel Prevoznik Date: Thu, 8 Jan 2026 14:46:16 -0800 Subject: [PATCH 4/7] Use code groups instead of tabs for code snippets. --- integrations/claude-agent-sdk.mdx | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/integrations/claude-agent-sdk.mdx b/integrations/claude-agent-sdk.mdx index 556d97e..9c4e703 100644 --- a/integrations/claude-agent-sdk.mdx +++ b/integrations/claude-agent-sdk.mdx @@ -41,9 +41,8 @@ You'll need: ## Running locally - - -```bash + +```bash TypeScript # Install dependencies pnpm install @@ -57,9 +56,8 @@ pnpm exec tsx index.ts # Run with custom task pnpm exec tsx index.ts "Go to duckduckgo.com and search for 'Kernel browser automation'" ``` - - -```bash + +```bash Python # Install dependencies uv sync @@ -73,16 +71,14 @@ uv run main.py # Run with custom task uv run main.py "Go to duckduckgo.com and search for 'Kernel browser automation'" ``` - - + ## Deploying to Kernel Deploy and invoke the app on Kernel's infrastructure: - - -```bash + +```bash TypeScript # Login to Kernel kernel login @@ -92,9 +88,8 @@ kernel deploy index.ts --env-file .env # Invoke the action (logs stream automatically) kernel invoke ts-claude-agent-sdk agent-task -p '{"task": "Go to https://news.ycombinator.com and get the top 3 stories"}' ``` - - -```bash + +```bash Python # Login to Kernel kernel login @@ -104,8 +99,7 @@ kernel deploy main.py --env-file .env # Invoke the action (logs stream automatically) kernel invoke py-claude-agent-sdk agent-task -p '{"task": "Go to https://news.ycombinator.com and get the top 3 stories"}' ``` - - + ## How it works From 9bdb84df472794dcde3112b796e21c0a7cfaeb67 Mon Sep 17 00:00:00 2001 From: Daniel Prevoznik Date: Thu, 8 Jan 2026 15:18:22 -0800 Subject: [PATCH 5/7] Update integrations/overview.mdx Co-authored-by: tembo[bot] <208362400+tembo[bot]@users.noreply.github.com> --- integrations/overview.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integrations/overview.mdx b/integrations/overview.mdx index 7f2ca25..281ca5e 100644 --- a/integrations/overview.mdx +++ b/integrations/overview.mdx @@ -18,7 +18,7 @@ Kernel browsers work with any framework or tool that supports the Chrome DevTool Kernel provides detailed guides for popular agent frameworks: - **[Browser Use](/integrations/browser-use)** - AI browser agent framework -- **[Claude Agent SDK](/integrations/claude-agent-sdk)** - Run Claude for Chrome extension in cloud browsers +- **[Claude Agent SDK](/integrations/claude-agent-sdk)** - Run Claude Agent SDK automations in cloud browsers - **[Stagehand](/integrations/stagehand)** - AI browser automation with natural language - **[Computer Use (Anthropic)](/integrations/computer-use/anthropic)** - Claude's computer use capability - **[Computer Use (OpenAI)](/integrations/computer-use/openai)** - OpenAI's computer use capability From 8d9e50ddfb7e3ef8709a9e2db22baaee90a04c5a Mon Sep 17 00:00:00 2001 From: "tembo[bot]" <208362400+tembo[bot]@users.noreply.github.com> Date: Thu, 8 Jan 2026 15:24:25 -0800 Subject: [PATCH 6/7] docs: remove explicit app name from claude-agent-sdk template command (#160) Co-authored-by: tembo[bot] <208362400+tembo[bot]@users.noreply.github.com> --- integrations/claude-agent-sdk.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integrations/claude-agent-sdk.mdx b/integrations/claude-agent-sdk.mdx index 9c4e703..6ca3c54 100644 --- a/integrations/claude-agent-sdk.mdx +++ b/integrations/claude-agent-sdk.mdx @@ -11,7 +11,7 @@ This integration combines Claude's agent capabilities with Kernel's Playwright E Get started with Claude Agent SDK and Kernel using our pre-configured app template: ```bash -kernel create --name my-claude-agent-app --template claude-agent-sdk +kernel create --template claude-agent-sdk ``` Choose `TypeScript` or `Python` as the programming language. From c8a3906e7a95f6fbee309c99c47cdbb4e25aa5fc Mon Sep 17 00:00:00 2001 From: Daniel Prevoznik Date: Thu, 8 Jan 2026 17:46:31 -0800 Subject: [PATCH 7/7] Update Claude Code Installation instructions match instructions in claude code docs + pnpm instead of npm --- integrations/claude-agent-sdk.mdx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/integrations/claude-agent-sdk.mdx b/integrations/claude-agent-sdk.mdx index 9c4e703..a21f8d5 100644 --- a/integrations/claude-agent-sdk.mdx +++ b/integrations/claude-agent-sdk.mdx @@ -22,13 +22,21 @@ Then follow the [Quickstart guide](/quickstart/) to deploy and run your Claude A ### Claude Code Installation -The Claude Agent SDK requires Claude Code to be installed. Follow the [official installation guide](https://platform.claude.com/docs/en/agent-sdk/overview#get-started): +The Claude Agent SDK requires Claude Code to be installed. Choose one of the following methods: ```bash +# Homebrew (macOS) +brew install --cask claude-code + +# pnpm (cross-platform) +pnpm add -g @anthropic-ai/claude-code + # macOS/Linux/WSL curl -fsSL https://claude.ai/install.sh | bash ``` +See the [official installation guide](https://platform.claude.com/docs/en/agent-sdk/overview#get-started) for Windows and other options. + When deploying to Kernel, the app automatically installs Claude Code on the remote infrastructure.