Skills
Chapter 9 of 16
Sync cookies from local Chrome to a Browserbase persistent context so the browse CLI can access authenticated sites.
2 minutes · 368 words · 13 sections
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).
16 chapters · 94 min
chrome://flags/#allow-remote-debugging, enable it and restart the browser--remote-debugging-port=9222 --user-data-dir=/tmp/chrome-debug and set CDP_URL=ws://127.0.0.1:9222BROWSERBASE_API_KEYInstall dependencies before first use:
cd .claude/skills/cookie-sync && npm installnode .claude/skills/cookie-sync/scripts/cookie-sync.mjsCreates a persistent context with all your Chrome cookies. Outputs a context ID.
node .claude/skills/cookie-sync/scripts/cookie-sync.mjs --domains google.com,github.comMatches the domain and all subdomains (e.g. google.com matches accounts.google.com, mail.google.com, etc.)
node .claude/skills/cookie-sync/scripts/cookie-sync.mjs --context ctx_abc123Re-injects fresh cookies into a previously created context. Use this when cookies have expired.
node .claude/skills/cookie-sync/scripts/cookie-sync.mjs --verifiedEnables Browserbase Identity with a Verified browser to improve access on protected sites. Recommended for sites like Google that fingerprint browsers.
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.
node .claude/skills/cookie-sync/scripts/cookie-sync.mjs --domains github.com,google.com --verified --proxy "San Francisco,CA,US"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_RELEASEContexts persist across sessions, making them ideal for scheduled/recurring tasks:
browse cloud sessions create --context-id <ctx-id> --persist --keep-alive, then attach with browse open <url> --cdp <connectUrl> — no local Chrome needed--context <ctx-id> to refreshchrome://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--context <id> to refresh--verified and/or --proxy with a location near youInstall this repository
npx skills add browserbase/skills/plugin marketplace add browserbase/skillsSkills install per repository, not per chapter — the CLI has no documented per-skill form, so we do not print one.
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 verbatim description from this skill’s front matter — the string an agent matches on to decide whether to load it.
Bashskills/cookie-sync/SKILL.mdmain, last pushed 5 August 2026.SKILL.md, not by matching a directory convention. One layout observed: skills/*/SKILL.md.h1 and no skipped levels:.claude-plugin/marketplace.json by Browserbase, declaring 5 plugins. It is read for editorial metadata only — never as the skill index, which is always the repository tree./browserbase/skills.md, and each chapter at its own .md URL.6 files · 168 KB
Everything this skill ships beside its prose. All of it is set here, as subchapters of chapter 9.
Executable code the skill can run.
Everything else published alongside the skill.