Official agent skill

Cloudflare Browser Rendering

by cloudflare in cloudflare/moltworker

Drives headless Chrome through Cloudflare Browser Rendering over a CDP WebSocket to take screenshots, navigate and scrape pages, and record multi-page videos.

OfficialApache-2.0Auto-check passedProductivity & Automation

Install Cloudflare Browser Rendering

skills CLI
$ npx skills add cloudflare/moltworker --skill cloudflare-browser -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install cloudflare/moltworker cloudflare-browser --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/cloudflare/moltworker.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/cloudflare-browser .claude/skills/cloudflare-browser && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
cloudflare-browser
GitHub stars
9.9k
Token cost
~742 tokens
SKILL.md length
144 words
Files
4 (incl. scripts)
Skills in repo
1
Repo updated
First seen
Licence
Apache-2.0

At a glance

Drives headless Chrome through Cloudflare Browser Rendering over a CDP WebSocket to take screenshots, navigate and scrape pages, and record multi-page videos.

  • Works in 2 steps: Capture frames as PNGs during navigation → Use ffmpeg to stitch: ffmpeg -framerate…
  • Taking screenshots of pages from a Cloudflare Workers environment
  • SKILL.md covers Prerequisites, Quick Start, CDP Connection Pattern and Key CDP Commands, plus 3 more sections
  • Runs JavaScript scripts from its folder; calls node and ffmpeg; needs CDP_SECRET

What it does

The skill connects to a Cloudflare Worker endpoint that exposes the Chrome DevTools Protocol over a WebSocket. It needs the `CDP_SECRET` environment variable and a browser profile in the agent config whose `cdpUrl` points at the worker. Two bundled Node scripts cover common jobs: `scripts/screenshot.js` takes a URL and an output file, and `scripts/video.js` takes a comma-separated list of URLs and produces an MP4, with `scripts/cdp-client.js` as the shared client.

The worker creates a page target on connect, so a client waits for the `Target.targetCreated` event to learn the target ID. The key commands are `Page.navigate`, `Page.captureScreenshot`, `Runtime.evaluate` for running JavaScript such as scrolling, and `Emulation.setDeviceMetricsOverride` for the viewport. Videos are made by capturing PNG frames during navigation and stitching them with ffmpeg. Troubleshooting notes cover a missing target, which is a race to handle with a timeout, commands that time out during cold starts, and WebSocket hangs caused by a mismatched secret.

When your agent uses it

  • Taking screenshots of pages from a Cloudflare Workers environment
  • Recording a short video that walks through several sites
  • Scraping a rendered page where plain HTTP fetches are not enough

Example prompts

  • “Take a screenshot of https://example.com and save it as home.png.”
  • “Make an MP4 that scrolls through these two sites.”
  • “Navigate to the pricing page, set a 1280 by 720 viewport and capture a PNG.”
  • “The CDP connection hangs, so check whether the secret matches the worker.”

Requirements

  • A `CDP_SECRET` environment variable
  • A Cloudflare Browser Rendering worker endpoint set as `cdpUrl` in the browser profile
  • ffmpeg, for video capture

Workflow steps

2 steps, taken from the first numbered list in SKILL.md.

  1. Capture frames as PNGs during navigation
  2. Use ffmpeg to stitch: ffmpeg -framerate 10 -i frame_%04d.png -c:v libx264 -pix_fmt yuv420p output.mp4

What it can do on your machine

Read from SKILL.md and the folder at commit 7b00c1d. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 3 files in scripts/ (JavaScript), which the agent can run.

    Shell commands in SKILL.md call:

    • node
    • ffmpeg

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • CDP_SECRET

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Cloudflare Browser Rendering loads about 742 tokens when it runs. Until then it costs about 75 tokens; SKILL.md has 144 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~75
When it runs · the whole SKILL.md, loaded when a task matches
~742

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from cloudflare/moltworker at commit 7b00c1d, republished under its Apache-2.0 licence (© cloudflare). 144 words, ~742 tokens.

Download SKILL.mdSave it as .claude/skills/cloudflare-browser/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
cloudflare-browser
description
Control headless Chrome via Cloudflare Browser Rendering CDP WebSocket. Use for screenshots, page navigation, scraping, and video capture when browser automation is needed in a Cloudflare Workers environment. Requires CDP_SECRET env var and cdpUrl configured in browser.profiles.

