Context Efficiency
Snapshots are up to 99% smaller than raw HTML, saving thousands of tokens per interaction.

In early April 2026, the Council migrated browser automation from Playwright to Agent Browser. The goal was not to replace one fashionable tool with another. The goal was to stop handing agents 50,000 tokens of raw HTML when what they actually needed was “click the blue button and tell me if the page is broken.”
Traditional automation tools expose the full DOM. On a page like LinkedIn, that can easily exceed 50,000 tokens of markup, wrappers, accessibility labels, hydration leftovers, and other debris generated by modern frontends that have never once been told “no.” Agent Browser replaces that with a snapshot-based reference system, reducing the same interaction surface to a short list of actionable elements.
Context Efficiency
Snapshots are up to 99% smaller than raw HTML, saving thousands of tokens per interaction.
Reference IDs
Elements are assigned short IDs (like @e1, @e2), making interaction simple: agent-browser click @e1.
Native Iframes
Iframe content is automatically inlined into the main tree, eliminating the need for complex frame switching.
Session Persistence
Supports named sessions and encrypted auth states, allowing agents to stay logged into LinkedIn or other services.
The result is not just cheaper automation. It is cleaner reasoning. The agent sees what matters, acts on stable references, and spends less time spiritually trapped inside someone else’s component tree.
Every browser task in Sanctum now follows this pattern:
agent-browser open <url>agent-browser snapshot -i to get stable refs like @e1, @e2That last step matters. Browser automation fails most often when a system assumes the previous action probably worked. “Probably” is not a testing strategy. It is an alibi.
The migration affected several parts of Sanctum that were previously paying far too much tax to the DOM gods:
agent-browser with cookie-based session state to monitor selector stability and extract profile names.The Holocron case is especially useful because it mirrors the actual debugging workflow. When the native app looked fine architecturally but rendered a black pane in practice, agent-browser was the tool that verified the visible UI state instead of politely trusting the theory. See Holocron App for the resulting renderer hardening and packaged app workflow.
This is the least glamorous use of browser automation in the haus, which is probably why it matters.
Claude Code is configured to talk to the Sanctum Proxy at http://127.0.0.1:4040. The proxy, in turn, authenticates Anthropic requests using the anthropic-api-key secret in macOS Keychain. When that token expires, Claude Code does not fail with a noble error message explaining the exact repair path. It throws invalid x-api-key and waits for someone else to grow up.
That someone is now a split-brain repair path: the default browser for the real login, and agent-browser for the hermetic test harness.
The startup wrapper on ~/.local/bin/claude runs a preflight script before launching the real Claude binary:
tools/claude_session_preflight.shtools/refresh_claude_team_token.shIf the Claude Team token is invalid, the refresh script:
claude setup-tokenCLAUDE_TEAM_BROWSER_MODE=agent-browser, uses the named session claude-team-oauth to exercise the browser side automatically~/.openclaw/agents/main/agent/auth-profiles.jsonanthropic-api-keycom.sanctum.proxyThe important design choice is that agent-browser is not trying to become an identity provider. It is there to prove the browser half of the flow works when we need deterministic validation, not to pick a fight with Cloudflare in production.
# Audit current statebash ~/Documents/Claude_Code/tools/refresh_claude_team_token.sh --status
# Force a refresh immediatelybash ~/Documents/Claude_Code/tools/refresh_claude_team_token.sh --refresh
# Exercise the browser-driven E2E harness locallybash ~/Documents/Claude_Code/tests/test-claude-team-refresh-e2e.shThe Holocron e2e suite is built on agent-browser, not Playwright. That decision was not aesthetic. It was because Holocron debugging is about visible state:
That workflow maps naturally to snapshots, screenshots, and named sessions. It does not benefit from importing the entire DOM into the conversation like an overqualified witness who will not stop talking.
The integration is verified by tests/test-agent-browser-e2e.sh, which validates:
Claude Team repair adds a second browser-specific harness through tests/test-claude-team-refresh-e2e.sh, which validates:
claude setup-token URL capturefile:// auth pageHolocron adds a second layer of validation through tests/holocron-e2e.sh in the app repo, where agent-browser drives the packaged UI path the way a human operator actually would.