cookie-sync
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.
- License 许可
- MIT
- 最近更新
- 2026-10-26
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- cookie-sync
- description
- 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.
02 资源文件 6
- 参考文档EXAMPLES.md3.5 KB
- 许可证LICENSE.txt1.0 KB
- 参考文档package-lock.json147.1 KB
- 参考文档package.json191 B
- 参考文档REFERENCE.md5.1 KB
- 脚本scripts/cookie-sync.mjs10.7 KB
03 SKILL.md 正文
Cookie Sync — Local Chrome → Browserbase Context
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-debugand setCDP_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.
Advanced stealth mode
node .claude/skills/cookie-sync/scripts/cookie-sync.mjs --stealth
Enables Browserbase's advanced stealth mode to reduce bot detection. 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 --stealth --proxy "San Francisco,CA,US"
Browsing Authenticated Sites
After syncing, use the browse CLI with the context ID:
browse open https://mail.google.com --context-id <ctx-id> --persist
The --persist flag saves any new cookies or state changes back to the context, 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
browse open https://x.com/messages --context-id ctx_abc123 --persist
browse snapshot
browse screenshot
browse stop
Reusing Contexts for Scheduled Jobs
Contexts persist across sessions, making them ideal for scheduled/recurring tasks:
- Once (laptop open): Run cookie-sync → get a context ID
- Scheduled jobs: Use
browse open <url> --context-id <ctx-id> --persist— no local Chrome needed - 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-debuggingif your browser build exposes it, or launch with--remote-debugging-port=9222and setCDP_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
--stealthand/or--proxywith a location near you
04 同仓库更多 Skills
youtube-clipper
YouTube 视频智能剪辑工具。下载视频和字幕,AI 分析生成精细章节(几分钟级别), 用户选择片段后自动剪辑、翻译字幕为中英双语、烧录字幕到视频,并生成总结文案。 使用场景:当用户需要剪辑 YouTube 视频、生成短视频片段、制作双语字幕版本时。 关键词:视频剪辑、YouTube、字幕翻译、双语字幕、视频下载、clip video
yao-meta-skill
Create, refactor, evaluate, and package agent skills from workflows, prompts, transcripts, docs, or notes. Use when asked to create a skill, turn a repeated process into a reusable skill, improve an existing skill, add evals, or package a skill for team reuse.
webapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
vercel-react-best-practices
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.
ui-test
AI-powered adversarial UI testing via the browse CLI. Analyzes git diffs to test only what changed, or explores the full app to find bugs. Tests functional correctness, accessibility, responsive layout, and UX heuristics. Use when the user asks to test UI changes, QA a pull request, audit accessibility, or run exploratory testing. Supports local browser (localhost) and remote Browserbase (deployed sites).
technical-seo-checker
Use when the user asks to "technical SEO audit", "check page speed", "crawl issues", "Core Web Vitals", "site indexing problems", "my site is slow", "Google cannot crawl my site", "mobile issues", or "indexing problems". Performs technical SEO audits covering site speed, crawlability, indexability, mobile-friendliness, security, and structured data. Identifies technical issues preventing optimal search performance. For content and heading element issues, see on-page-seo-auditor. For link architecture, see internal-linking-optimizer.