AI Skills AI技能 8h ago Updated 2h ago 更新于 2小时前 42

Codex Plugin for Claude Code: Choose, Install, and Run a Reliable Two-Agent Workflow Claude Code 的 Codex 插件:选择、安装并运行可靠的双智能体工作流

The codex-plugin-cc is OpenAI's official plugin enabling Codex to operate as a guest agent within Claude Code, supporting review loops, task delegation, and session transfer Host selection is critical: Claude Code as host uses OpenAI's plugin path, while Codex as host uses Sendbird's reverse plugin—commands and marketplace registries differ and are not interchangeable Project configuration requires separating user-level settings (~/.codex/config.toml) from trusted-project overrides (.codex/confi Codex插件与Claude Code集成解决双Agent协作中的"主机选择"问题,需明确指定哪个终端作为主控方 官方路径通过四个斜杠命令完成安装:/plugin marketplace add、/plugin install、/reload-plugins、/codex:setup 配置需区分用户级(~/.codex/config.toml)和项目级(.codex/config.toml),后者需信任目录才能生效 共享指令文件策略推荐AGENTS.md作为单一真相源,CLAUDE.md作为指针或工具特定补充 模型配置需关注时效性,model和model_reasoning_effort等键值

58
Hot 热度
68
Quality 质量
55
Impact 影响力

Analysis 深度分析

TL;DR

  • The codex-plugin-cc is OpenAI's official plugin enabling Codex to operate as a guest agent within Claude Code, supporting review loops, task delegation, and session transfer
  • Host selection is critical: Claude Code as host uses OpenAI's plugin path, while Codex as host uses Sendbird's reverse plugin—commands and marketplace registries differ and are not interchangeable
  • Project configuration requires separating user-level settings (~/.codex/config.toml) from trusted-project overrides (.codex/config.toml), with trust flags controlling whether local overrides load
  • Shared instruction files (AGENTS.md and CLAUDE.md) must be synchronized via symlinks or a pointer strategy to prevent agent drift on conventions, lint rules, and test commands
  • Approval policies and sandbox modes (untrusted/workspace-write vs danger-full-access) must be matched to task risk level, with model reasoning effort treated as a token-cost decision rather than a free quality boost

Why It Matters

This article addresses a growing operational pattern in AI-assisted development: running multiple LLM agents in concert on the same codebase. As practitioners adopt dual-agent workflows, the lack of clear host/guest boundaries and instruction synchronization leads to wasted time, configuration drift, and conflicting code conventions. Understanding the wiring mechanics prevents setup failures and enables scalable multi-agent collaboration.

Technical Details

  • Plugin installation: Four slash commands in Claude Code—/plugin marketplace add openai/codex-plugin-cc, /plugin install codex@openai-codex, /reload-plugins, /codex:setup—with Node.js 18.18+ required and separate authentication for both ChatGPT/Codex and Claude Code
  • Reverse path: Sendbird's cc-plugin-codex inverts the relationship, running Claude Code as a guest inside Codex via codex plugin marketplace add sendbird/codex-marketplace and codex plugin add cc@sendbird, with idempotent setup through npx cc-plugin-codex install
  • Configuration hierarchy: User defaults in ~/.codex/config.toml apply globally; trusted-project overrides in .codex/config.toml at the repo root only load when the directory is marked trusted, with keys like model, model_reasoning_effort, approval_policy, and sandbox_mode
  • Instruction file strategy: AGENTS.md serves as Codex's project doc; CLAUDE.md serves Claude Code's. Recommended patterns include symlinking (ln -s AGENTS.md CLAUDE.md) for identical rules or maintaining a pointer in CLAUDE.md with tool-specific additions kept separate
  • Sandbox and approval controls: approval_policy values include untrusted and on-request; sandbox_mode includes read-only, workspace-write, and danger-full-access; CLI flags --auto-edit and --full-auto further control prompting behavior independently of config

Industry Insight

  • Multi-agent coding workflows will become standard, but the host/guest architecture decision must be made before installation—mixing plugin paths creates silent failures that waste debugging time
  • Instruction file synchronization is the hidden bottleneck in multi-agent projects; teams should adopt a single-source-of-truth policy (symlink or pointer) as a project onboarding requirement, not an afterthought
  • Token-cost awareness around model_reasoning_effort settings will become a cost-optimization lever as multi-agent loops scale; leaving high reasoning effort on by default across review cycles can significantly inflate API spend

TL;DR

  • Codex插件与Claude Code集成解决双Agent协作中的"主机选择"问题,需明确指定哪个终端作为主控方
  • 官方路径通过四个斜杠命令完成安装:/plugin marketplace add、/plugin install、/reload-plugins、/codex:setup
  • 配置需区分用户级(~/.codex/config.toml)和项目级(.codex/config.toml),后者需信任目录才能生效
  • 共享指令文件策略推荐AGENTS.md作为单一真相源,CLAUDE.md作为指针或工具特定补充
  • 模型配置需关注时效性,model和model_reasoning_effort等键值会随文档更新而变化

为什么值得看

本文提供了多Agent协作场景下的实用集成方案,解决了开发者在双终端环境中手动传递指令的低效问题。对于正在探索AI编程助手组合使用的团队,提供了可落地的配置指南和最佳实践。

技术解析

  • 双路径架构:官方路径(Codex inside Claude Code)使用OpenAI的codex-plugin-cc,反向路径(Claude inside Codex)使用Sendbird的cc-plugin-codex,两者命令体系和插件市场完全隔离
  • 安装依赖:需Node.js 18.18+、已认证的Codex CLI、ChatGPT订阅或OpenAI API Key,以及Claude Code的Anthropic API Key,两个产品独立计费
  • 配置分层:用户级配置在~/.codex/config.toml全局生效,项目级配置在仓库根目录.codex/config.toml需信任目录才加载,实现安全边界
  • 指令文件策略:AGENTS.md为Codex读取的项目规则文件,CLAUDE.md为Claude Code对应文件,推荐 symlink 或指针方式保持同步
  • 审批与沙盒:approval_policy控制交互提示时机,sandbox_mode控制文件访问权限,workspace-write适合常规开发,danger-full-access仅限可信本地脚本

行业启示

  • 多Agent协作需明确"主机-从机"关系而非对等并行,避免命令冲突和配置混乱,这是工具链整合的首要决策点
  • 项目级配置信任机制成为安全边界,区分全局默认与项目特定设置,反映AI工具向企业级工作流渗透的配置治理需求
  • 指令文件单一真相源策略降低维护成本,但需权衡工具特定指令的隔离需求,体现AI编程助手生态标准化趋势

Disclaimer: The above content is generated by AI and is for reference only. 免责声明:以上内容由 AI 生成,仅供参考。

Claude Claude Agent Agent Code Generation 代码生成 LLM 大模型 Programming 编程