bap-browser

A command-line browser automation tool for visiting websites, interacting with forms, extracting information, taking screenshots, and running multi-step browser tasks.

In plain words
What is it for?
Use it for searches, logins, checkouts, form filling, data extraction, screenshots, and other workflows that require several browser steps.
Why use it?
It reduces the manual work of repeating browser actions and can recover from some changed page selectors using alternative page signals.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/browseragentprotocol/bap/bap-browser
Any agent
npx skills add browseragentprotocol/bap --skill bap-browser
Clone the repo
git clone --depth 1 https://github.com/browseragentprotocol/bap

Made for: Claude Code, Codex.

Per session 56 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,265 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00056 $0.02265
Opus 5 $0.00028 $0.01132
Sonnet 5 $0.00011 $0.00453
Haiku 4.5 $0.00006 $0.00227

Measured 2d ago against content hash c8fd70e74fbc, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

bap-browser scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

packages/cli/skills/bap-browser/SKILL.md · 214 lines

How it starts

The opening of the file, as written. The whole thing — 214 lines — stays where its author put it; the contents beside it link to each section on GitHub.

BAP Browser CLI

AI-first browser automation. Like playwright-cli but with composite actions, semantic selectors, self-healing selectors, and action caching built in.

Quick Start

bap demo                                    # Guided walkthrough for first-time users
bap goto https://example.com --observe      # Navigate + observe in 1 fused call
bap click role:button:"Get Started"         # Semantic selector
bap close

Inside this repo, use pnpm exec bap instead of bare bap. Prefer bap goto for navigation; use bap open only for explicit browser lifecycle control.

Smart Defaults

Session persistence — Browser pages persist across CLI invocations. Disconnect parks context; reconnect restores it. Named sessions: bap -s=checkout goto /cart. Auto-expire after 5 minutes.

Self-healing selectors — When a selector fails, BAP tries fallback identity signals (testId, ariaLabel+role, id, name) before erroring. No flags needed.

Action caching — Selector resolutions cached to ~/.bap/cache/actions/ (24h TTL). Repeat actions skip re-resolution.

Usage

Composite actions — multiple steps in ONE command:

bap act fill:role:textbox:"Email"="[email protected]" \
        fill:role:textbox:"Password"="secret" \
        click:role:button:"Sign in"

Step syntax: action:selector=value or action:selector.

Fused operations — combine server calls into one, cutting roundtrips:

bap goto https://example.com --observe          # Navigate + observe (1 call, not 2)
bap act click:role:button:"Submit" --observe    # Act + post-observe (1 call)
bap observe --diff                               # Incremental: only changes
bap observe --tier=minimal                       # Minimal response (refs + names only)

Always prefer fused calls. --observe saves a roundtrip. --diff avoids re-scanning unchanged elements. --tier=minimal reduces response size.

Common patterns:

bap act click:text:"Accept" goto:https://example.com/app          # Dismiss + navigate
bap act fill:role:searchbox:"Search"="query" press:Enter           # Search
bap goto https://app.example.com/login --observe                   # Login flow (2 calls)
bap act fill:label:"Email"="[email protected]" fill:label:"Password"="s" \
        click:role:button:"Sign in" --observe

Read the full file on GitHub · 214 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 214 lines · 56 tokens per session scan A c8fd70e74fbc

Subscribe to this mod's changes

bap-browser is a skill published in the GitHub repository browseragentprotocol/bap (5 stars, last pushed 3mo ago), licensed Apache-2.0. It adds 56 tokens to every session and 2,265 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

webcmd-browser

Use when a live browser task requires Playwright interaction, authenticated handoff, visible UI verification, or ad-hoc page inspection.

agentrhq/webcmd · 30 tokens

moli-webfetch

Fetch, inspect, crawl, and capture live, JavaScript-rendered websites with Moli. Use when Codex needs current web content, web research, fact lookup, link following, a bounded crawl, client-rendered or response-gated content, network diagnostics, or a standalone HTML, Markdown, JSON, semantic-tree, viewport or…

lexmount/moli · 90 tokens

moli-cdp-server

Start Moli's CDP server and connect Playwright, Puppeteer, or raw CDP clients. Use to run a headless-browser CDP endpoint, replace a Chromium process, attach over CDP, enable real layout and screenshot surfaces, or diagnose CDP discovery, connection, and target startup—even when Moli is not named.

lexmount/moli · 74 tokens

playwright-rs-usage

Procedural reference for using playwright-rs in Rust browser-automation code — object model (Browser/Context/Page/Locator), the locator!() macro, builder pattern for options, auto-wait semantics, adding the crate and installing its browsers, and how to capture / inspect traces for failure diagnosis. Use when writing…

padamson/playwright-rust · 98 tokens

opensteer

Direct browser control via CDP. Use when the user wants to automate, inspect, scrape, test, or interact with web pages.

steerlabs/opensteer · 31 tokens

apitap

ApiTap gives AI agents cheap access to web data through three layers.

n1byn1kt/apitap · 0 tokens