cookie-sync

作成者: browserbase

ローカルのChromeからBrowserbaseの永続コンテキストにクッキーを同期し、browse CLIが認証済みサイトにアクセスできるようにします。ユーザーがブラウズしたい場合に使用します…

npx skills add https://github.com/browserbase/skills --skill cookie-sync

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-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

browserbaseのその他のスキル

optimize-agent-prompt
browserbase
Browserbase Agent APIデモを構築・改善し、Autobrowseスタイルの外部ループを通じて、固定タスクの実行、Agentメッセージとセッションログの収集、結果のスコアリング、システムプロンプトのヒューリスティックを1つ改訂し、収束を確認します。Browserbase AgentsデモやPOCの作成、Agentシステムプロンプトの最適化、不安定なAgent実行の診断、またはBrowserbase Agents APIへの自動リサーチ/オートブラウズの適用時に使用します。
add-webmcp
browserbase
既存のWebアプリケーションを分析し、ルート、フォーム、サーバーアクション、ハンドラー、スキーマ全体で安全なユーザー可視機能を特定し、ファーストパーティのWebMCPツールを実装して、Stagehandでディスカバリと呼び出しを検証します。ユーザーがコードベースをエージェント対応にしたい、Webサイトの機能をWebMCPツールとして公開したい、またはURLからスタンドアロンの注入スクリプトを生成するのではなく、アプリに直接WebMCPを追加したいと依頼した場合に使用します。
browse
browserbase
browse CLIを使用して、Browserbaseのブラウザ自動化、BrowserbaseクラウドAPI、Browserbase Functions、テンプレート、Webフェッチ/検索、診断、Browse.shなどを利用します…
browse
browserbase
browse CLIを使用して、Browserbaseのブラウザ自動化、BrowserbaseクラウドAPI、Browserbase Functions、テンプレート、Webフェッチ/検索、診断、Browse.sh…を実行します。
browser-automation
browserbase
MCPツールを使用してウェブブラウザの操作を自動化します。ユーザーがウェブサイトの閲覧、ウェブページのナビゲーション、ウェブサイトからのデータ抽出、スクリーンショットの取得などを求めた場合に使用します。
functions
browserbase
公式のBrowserbase Functions CLIを使用したサーバーレスブラウザ自動化のデプロイを案内します。ユーザーが自動化をデプロイして実行したい場合に使用します…
agent-experience
browserbase
製品、SDK、ドキュメントサイト、またはSKILL.mdの開発者体験を監査するために、複数のClaudeサブエージェントを、小さなタスクプロンプトと実際の…だけを与えて投入します。
autobrowse
browserbase
自己改善型ブラウザ自動化を自動リサーチループで実現。ブラウジングタスクを反復実行し、トレースを読み取り、ナビゲーションスキルを向上させます…