Cloudflare Browser Rendering

Control headless browsers via Cloudflare's Browser Rendering service using CDP (Chrome DevTools Protocol) over WebSocket.

Prerequisites

  • CDP_SECRET environment variable set
  • Browser profile configured in openclaw.json with cdpUrl pointing to the worker endpoint:
    json
    "browser": {
      "profiles": {
        "cloudflare": {
          "cdpUrl": "https://your-worker.workers.dev/cdp?secret=..."
        }
      }
    }

Quick Start

Screenshot
bash
node /path/to/skills/cloudflare-browser/scripts/screenshot.js https://example.com output.png
Multi-page Video
bash
node /path/to/skills/cloudflare-browser/scripts/video.js "https://site1.com,https://site2.com" output.mp4

CDP Connection Pattern

The worker creates a page target automatically on WebSocket connect. Listen for Target.targetCreated event to get the targetId:

javascript
const WebSocket = require('ws');
const CDP_SECRET = process.env.CDP_SECRET;
const WS_URL = `wss://your-worker.workers.dev/cdp?secret=${encodeURIComponent(CDP_SECRET)}`;

const ws = new WebSocket(WS_URL);
let targetId = null;

ws.on('message', (data) => {
  const msg = JSON.parse(data.toString());
  if (msg.method === 'Target.targetCreated' && msg.params?.targetInfo?.type === 'page') {
    targetId = msg.params.targetInfo.targetId;
  }
});

Key CDP Commands

CommandPurpose
Page.navigateNavigate to URL
Page.captureScreenshotCapture PNG/JPEG
Runtime.evaluateExecute JavaScript
Emulation.setDeviceMetricsOverrideSet viewport size

Common Patterns

Navigate and Screenshot
javascript
await send('Page.navigate', { url: 'https://example.com' });
await new Promise(r => setTimeout(r, 3000)); // Wait for render
const { data } = await send('Page.captureScreenshot', { format: 'png' });
fs.writeFileSync('out.png', Buffer.from(data, 'base64'));
Scroll Page
javascript
await send('Runtime.evaluate', { expression: 'window.scrollBy(0, 300)' });
Set Viewport
javascript
await send('Emulation.setDeviceMetricsOverride', {
  width: 1280,
  height: 720,
  deviceScaleFactor: 1,
  mobile: false
});

Creating Videos

  1. Capture frames as PNGs during navigation
  2. Use ffmpeg to stitch: ffmpeg -framerate 10 -i frame_%04d.png -c:v libx264 -pix_fmt yuv420p output.mp4

Troubleshooting

  • No target created: Race condition - wait for Target.targetCreated event with timeout
  • Commands timeout: Worker may have cold start delay; increase timeout to 30-60s
  • WebSocket hangs: Verify CDP_SECRET matches worker configuration

© cloudflare, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 3 other files (scripts) in skills/cloudflare-browser of cloudflare/moltworker.

  • SKILL.md
  • scripts/cdp-client.js
  • scripts/screenshot.js
  • scripts/video.js

Open the folder on GitHubat commit 7b00c1d

Compare with similar skills

Cloudflare Browser Rendering next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Cloudflare Browser Rendering compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Cloudflare Browser Rendering this skillcloudflare/moltworker9.9k—~742Automated safety check: PassApache-2.0
Agent Browseroxylabs/agent-skills875—~3kAutomated safety check: PassMIT
Agents SDKhodgef/apiker1273 repos~3kAutomated safety check: PassMIT
Cloudflare Browser Renderingeinverne/dotfiles121—~4.9kAutomated safety check: PassGPL-3.0
Cloudflare Browser Renderingsecondsky/claude-skills227—~4kAutomated safety check: PassMIT
Cdp Connectadobe/skills195—~847Automated safety check: PassApache-2.0

