Borrowing it
Nothing to install: this file belongs to sologuy/chatgpt-web-handoff. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/sologuy/chatgpt-web-handoff/main/AGENTS.mdgit clone --depth 1 https://github.com/sologuy/chatgpt-web-handoffWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/instructions/sologuy/chatgpt-web-handoff/agents-md)<a href="https://agentmods.dev/instructions/sologuy/chatgpt-web-handoff/agents-md"><img src="https://agentmods.dev/badge/instructions/sologuy/chatgpt-web-handoff/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/instructions/sologuy/chatgpt-web-handoff/agents-md"><img src="https://agentmods.dev/badge/instructions/sologuy/chatgpt-web-handoff/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.01853 | $0.01853 |
| Opus 5 | $0.00927 | $0.00927 |
| Sonnet 5 | $0.00371 | $0.00371 |
| Haiku 4.5 | $0.00185 | $0.00185 |
Grade A, and why
chatgpt-web-handoff AGENTS.md scanned grade A with 1 finding 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 8d 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.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
curl -s http://127.0.0.1:9222/json/version | jq -r .Browser How it starts
The opening of the file, as written. The whole thing — 111 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AGENTS.md
给在这个仓库里干活的 AI 编码助手(Claude Code / Codex / DSH 等)看的规则。
CLAUDE.md 通过 @AGENTS.md 导入本文件。全程简体中文。
1. 这是什么
chatgpt-web-handoff(cgh):把编码 agent 当前任务的上下文,交接给 你日常那个 Chrome 里已登录的 ChatGPT Web 做独立审查,再把结构化结论取回本地仓库。
形态:一个薄的确定性 CLI(bin/cgh + bin/cgh_cdp.py + bin/cgh_web.py)+ 一个 Skill。
不常驻服务、不写浏览器插件、不做 Native Messaging、不自建 Broker、不另起 Chrome Profile。
明确非目标:不做 ChatGPT API 替代品;不做通用浏览器自动化框架; 不做多账号 / 多并发调度;不保存或搬运登录凭证。
2. 改代码前先读
| 顺序 | 文件 | 作用 |
|---|---|---|
| ① | 本文件 §6 | 硬约束,不可违反 |
| ② | bin/cgh 的模块 docstring |
作业目录、job.json 字段、状态机、哨兵格式 |
| ③ | bin/cgh_web.py 的注释 |
ChatGPT 真实 UI 的锚点、档位标签、附件行为、后台标签页解冻 |
| ④ | CONTRIBUTING.zh-CN.md |
分层边界、怎么验证改动 |
3. 怎么验证改动
本项目不写单元测试,验证靠真跑——干跑测不出浏览器那一半。
改完 bin/ 里任何东西:
./bin/cgh doctor通过- 在一个临时 git 仓库里跑一遍
new/ 单活跃拦截 / 状态机 /parse哨兵解析 - 再用
cgh submit实跑一次低档位作业——这一步不能省
4. Git
| 分支 | 用途 |
|---|---|
main |
稳定基线,只接受合并 + tag |
dev |
日常工作分支 |
task/<name> |
跨多日或有风险的任务 |
commit 格式:<type>: <中文摘要>,type ∈ docs / feat / fix / chore / design。
提交前 git status --short 审查,确认没有凭证、没有 .env、
没有 .chatgpt/web-handoff/ 作业产物。
5. 目录
| 目录 | 职责 |
|---|---|
bin/ |
CLI 与浏览器编排(cgh 账本 / cgh_cdp 传输 / cgh_web ChatGPT 语义) |
skills/chatgpt-handoff/ |
Skill 真相源,scripts/install.sh 会 symlink 出去 |
templates/handoff/ |
request.md / followup.md / job.json 模板(运行时依赖) |
scripts/ |
安装脚本 |
Handoff 作业产物落在使用方仓库的 .chatgpt/web-handoff/<job_id>/,不落在本仓库。
本仓库的 .chatgpt/web-handoff/ 只用于自测,整目录已 gitignore。
6. 硬约束(实现时不可违反)
- 不落凭证:任何环节不读取、不复制、不持久化 cookie / session token / 账号密码。日志、快照、
job.json、request.md里都不得出现凭证或Authorization头。 - 页面白名单:任何
click/fill/type_text/upload_file之前,必须先确认当前 page 的 host ∈chatgpt.com/chat.openai.com。不匹配立即停止并置状态wrong_page,不试探、不猜测。 - effort 不静默降级:请求的推理档位在 UI 里找不到时,置
effort_not_found并列出实际可选项,交由用户或配置决定,禁止悄悄用低档跑完再交付。job.json必须同时记录effort_requested与effort_actual。 - 不静默点坐标:元素定位优先级 —— ① a11y role + accessible name ② 页面可见文本 ③
data-testid/data-message-author-role④ 失败则保存failed-snapshot.txt+failed-page.webp并置ui_changed。禁止写死 CSS selector,禁止凭坐标盲点。 - 不阻塞:
submit发送成功后立即返回job_id;poll单次调用只读一次状态就返回,不在一次工具调用里自旋等待。 - 单活跃作业:
max_active_jobs = 1,用 lockfile 实际拦截(不只是写在文档里)。并发需求等 V2 的--experimentalPageIdRouting。 - 浏览器通道(v0.4 改):稳定提交路径必须由确定性代码执行,
主驱动是
bin/cgh_cdp.py的自有 raw CDP;chrome-devtools-mcp降为探测 / 诊断 / UI 改版适配用途, 不参与正常 handoff。禁止用 Playwright 连本机 9222 的 Chrome——旧版connectOverCDP()会替换 Chrome 的下载委托,下载文件变成无扩展名的playwright-artifacts-*,断开或杀进程都不恢复,只能重启 Chrome。 也不要在跑 handoff 时同时挂 claude-in-chrome,两个自动化通道会互抢标签页和焦点。 CDP 层只保留传输与通用页面操作,业务语义一律留在cgh_web.py,不要把它养成通用 DevTools 框架。 - 使用边界:不做团队共享服务、不做批量任务、不对外提供 API。
- 不改写原文:
result.md保存 ChatGPT 原始输出 + 解析出的结构化块。不做"总结的总结",不删少数派意见,不把不确定结论写成确定结论。 - 产物默认不进使用方 git:
cgh在使用方仓库创建.chatgpt/web-handoff/时,必须同时确保其被 gitignore(request.md含用户代码上下文,result.md含外部模型输出)。
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.
- 8d ago First seen · 111 lines · 1,853 tokens per session scan A 0bb375847322
chatgpt-web-handoff AGENTS.md is an instructions file published in the GitHub repository sologuy/chatgpt-web-handoff (2 stars, last pushed 3d ago), licensed MIT. It adds 1,853 tokens to every session, about $0.0093 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other instructions, from other repositories
next.js AGENTS.md
AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.
codex AGENTS.md
AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.
vscode buildNext.instructions.md
Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).
langchain AGENTS.md
AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.
deepseek-harness AGENTS.md
AGENTS.md instructions for deepseek-ai/deepseek-harness, covering agents.md, pre-stable apis and released session data, repository layout, commands and host sandbox failures.