Files
admin fd9c902bcc chore(技能): 浏览器起法收敛为「会话后台任务」+ 关窗即停手;补索引与自测清理
- browser-harness/SKILL.md:§1 起法整段重写为「只允许这一种 —— 本会话的后台任务」(字面命令/
  为什么只许这一种/守卫语义/已知代价/起不来对照表);§3 补一条排障 —— 认进程命令行与它自己的日志,
  ⛔ 别信 pid 父链;**「删掉脚本」≠「停掉进程」**(依据 2026-10-10 实测:孤儿守卫在脚本已删后仍把浏览器拉回)
- browser-harness/agent-workspace/bh_chrome_keepalive.py:守卫语义分两档 —— Chrome 正常关窗(rc=0) ⇒ 停手退出;
  异常退出(rc≠0) ⇒ 重拉(依据:用户手关被无条件拉回,连关三次弹三次)
- session-mechanism/scripts/selftest.py:删掉重复定义的 `t_check_cooldown_no_pileup`(两段逐字相同);自测 PASS 109 / FAIL 0
- session-mechanism/references/humanizer-en/SKILL.md:与顶层 `humanizer` 技能同名冲突 ⇒ 去掉本包这份的注册
  (`user-invocable: false` + `disable-model-invocation: true`),6 个文件正文一字未动
- session-mechanism/references/01-文档索引.md:补登 `04-决策方法论.md`/`dsh-decision-method/`/`作业规矩/`/`humanizer-en/`
2026-10-10 23:25:36 +08:00
..

Browser Harness

Browser Harness ♞

Connect an LLM directly to your real browser with a thin, editable CDP harness. For browser tasks where you need complete freedom.

One websocket to Chrome, nothing between. The agent writes what's missing during execution. The harness improves itself every run.

Try browser-harness in Browser Use Cloud or paste the setup prompt into your coding agent.

  ● agent: wants to upload a file
  │
  ● agent-workspace/agent_helpers.py → helper missing
  │
  ● agent writes it                         agent_helpers.py
  │                                                       + custom helper
  ✓ file uploaded

You will never use the browser again.

Setup prompt

Paste into Claude Code or Codex:

Install or upgrade browser-harness to the latest stable version with uv using Python 3.12, register the skill from `browser-harness skill`, and connect it to my browser. Ask whether I want local browser recordings enabled; default to no and preserve my existing preference on upgrades. Follow https://github.com/browser-use/browser-harness/blob/main/install.md if setup or connection fails.

The agent will open chrome://inspect/#remote-debugging. Tick the checkbox so the agent can connect to your browser:

Remote debugging setup

Click Allow when the per-attach popup appears (Chrome 144+):

Allow remote debugging popup

See agent-workspace/domain-skills/ for example tasks.

Free Browser Use Cloud browsers

Stealth, sub-agents, or headless deployment.
Browser Use Cloud free tier: 3 concurrent browsers, proxies, captcha solving, and more. No card required.

Architecture (~1k lines across 4 core files)

  • install.md — first-time install and browser bootstrap
  • SKILL.md — day-to-day usage
  • src/browser_harness/ — protected core package
  • ${XDG_CONFIG_HOME:-~/.config}/browser-harness/agent-workspace/agent_helpers.py — helper code the agent edits
  • ${XDG_CONFIG_HOME:-~/.config}/browser-harness/agent-workspace/domain-skills/ — reusable site-specific skills the agent edits

Plain browser-harness helper calls attach to the running Chrome/Chromium CDP endpoint. For isolated automation, launch Chrome yourself with --remote-debugging-port and pass BU_CDP_URL, or use a Browser Use cloud browser.

Development

From a checkout, use ./browser-harness to run the current working tree without activating a virtualenv or depending on the globally installed command:

./browser-harness <<'PY'
print(page_info())
PY

Normal agent-facing docs should keep using browser-harness; the ./browser-harness launcher is only for local repo testing.

Contributing

PRs and improvements welcome. The best way to help: contribute a new domain skill under agent-workspace/domain-skills/ for a site or task you use often (LinkedIn outreach, ordering on Amazon, filing expenses, etc.). Each skill teaches the agent the selectors, flows, and edge cases it would otherwise have to rediscover.

  • Skills are written by the harness, not by you. Just run your task with the agent — when it figures something non-obvious out, it files the skill itself (see SKILL.md). Please don't hand-author skill files; agent-generated ones reflect what actually works in the browser.
  • Open a PR with the generated domain-skills/<site>/ folder copied into this repo's agent-workspace/domain-skills/ examples — small and focused is great.
  • Bug fixes, docs tweaks, and helper improvements are equally welcome.
  • Browse existing skills (github/, linkedin/, amazon/, ...) to see the shape.

If you're not sure where to start, open an issue and we'll point you somewhere useful.

Domain skills

Set BH_DOMAIN_SKILLS=1 to enable domain skills from the agent workspace. This repo's agent-workspace/domain-skills/ directory contains examples to contribute via PR.


The Bitter Lesson of Agent Harnesses · Web Agents That Actually Learn