Similar skills

  • Agent Browser

    oxylabs/agent-skills

    Connects to Oxylabs remote agent browsers over the Chrome DevTools Protocol (CDP) with Playwright or Puppeteer.

    875 GitHub stars~3k tokensUpdated 7 days ago
    Productivity & AutomationAuto-check passed
  • Agents SDK

    hodgef/apiker

    Build AI agents on Cloudflare Workers using the Agents SDK. An agent skill from hodgef/apiker.

    127 GitHub starsUsed in 3 repos~3k tokens
    Backend & APIsAuto-check passed
  • Guide for implementing Cloudflare Browser Rendering - a headless browser automation API for screenshots, PDFs, web scraping, and testing.

    121 GitHub stars~4.9k tokensUpdated 28 days ago
    Productivity & AutomationAuto-check passed
  • Cloudflare Browser Rendering

    secondsky/claude-skills

    Cloudflare Browser Rendering with Puppeteer/Playwright. An agent skill from secondsky/claude-skills.

    227 GitHub stars~4k tokensUpdated 9 days ago
    Testing & QAAuto-check passed
  • Cdp Connect

    adobe/skills

    Connect Claude Code to an existing Chrome browser via CDP (Chrome DevTools Protocol).

    195 GitHub stars~847 tokensUpdated today
    Productivity & AutomationAuto-check passed
  • Test Fumadocs Wrangler

    clabernetes/clabernetes

    Builds and validates the Fumadocs React Router static site through Wrangler with headless browser checks.

    143 GitHub stars~569 tokensUpdated 2 days ago
    Productivity & AutomationAuto-check passed

Questions about Cloudflare Browser Rendering

What does Cloudflare Browser Rendering do?

Drives headless Chrome through Cloudflare Browser Rendering over a CDP WebSocket to take screenshots, navigate and scrape pages, and record multi-page videos. The skill connects to a Cloudflare Worker endpoint that exposes the Chrome DevTools Protocol over a WebSocket. It needs the `CDP_SECRET` environment variable and a browser profile in the agent config whose `cdpUrl` points at the worker.

When should I use Cloudflare Browser Rendering?

Cloudflare Browser Rendering fits situations like: taking screenshots of pages from a Cloudflare Workers environment; recording a short video that walks through several sites; scraping a rendered page where plain HTTP fetches are not enough.

How do I install Cloudflare Browser Rendering in Claude Code?

Run `npx skills add cloudflare/moltworker --skill cloudflare-browser -a claude-code`. Or copy the skill folder (skills/cloudflare-browser in cloudflare/moltworker) into .claude/skills/cloudflare-browser in your project. Claude Code loads it when a task matches its description.

How do I install Cloudflare Browser Rendering in Codex?

Run `npx skills add cloudflare/moltworker --skill cloudflare-browser -a codex`. Or copy the skill folder (skills/cloudflare-browser in cloudflare/moltworker) into .agents/skills/cloudflare-browser in your project. Codex loads it when a task matches its description.

Can I use Cloudflare Browser Rendering in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add cloudflare/moltworker --skill cloudflare-browser -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/cloudflare-browser, .gemini/skills/cloudflare-browser, .github/skills/cloudflare-browser and .opencode/skills/cloudflare-browser in your project.

What does Cloudflare Browser Rendering need to run?

Going by SKILL.md and its folder, Cloudflare Browser Rendering needs JavaScript for the scripts in its folder, the command-line tools its instructions call (node and ffmpeg) and credentials named CDP_SECRET. Our summary lists: A `CDP_SECRET` environment variable; A Cloudflare Browser Rendering worker endpoint set as `cdpUrl` in the browser profile; ffmpeg, for video capture.

Does Cloudflare Browser Rendering access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Cloudflare Browser Rendering safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Cloudflare Browser Rendering use?

Cloudflare Browser Rendering is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Cloudflare Browser Rendering use?

About 742 tokens (SKILL.md is roughly 3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Cloudflare Browser Rendering?

Skills that share tags, products or a category with Cloudflare Browser Rendering: Agent Browser (oxylabs/agent-skills, 875 stars), Agents SDK (hodgef/apiker, 127 stars), Cloudflare Browser Rendering (einverne/dotfiles, 121 stars) and Cloudflare Browser Rendering (secondsky/claude-skills, 227 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Cloudflare Browser Rendering?

cloudflare (a GitHub organization, an official publisher) maintains it in cloudflare/moltworker, which has 9,950 GitHub stars. The repository was last updated on May 9, 2026.

Source: cloudflare/moltworker on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.