Generated banner for Cookie Sync
Generated logo for Cookie Sync

Cookie Sync

BrowserbaseOfficialPublished by Browserbase

  • Skill
  • Tool integration
  • Automation and integrations
  • MIT
  • Low risk
  • Has scripts

From the author

Sync cookies from local Chrome to a Browserbase persistent context so the browse CLI can access authenticated sites. Use when the user wants to browse as themselves, sync cookies, or log into sites via Browserbase.
— the description by Browserbase

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

Cookie Sync enables users to export authentication cookies from a local Chromium-based browser into a Browserbase persistent context. This allows developers to perform automated browsing tasks in the cloud while maintaining the authenticated state of their local browser sessions. It supports domain-specific filtering, context refreshing, and integration with Browserbase features like verified browser mode and residential proxies to help manage site access.

What it does

  • Exports cookies from a local Chrome or Chromium instance to a Browserbase persistent context
  • Allows filtering of synced cookies by specific domains and subdomains
  • Refreshes cookies within an existing Browserbase context to extend session validity
  • Supports integration with Browserbase Identity and residential proxies for improved site access
  • Facilitates authenticated browsing sessions in the cloud using the browse CLI

When to use it

  • When you need to access authenticated websites via Browserbase using your local credentials
  • When you want to maintain persistent sessions for scheduled or recurring cloud-based tasks
  • When you need to bypass site-specific restrictions by matching your local IP geolocation
  • When you need to refresh expired cookies in an existing cloud context

Advantages

  • Enables seamless transition from local browser authentication to cloud-based automation
  • Supports persistent contexts that survive across multiple sessions
  • Provides granular control over which cookies are synced to the cloud
  • Helps mitigate authentication rejection through proxy and verified browser options

Usage examples

“Sync my GitHub cookies to a new Browserbase context.”
The tool extracts GitHub-related cookies from the local browser and returns a new context ID for use with the browse CLI.
“Refresh the cookies in my existing context ctx_abc123.”
The tool re-injects current local cookies into the specified context, updating it for continued use.
“Sync cookies for twitter.com using a San Francisco residential proxy.”
The tool syncs the specified cookies and configures the context to route traffic through a San Francisco-based residential proxy.

Install

  1. Download the skill as a ZIP:

    https://mp-staging.autogineer.com/agent-skills/browserbase/cookie-sync/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip cookie-sync.zip -d .agents/skills

Documentation by Browserbase

Exports cookies from your local Chrome and saves them into a Browserbase persistent context. After syncing, use the browse CLI to open authenticated sessions with that context.

Supports domain filtering (only sync cookies you need) and context reuse (refresh cookies without creating a new context).

Prerequisites

  • Chrome (or Chromium, Brave, Edge) with remote debugging enabled

  • If your browser build exposes chrome://flags/#allow-remote-debugging, enable it and restart the browser

  • Otherwise, launch with --remote-debugging-port=9222 --user-data-dir=/tmp/chrome-debug and set CDP_URL=ws://127.0.0.1:9222

  • At least one tab open in Chrome

  • Node.js 22+

  • Environment variable: BROWSERBASE_API_KEY

Setup

Install dependencies before first use:

cd .claude/skills/cookie-sync && npm install

Usage

Basic — sync all cookies
node .claude/skills/cookie-sync/scripts/cookie-sync.mjs

Creates a persistent context with all your Chrome cookies. Outputs a context ID.

Filter by domain — only sync specific sites
node .claude/skills/cookie-sync/scripts/cookie-sync.mjs --domains google.com,github.com

Matches the domain and all subdomains (e.g. google.com matches accounts.google.com, mail.google.com, etc.)

Refresh cookies in an existing context
node .claude/skills/cookie-sync/scripts/cookie-sync.mjs --context ctx_abc123

Re-injects fresh cookies into a previously created context. Use this when cookies have expired.

Verified browser mode
node .claude/skills/cookie-sync/scripts/cookie-sync.mjs --verified

Enables Browserbase Identity with a Verified browser to improve access on protected sites. Recommended for sites like Google that fingerprint browsers.

Residential proxy with geolocation
node .claude/skills/cookie-sync/scripts/cookie-sync.mjs --proxy "San Francisco,CA,US"

Routes through a residential proxy in the specified location. Format: "City,ST,Country" (state is 2-letter code). Helps match your local IP's geolocation so auth cookies aren't rejected.

Combine flags
node .claude/skills/cookie-sync/scripts/cookie-sync.mjs --domains github.com,google.com --verified --proxy "San Francisco,CA,US"

Browsing Authenticated Sites

After syncing, use the browse CLI with the context ID:

SESSION_JSON="$(browse cloud sessions create --context-id <ctx-id> --persist --keep-alive)"
SESSION_ID="$(echo "$SESSION_JSON" | jq -r .id)"
CONNECT_URL="$(echo "$SESSION_JSON" | jq -r .connectUrl)"

browse open https://mail.google.com --cdp "$CONNECT_URL"

The --persist flag on browse cloud sessions create saves any new cookies or state changes back to the context when the cloud session is released, keeping the session fresh for next time.

Full workflow example:

# Step 1: Sync cookies for Twitter
node .claude/skills/cookie-sync/scripts/cookie-sync.mjs --domains x.com,twitter.com
# Output: Context ID: ctx_abc123

# Step 2: Browse authenticated Twitter
SESSION_JSON="$(browse cloud sessions create --context-id ctx_abc123 --persist --keep-alive)"
SESSION_ID="$(echo "$SESSION_JSON" | jq -r .id)"
CONNECT_URL="$(echo "$SESSION_JSON" | jq -r .connectUrl)"

browse open https://x.com/messages --cdp "$CONNECT_URL"
browse snapshot
browse screenshot
browse stop
browse cloud sessions update "$SESSION_ID" --status REQUEST_RELEASE

Reusing Contexts for Scheduled Jobs

Contexts persist across sessions, making them ideal for scheduled/recurring tasks:

  1. Once (laptop open): Run cookie-sync → get a context ID

  2. Scheduled jobs: Create a Browserbase session with browse cloud sessions create --context-id <ctx-id> --persist --keep-alive, then attach with browse open <url> --cdp <connectUrl> — no local Chrome needed

  3. Re-sync as needed: When cookies expire, run cookie-sync again with --context <ctx-id> to refresh

Troubleshooting

  • "No DevToolsActivePort found" → Enable chrome://flags/#allow-remote-debugging if your browser build exposes it, or launch with --remote-debugging-port=9222 and set CDP_URL=ws://127.0.0.1:9222

  • "No open page targets found" → Open at least one tab in Chrome

  • "WebSocket error" → Chrome may be hung; force quit and reopen it

  • Cookies expired in context → Re-run cookie-sync with --context <id> to refresh

  • Auth rejected by site → Try adding --verified and/or --proxy with a location near you

Files

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Needs: Declares allowed tools, Needs an API key, Needs Node.js

The author says: Requires Node.js 22+, a local Chromium-based browser (Chrome, Brave, Edge) with remote debugging enabled, and BROWSERBASE_API_KEY. Run `npm install` in the skill directory before first use.

Security

What our scanner noticed· Low risk

  • Scripts that your agent may run

This skill includes scripts that your agent may run. Read them before you use it.

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Published by
Browserbase
Publisher
Browserbase (Official)
Source
browserbase/skills · skills/cookie-sync · commit 6811ca3
Licence
MIT License (redistribution allowed)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by Browserbase.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download cookie-sync.zip