CoderClaw can run a dedicated Chrome/Brave/Edge/Chromium profile that the agent controls. It is isolated from your personal browser and is managed through a small local control service inside the Gateway (loopback only).
Beginner view:
coderclaw profile does not touch your personal browser profile.chrome profile uses the system default Chromium browser via the
extension relay; switch to coderclaw for the isolated managed browser.coderclaw, work, remote, …).This browser is not your daily driver. It is a safe, isolated surface for agent automation and verification.
coderclaw browser --browser-profile coderclaw status
coderclaw browser --browser-profile coderclaw start
coderclaw browser --browser-profile coderclaw open https://example.com
coderclaw browser --browser-profile coderclaw snapshot
If you get “Browser disabled”, enable it in config (see below) and restart the Gateway.
coderclaw vs chromecoderclaw: managed, isolated browser (no extension required).chrome: extension relay to your system browser (requires the CoderClaw
extension to be attached to a tab).Set browser.defaultProfile: "coderclaw" if you want managed mode by default.
Browser settings live in ~/.coderclaw/coderclaw.json.
{
browser: {
enabled: true, // default: true
// cdpUrl: "http://127.0.0.1:18792", // legacy single-profile override
remoteCdpTimeoutMs: 1500, // remote CDP HTTP timeout (ms)
remoteCdpHandshakeTimeoutMs: 3000, // remote CDP WebSocket handshake timeout (ms)
defaultProfile: "chrome",
color: "#FF4500",
headless: false,
noSandbox: false,
attachOnly: false,
executablePath: "/Applications/Brave Browser.app/Contents/MacOS/Brave Browser",
profiles: {
coderclaw: { cdpPort: 18800, color: "#FF4500" },
work: { cdpPort: 18801, color: "#0066CC" },
remote: { cdpUrl: "http://10.0.0.42:9222", color: "#00AA00" },
},
},
}
Notes:
gateway.port
(default: 18791, which is gateway + 2). The relay uses the next port (18792).gateway.port or CODERCLAW_GATEWAY_PORT),
the derived browser ports shift to stay in the same “family”.cdpUrl defaults to the relay port when unset.remoteCdpTimeoutMs applies to remote (non-loopback) CDP reachability checks.remoteCdpHandshakeTimeoutMs applies to remote CDP WebSocket reachability checks.attachOnly: true means “never launch a local browser; only attach if it is already running.”color + per-profile color tint the browser UI so you can see which profile is active.chrome (extension relay). Use defaultProfile: "coderclaw" for the managed browser.coderclaw profiles auto-assign cdpPort/cdpUrl — set those only for remote CDP.If your system default browser is Chromium-based (Chrome/Brave/Edge/etc),
CoderClaw uses it automatically. Set browser.executablePath to override
auto-detection:
CLI example:
coderclaw config set browser.executablePath "/usr/bin/google-chrome"
// macOS
{
browser: {
executablePath: "/Applications/Brave Browser.app/Contents/MacOS/Brave Browser"
}
}
// Windows
{
browser: {
executablePath: "C:\\Program Files\\BraveSoftware\\Brave-Browser\\Application\\brave.exe"
}
}
// Linux
{
browser: {
executablePath: "/usr/bin/brave-browser"
}
}
browser.profiles.<name>.cdpUrl (or browser.cdpUrl) to
attach to a remote Chromium-based browser. In this case, CoderClaw will not launch a local browser.Remote CDP URLs can include auth:
https://provider.example?token=<token>)https://user:[email protected])CoderClaw preserves the auth when calling /json/* endpoints and when connecting
to the CDP WebSocket. Prefer environment variables or secrets managers for
tokens instead of committing them to config files.
If you run a node host on the machine that has your browser, CoderClaw can auto-route browser tool calls to that node without any extra browser config. This is the default path for remote gateways.
Notes:
browser.profiles config (same as local).nodeHost.browserProxy.enabled=falsegateway.nodes.browser.mode="off"Browserless is a hosted Chromium service that exposes CDP endpoints over HTTPS. You can point a CoderClaw browser profile at a Browserless region endpoint and authenticate with your API key.
Example:
{
browser: {
enabled: true,
defaultProfile: "browserless",
remoteCdpTimeoutMs: 2000,
remoteCdpHandshakeTimeoutMs: 4000,
profiles: {
browserless: {
cdpUrl: "https://production-sfo.browserless.io?token=<BROWSERLESS_API_KEY>",
color: "#00AA00",
},
},
},
}
Notes:
<BROWSERLESS_API_KEY> with your real Browserless token.Key ideas:
gateway.auth.token on startup and persists it to config.Remote CDP tips:
CoderClaw supports multiple named profiles (routing configs). Profiles can be:
Defaults:
coderclaw profile is auto-created if missing.chrome profile is built-in for the Chrome extension relay (points at http://127.0.0.1:18792 by default).All control endpoints accept ?profile=<name>; the CLI uses --browser-profile.
CoderClaw can also drive your existing Chrome tabs (no separate “coderclaw” Chrome instance) via a local CDP relay + a Chrome extension.
Full guide: Chrome extension
Flow:
cdpUrl (default: http://127.0.0.1:18792).browser tool, by selecting the right profile.If the Gateway runs elsewhere, run a node host on the browser machine so the Gateway can proxy browser actions.
If the agent session is sandboxed, the browser tool may default to target="sandbox" (sandbox browser).
Chrome extension relay takeover requires host browser control, so either:
agents.defaults.sandbox.browser.allowHostControl: true and use target="host" when calling the tool.coderclaw browser extension install
chrome://extensions → enable “Developer mode”coderclaw browser extension pathON).coderclaw browser --browser-profile chrome tabsbrowser with profile="chrome"Optional: if you want a different name or relay port, create your own profile:
coderclaw browser create-profile \
--name my-chrome \
--driver extension \
--cdp-url http://127.0.0.1:18792 \
--color "#00AA00"
Notes:
9222 to prevent collisions with dev workflows.targetId, not “last tab”.When launching locally, CoderClaw picks the first available:
You can override with browser.executablePath.
Platforms:
/Applications and ~/Applications.google-chrome, brave, microsoft-edge, chromium, etc.For local integrations only, the Gateway exposes a small loopback HTTP API:
GET /, POST /start, POST /stopGET /tabs, POST /tabs/open, POST /tabs/focus, DELETE /tabs/:targetIdGET /snapshot, POST /screenshotPOST /navigate, POST /actPOST /hooks/file-chooser, POST /hooks/dialogPOST /download, POST /wait/downloadGET /console, POST /pdfGET /errors, GET /requests, POST /trace/start, POST /trace/stop, POST /highlightPOST /response/bodyGET /cookies, POST /cookies/set, POST /cookies/clearGET /storage/:kind, POST /storage/:kind/set, POST /storage/:kind/clearPOST /set/offline, POST /set/headers, POST /set/credentials, POST /set/geolocation, POST /set/media, POST /set/timezone, POST /set/locale, POST /set/deviceAll endpoints accept ?profile=<name>.
If gateway auth is configured, browser HTTP routes require auth too:
Authorization: Bearer <gateway token>x-coderclaw-password: <gateway password> or HTTP Basic auth with that passwordSome features (navigate/act/AI snapshot/role snapshot, element screenshots, PDF) require Playwright. If Playwright isn’t installed, those endpoints return a clear 501 error. ARIA snapshots and basic screenshots still work for coderclaw-managed Chrome. For the Chrome extension relay driver, ARIA snapshots and screenshots require Playwright.
If you see Playwright is not available in this gateway build, install the full
Playwright package (not playwright-core) and restart the gateway, or reinstall
CoderClaw with browser support.
If your Gateway runs in Docker, avoid npx playwright (npm override conflicts).
Use the bundled CLI instead:
docker compose run --rm coderclaw-cli \
node /app/node_modules/playwright-core/cli.js install chromium
To persist browser downloads, set PLAYWRIGHT_BROWSERS_PATH (for example,
/home/node/.cache/ms-playwright) and make sure /home/node is persisted via
CODERCLAW_HOME_VOLUME or a bind mount. See Docker.
High-level flow:
This design keeps the agent on a stable, deterministic interface while letting you swap local/remote browsers and profiles.
All commands accept --browser-profile <name> to target a specific profile.
All commands also accept --json for machine-readable output (stable payloads).
Basics:
coderclaw browser statuscoderclaw browser startcoderclaw browser stopcoderclaw browser tabscoderclaw browser tabcoderclaw browser tab newcoderclaw browser tab select 2coderclaw browser tab close 2coderclaw browser open https://example.comcoderclaw browser focus abcd1234coderclaw browser close abcd1234Inspection:
coderclaw browser screenshotcoderclaw browser screenshot --full-pagecoderclaw browser screenshot --ref 12coderclaw browser screenshot --ref e12coderclaw browser snapshotcoderclaw browser snapshot --format aria --limit 200coderclaw browser snapshot --interactive --compact --depth 6coderclaw browser snapshot --efficientcoderclaw browser snapshot --labelscoderclaw browser snapshot --selector "#main" --interactivecoderclaw browser snapshot --frame "iframe#main" --interactivecoderclaw browser console --level errorcoderclaw browser errors --clearcoderclaw browser requests --filter api --clearcoderclaw browser pdfcoderclaw browser responsebody "**/api" --max-chars 5000Actions:
coderclaw browser navigate https://example.comcoderclaw browser resize 1280 720coderclaw browser click 12 --doublecoderclaw browser click e12 --doublecoderclaw browser type 23 "hello" --submitcoderclaw browser press Entercoderclaw browser hover 44coderclaw browser scrollintoview e12coderclaw browser drag 10 11coderclaw browser select 9 OptionA OptionBcoderclaw browser download e12 report.pdfcoderclaw browser waitfordownload report.pdfcoderclaw browser upload /tmp/coderclaw/uploads/file.pdfcoderclaw browser fill --fields '[{"ref":"1","type":"text","value":"Ada"}]'coderclaw browser dialog --acceptcoderclaw browser wait --text "Done"coderclaw browser wait "#main" --url "**/dash" --load networkidle --fn "window.ready===true"coderclaw browser evaluate --fn '(el) => el.textContent' --ref 7coderclaw browser highlight e12coderclaw browser trace startcoderclaw browser trace stopState:
coderclaw browser cookiescoderclaw browser cookies set session abc123 --url "https://example.com"coderclaw browser cookies clearcoderclaw browser storage local getcoderclaw browser storage local set theme darkcoderclaw browser storage session clearcoderclaw browser set offline oncoderclaw browser set headers --headers-json '{"X-Debug":"1"}'coderclaw browser set credentials user passcoderclaw browser set credentials --clearcoderclaw browser set geo 37.7749 -122.4194 --origin "https://example.com"coderclaw browser set geo --clearcoderclaw browser set media darkcoderclaw browser set timezone America/New_Yorkcoderclaw browser set locale en-UScoderclaw browser set device "iPhone 14"Notes:
upload and dialog are arming calls; run them before the click/press
that triggers the chooser/dialog./tmp/coderclaw (fallback: ${os.tmpdir()}/coderclaw)/tmp/coderclaw/downloads (fallback: ${os.tmpdir()}/coderclaw/downloads)/tmp/coderclaw/uploads (fallback: ${os.tmpdir()}/coderclaw/uploads)upload can also set file inputs directly via --input-ref or --element.snapshot:
--format ai (default when Playwright is installed): returns an AI snapshot with numeric refs (aria-ref="<n>").--format aria: returns the accessibility tree (no refs; inspection only).--efficient (or --mode efficient): compact role snapshot preset (interactive + compact + depth + lower maxChars).browser.snapshotDefaults.mode: "efficient" to use efficient snapshots when the caller does not pass a mode (see Gateway configuration).--interactive, --compact, --depth, --selector) force a role-based snapshot with refs like ref=e12.--frame "<iframe selector>" scopes role snapshots to an iframe (pairs with role refs like e12).--interactive outputs a flat, easy-to-pick list of interactive elements (best for driving actions).--labels adds a viewport-only screenshot with overlayed ref labels (prints MEDIA:<path>).click/type/etc require a ref from snapshot (either numeric 12 or role ref e12).
CSS selectors are intentionally not supported for actions.CoderClaw supports two “snapshot” styles:
coderclaw browser snapshot (default; --format ai)
coderclaw browser click 12, coderclaw browser type 23 "hello".aria-ref.e12): coderclaw browser snapshot --interactive (or --compact, --depth, --selector, --frame)
[ref=e12] (and optional [nth=1]).coderclaw browser click e12, coderclaw browser highlight e12.getByRole(...) (plus nth() for duplicates).--labels to include a viewport screenshot with overlayed e12 labels.Ref behavior:
snapshot and use a fresh ref.--frame, role refs are scoped to that iframe until the next role snapshot.You can wait on more than just time/text:
coderclaw browser wait --url "**/dash"coderclaw browser wait --load networkidlecoderclaw browser wait --fn "window.ready===true"coderclaw browser wait "#main"These can be combined:
coderclaw browser wait "#main" \
--url "**/dash" \
--load networkidle \
--fn "window.ready===true" \
--timeout-ms 15000
When an action fails (e.g. “not visible”, “strict mode violation”, “covered”):
coderclaw browser snapshot --interactiveclick <ref> / type <ref> (prefer role refs in interactive mode)coderclaw browser highlight <ref> to see what Playwright is targetingcoderclaw browser errors --clearcoderclaw browser requests --filter api --clearcoderclaw browser trace startcoderclaw browser trace stop (prints TRACE:<path>)--json is for scripting and structured tooling.
Examples:
coderclaw browser status --json
coderclaw browser snapshot --interactive --json
coderclaw browser requests --filter api --json
coderclaw browser cookies --json
Role snapshots in JSON include refs plus a small stats block (lines/chars/refs/interactive) so tools can reason about payload size and density.
These are useful for “make the site behave like X” workflows:
cookies, cookies set, cookies clearstorage local|session get|set|clearset offline on|offset headers --headers-json '{"X-Debug":"1"}' (legacy set headers --json '{"X-Debug":"1"}' remains supported)set credentials user pass (or --clear)set geo <lat> <lon> --origin "https://example.com" (or --clear)set media dark|light|no-preference|noneset timezone ..., set locale ...set device "iPhone 14" (Playwright device presets)set viewport 1280 720browser act kind=evaluate / coderclaw browser evaluate and wait --fn
execute arbitrary JavaScript in the page context. Prompt injection can steer
this. Disable it with browser.evaluateEnabled=false if you do not need it.For Linux-specific issues (especially snap Chromium), see Browser troubleshooting.
The agent gets one tool for browser automation:
browser — status/start/stop/tabs/open/focus/close/snapshot/screenshot/navigate/actHow it maps:
browser snapshot returns a stable UI tree (AI or ARIA).browser act uses the snapshot ref IDs to click/type/drag/select.browser screenshot captures pixels (full page or element).browser accepts:
profile to choose a named browser profile (coderclaw, chrome, or remote CDP).target (sandbox |
host |
node) to select where the browser lives. |
target: "host" requires agents.defaults.sandbox.browser.allowHostControl=true.target is omitted: sandboxed sessions default to sandbox, non-sandbox sessions default to host.target="host" or target="node".This keeps the agent deterministic and avoids brittle selectors.