Back

gstack Tutorial 6B: Multi-Agent Browser (Cross-Agent Coordination)

/pair-agent shares browser between AI agents. Cross-agent coordination with scoped tokens, tab isolation, and cookie import for authenticated testing.

Tutorial Overview

Series index: gstack Tutorial Series

/pair-agent lets multiple AI agents share a browser. Each gets its own tab, isolated from others.

What you will learn

  • /pair-agent for cross-agent coordination
  • ✅ Scoped tokens and tab isolation
  • /setup-browser-cookies for authenticated testing
  • ✅ Real-world coordination patterns

Why Multi-Agent Browser?

Single agent limitation

One AI agent can only do one thing at a time. But often you need:

  • Compare two pages simultaneously
  • Test user interactions between accounts
  • Coordinate frontend and backend testing

Multi-agent solution

flowchart TD
    A[Claude Code] --> B[GStack Browser]
    C[OpenClaw] --> B
    D[Codex] --> B
    B --> E[Tab 1: Claude]
    B --> F[Tab 2: OpenClaw]
    B --> G[Tab 3: Codex]

    style B fill:#e1f5ff

/pair-agent — Cross-Agent Coordination

How it works

  1. Launch browser — GStack Browser opens
  2. Print instructions — Block to paste into other agent
  3. Exchange credentials — One-time setup key for session token
  4. Create isolated tab — Each agent gets its own tab
  5. Watch together — See both agents working

Usage

/pair-agent

Output:

GStack Browser launched. Share with another agent:

[Paste this block into your other agent's chat]

---BEGIN PAIR BLOCK---
SESSION_ID: abc-123
TOKEN: scoped_token_xyz
URL: http://localhost:9222
---END PAIR BLOCK---

The other agent will:
1. Receive the pair block
2. Connect to the browser
3. Get its own isolated tab
4. Be able to browse independently

Security features

Feature Purpose
Scoped tokens Limited permissions, revocable
Tab isolation Agents can’t access each other’s tabs
Rate limiting Prevent abuse
Activity attribution Know which agent did what
Domain restrictions Optional allowlist

Supported agents

  • Claude Code
  • OpenClaw
  • Hermes
  • Codex
  • Cursor
  • Any agent that can curl

/setup-browser-cookies — Session Manager

What it does

Imports cookies from your real browser into the AI browser session.

Supported browsers

  • Google Chrome
  • Arc
  • Brave
  • Microsoft Edge

Usage

/setup-browser-cookies

Output:

Select browser source:
[1] Chrome
[2] Arc
[3] Brave
[4] Edge

Enter selection: 1

✅ Imported 47 cookies from Chrome
- github.com: logged_in, user_session
- google.com: SID, HSID, SSID
- ...

Your AI agent can now access authenticated pages.

When to use

  • Testing authenticated features
  • Preserving login state
  • Accessing paid/protected content
  • Personal automation

Security note

Cookies are stored in memory only for the session. They are never written to disk or transmitted.

Coordination Patterns

Pattern 1: Parallel comparison

Two agents compare pages side-by-side:

Agent 1: Browse staging site, find layout issues
Agent 2: Browse production site, compare

Result: Side-by-side comparison with screenshots

Pattern 2: User interaction testing

Test interactions between accounts:

Agent 1: User A sends message
Agent 2: User B receives message

Result: Real-time interaction test

Pattern 3: Frontend + Backend

One agent tests UI, another tests API:

Agent 1: Click through frontend flows
Agent 2: Monitor API responses

Result: Full-stack validation

Example: Testing Chat Application

Setup

# Agent 1 (Claude Code)
/pair-agent

# [Copy pair block]

# Agent 2 (OpenClaw)
[Paste pair block]

Agent 1 (User A)

/setup-browser-cookies  # Import login cookies
/browse https://chat.example.com
$B type "#message" "Hello from User A"
$B click "button[type='submit']"
$B screenshot

Agent 2 (User B)

/setup-browser-cookies  # Import different account cookies
/browse https://chat.example.com
$B wait ".message"
$B text ".message:last-child"
# Output: "Hello from User A"
$B screenshot

Result

Both agents see the same chat, from different accounts, in real time.

Skill Quick Reference

Command Purpose
/pair-agent Share browser with another agent
/setup-browser-cookies Import cookies from real browser
$B handoff Transfer to visible browser
$B resume Resume after handoff

Summary

Multi-agent browser enables:

  1. Cross-agent coordination — Multiple AI agents, one browser
  2. Tab isolation — Each agent in its own tab
  3. Cookie import — Test authenticated pages
  4. Security — Scoped tokens, activity attribution

Key takeaways

  • ✅ Use /pair-agent for multi-agent testing
  • ✅ Import cookies for authenticated access
  • ✅ Each agent gets isolated tab
  • ✅ Watch agents work in real time

Series navigation: