SKILL.md--- name: core description: Core agent-browser usage guide. Read this before running any agent-browser commands. Covers the snapshot-and-ref workflow, navigating pages, interacting with elements (click, fill, type, select), extracting text and data, taking screenshots, managing tabs, handling forms and auth, waiting for content, running multiple browser sessions in parallel, and troubleshooting common failures. Use when the user asks to interact with a website, fill a form, click something, extract data, take a screenshot, log into a site, test a web app, or automate any browser task. allowed-tools: Bash(agent-browser:*), Bash(npx agent-browser:*) --- # agent-browser core agent-browser drives Chrome over CDP or Firefox over WebDriver BiDi from the command line. A snapshot returns the page's accessibility tree with a compact `@eN` ref for each element, and you act on those refs. This guide covers the loop and the common web tasks. Detailed flags, edge cases, and specialized workflows live in references and other skills; [Load more when you need it](#load-more-when-you-need-it) says which one to load for what. Pass `--engine firefox` when opening a session to use Firefox 150 or newer. See the [Firefox engine guide](https://agent-browser.dev/engines/firefox). ## Always use your own session Before your first command, get a session name for the task. It is stable for the worktree, so running it again prints the same name: ```bash agent-browser session id --scope worktree --prefix task # prints a name such as task-be5442ae6b6b ``` Pass that name with `--session <name>` on every command. Many agent harnesses run each command in a new shell, so an `export AGENT_BROWSER_SESSION=...` is gone by the next command, which then runs in the default session. Export the variable only when every command runs in the same shell. The default unnamed session is one browser shared with every other agent on the machine, and it persists across conversations. Working in it can take over another agent's page or navigate away from something the human left open. Examples below omit `--session` for brevity; add it to each command. ## The core loop ```bash agent-browser open <url> # 1. Open a page agent-browser snapshot -i # 2. See what's on it (interactive elements only) agent-browser click @e3 # 3. Act on refs from the snapshot agent-browser snapshot -i # 4. Re-snapshot after any page change ``` Refs stay valid for elements that survive a same-document update. A ref used after the page navigated to a new document, including a navigation caused by a click, fails with a "no longer loaded" error. Take a fresh snapshot after navigation or to observe page changes. `back` and `forward` are the exception: when Chrome restores a document you already snapshotted from its back/forward cache, the refs from that document still work. Prefer snapshots. Take a screenshot only when the user as