agentleFS
fxl1209739475-fxlfxl1209739475-fxl/codex-claude-bridge/SKILL.md

claude-bridge

Skill0 starsChanged 4 months agoMITView on GitHub

让 Codex 把明确任务交给本机已登录的 Claude Code,并以受控权限、工具轨迹和独立验收收回结果。用户说“用 Claude 做”“让 Claude 后台跑”“Codex 额度不够,改用 Claude”“让 Claude 审阅/调研/执行”“继续上次 Claude 会话”时必须使用。提供顾问、公开研究、候选修改三种模式;不用于浏览器登录态、凭据、消息发送、支付、生产操作或 Claude 自己调用 Claude。

  • Reads credentials

2 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions2 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 2

    1. Mugyen/claude-bridge★ 4same name
    2. lijunzhang-disabled/claude-bridge★ 0same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

The file

Files
SKILL.md

Claude Bridge

把本机已登录的 Claude Code 当作受控执行者。当前 Codex 负责拆题、选择权限、检查工具轨迹和验收;Claude 只在所选模式的边界内工作。

如果当前宿主本身就是 Claude Code,不要运行本 Skill 调用另一个 Claude。直接说明这是给 Codex 等外部总控使用的桥接 Skill,避免递归调用。

三种模式

用户说法CLI 模式Claude 能做什么明确不能做什么
“用 Claude 顾问模式分析”advice不调用文件、网页或命令工具;提供 --cwd 和至少一个 --include 时,只读所选文件的受管副本联网、写文件、命令、浏览器
“用 Claude 公开研究模式查”researchWebSearch、WebFetch 公开网页本地文件、登录态网页、写入、命令
“用 Claude 候选修改模式做”execute在受管候选副本创建或修改文件,仅生成候选修改直接改原项目、通用 Bash、联网、浏览器

没有指定模式时默认 advice;未提供 --cwd 和 --include 时,不读取任何本地文件。不要把“接力”做成第四种权限:--session 保存本次 Claude 对话和当前精确权限范围,--resume 必须继承原模式和原范围,不可提权。

调用前

  1. 把任务收缩成 Claude 能独立完成的一件事,并写清交付物和验收标准。
  2. 只把任务必要的文件纳入 --cwd / --include;本地模式必须显式写 --include,不要包含凭据、.env、Cookie、私人聊天或生产数据。
  3. 在调用前告诉用户本次使用的中文模式、是否读取文件、是否联网、是否产生候选修改。
  4. 用户只要求建议或研究时,不升级成 execute。用户明确要求修改时,execute 仍只改临时副本。

运行命令

在本 Skill 根目录运行。

顾问模式

纯思考,不读取本地文件:

node scripts/claude-bridge.mjs advice \
  --task "比较这两个方案,给出推荐、风险和唯一下一步。"

读取指定项目的受管副本:

node scripts/claude-bridge.mjs advice \
  --cwd "/绝对路径/项目" \
  --include "README.md" \
  --include "src" \
  --task "审阅这些文件,给出问题、相对路径证据和最小建议。"

--include 必须是相对 --cwd 的路径并且至少出现一次;Bridge 不再默认复制整个目录。选中的目录仍会跳过常见敏感目录、依赖目录和凭据文件,并受文件数与输入大小上限保护。

公开研究模式

node scripts/claude-bridge.mjs research \
  --domain "code.claude.com" \
  --task "只用官方资料核实 Claude Code 的会话续接方式,并给出真实链接。"

--domain 至少提供一个且可以重复。此模式始终没有本地文件工具,也不使用 Chrome 登录态。回执能证明 Claude 请求的 URL 与主机;若最终重定向 URL 没有独立工具事件,不得宣称 Bridge 已单独核验了重定向终点。

候选修改模式(仅生成候选修改)

node scripts/claude-bridge.mjs execute \
  --cwd "/绝对路径/项目" \
  --include "src" \
  --task "完成指定修改,并准确说明改了哪些文件。"

Claude 只修改返回回执中的 candidateDirectory。原项目必须保持不变;回执状态是 pending_review,不是“已经应用”。Bridge 不运行候选代码或项目测试,因为候选代码本身不可信;测试必须等 Codex 审阅并按正常流程应用获准修改后,再由 Codex 在自己的权限边界中执行。

连续会话

首次调用加 --session:

node scripts/claude-bridge.mjs advice --session --task "先记住本任务边界并完成第一轮分析。"

从回执取 session.id,下一轮只传会话 ID 和新任务:

node scripts/claude-bridge.mjs --resume "<session-id>" --task "继续上一轮,只补充风险部分。"

续接时不得添加 --cwd、模式、域名、模型或 effort。Bridge 会从受管登记文件恢复原权限;会话默认 24 小时过期。

回收与验收

每次运行读取最终 JSON 回执,至少检查:

  1. profile 和 permissions.tools 是否与交办一致。
  2. audit.init 是否恰好出现一次,MCP、插件、Skill 是否为空,实际工具事件是否支持 Claude 的完成声明。
  3. 顾问模式引用的相对路径是否真实;公开研究模式的 URL 是否实际被 WebFetch。
  4. 候选修改模式的 selectedSourceIntegrity.ok、changes、candidateTypesSafe 和 patch 是否支持该候选结果。
  5. status 的含义:completed 仅代表结果返回;pending_review 等待当前 Codex 验收;rejected 或 failed 不得应用。

ok: true 不等于内容正确。Claude 说“已打开网页”“已修改文件”都不是证据;工具事件、文件哈希、精确 diff 和退出码才是证据。

应用候选修改

用户原任务已经明确授权修改时,当前 Codex 在验收 patch 后,可用自己的正常文件编辑流程把合格修改应用到正式项目并再次验证;候选代码绝不由 Bridge 自动运行。

不要让 Claude 直接碰正式项目,也不要自动套用未经审阅的全部候选改动。若候选偏离任务,丢弃临时目录并重新缩小交办。

固定边界

  • 不传 API Key;只使用本机 Claude Code 已有登录。认证或额度失败时停止,不改走其他付费渠道。
  • 不开放通用 Bash、MCP、插件、后台代理、Slash Commands 或 Chrome,并开启 Claude Code 安全模式与子进程凭据清洗。
  • 禁用任务文本中的 @路径 附件展开、Claude 自动记忆和项目 CLAUDE.md 自动加载。
  • 本地文件工具只允许候选工作区内的项目相对路径,并对每个工具事件再做一次越界审计;出现越界、意外工具、缺失初始化事件或权限拒绝即失败关闭。
  • 不处理浏览器 Cookie、登录态页面、私人聊天、支付、投放、消息发送、表单提交或生产操作。
  • 公开研究与本地文件不在同一次 Claude 会话组合,避免本地内容被网页提示注入带出。
  • 候选修改模式只生成候选副本;真实外部副作用始终由当前 Codex 按用户授权另行执行。
  • 不并行恢复同一个 Claude session,避免消息串线。
  • 如果返回 session_locked,不得清理对应运行目录;等待占用者结束后再续接。
  • 使用 Teams/Enterprise 组织账号时,托管 Hook 可能高于 CLI 权限运行,不能把“没有 Bash 工具”误报为“系统绝无外部命令”;高敏感任务先确认组织策略或改用隔离环境。

完成输出

最终给用户说明:

  • Claude 使用了哪一种模式。
  • Claude 实际调用了哪些工具或修改了哪些候选文件。
  • 当前 Codex 做了哪些独立核验。
  • 结果是否已经应用到正式项目;若没有,明确说仍是候选结果。

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.