Claude Code の Agent Teams 風機能を自作し Codex でも活用する試み A developer's attempt to recreate Claude Code's Agent Teams-like functionality on their ow…
- Claude Code の Agent Teams 機能に着想を得て、複数のサブエージェントを協調動作させる仕組みを自作する試みを紹介する記事。
- Codex CLI でも同等の機能を流用できるよう設計し、エージェント間連携の実装方法を探っている。
English summary
- A developer's attempt to recreate Claude Code's Agent Teams-like functionality on their own, designed so it can also be used with Codex CLI.
- The post explores how to coordinate multiple sub-agents and share the implementation across different AI coding tools.
Anthropic の Claude Code には、複数のサブエージェントを協調させて作業を分担させる Agent Teams 的な仕組みが備わっている。本記事の筆者は、その振る舞いに着想を得て、自分の手で同等の仕組みを構築し、さらに OpenAI の Codex CLI でも再利用できるようにしたいという動機を語っている。
背景として、Claude Code はプロジェクト内に置いた Markdown ファイルでサブエージェントを定義し、メインのエージェントが必要に応じて委譲する設計を持つ。これによりコンテキストを分離し、専門化したロールごとにタスクを処理できる利点がある。一方で Codex CLI などの他ツールには同様の組み込み機能が必ずしも揃っておらず、ツール横断で似た体験を得たいというニーズが存在する。
筆者のアプローチは、エージェント定義やプロンプトを共通フォーマットで保持し、それを各 CLI で読み込んで起動する薄いラッパーを設けるという方向性と見られる。実装の詳細としては、サブエージェントをサブプロセスや別セッションとして呼び出し、結果をオーケストレーター側に集約する設計が想定される。
Claude Code の Agent Teams 機能に着想を得て、複数のサブエージェントを協調動作させる仕組みを自作する試みを紹介する記事。
関連動向として、近年は Cursor、Cline、Aider、OpenAI Codex CLI など多数のエージェント型コーディング支援ツールが登場し、それぞれ独自のエージェント連携機構を備えつつある。Anthropic の Subagents 仕様や Model Context Protocol (MCP) のように、エージェントやツール接続の標準化を狙う動きも進んでおり、こうした共通基盤の上で「マルチエージェント編成を持ち運べる」という発想は今後広がる可能性がある。個人開発レベルの試行ではあるが、ベンダーロックインを避けつつワークフローを統一する実践例として参考になる内容と言える。
Anthropic's Claude Code includes an Agent Teams-style mechanism that lets multiple sub-agents collaborate on a task by dividing responsibilities. Inspired by this behavior, the author of this post sets out to build their own equivalent and, importantly, make it usable from OpenAI's Codex CLI as well.
For context, Claude Code lets developers define sub-agents via Markdown files placed in the project, which the main agent can delegate to as needed. This pattern is useful because it isolates context windows and lets each role specialize in a particular kind of task — for example, a reviewer agent, a test-writer agent, or a refactoring agent. Other CLI-based coding tools, including Codex CLI, do not necessarily ship with the same built-in orchestration, so there is a real demand for a portable approach that works across vendors.
The author's approach appears to involve keeping agent definitions and prompts in a shared, tool-agnostic format and then wrapping each CLI with a thin layer that loads those definitions and launches the underlying assistant. In practical terms, this likely means spawning sub-agents as subprocesses or separate sessions, capturing their output, and feeding it back into an orchestrator process that coordinates the overall task. The exact implementation details are still being explored, but the design intent is clearly to avoid duplicating agent specifications per tool.
A developer's attempt to recreate Claude Code's Agent Teams-like functionality on their own, designed so it can also be used with Codex CLI.
This effort sits within a broader trend in the agentic coding space. Tools such as Cursor, Cline, Aider, and Codex CLI have all been iterating on their own takes on agent">multi-agent or sub-agent workflows. At the same time, standardization efforts like Anthropic's Subagents specification and the Model Context Protocol (MCP) are pushing toward common interfaces for tool use and agent composition. If those standards mature, the idea of carrying a single agent">multi-agent setup across different coding assistants could become much more practical than it is today.
While this particular project is a personal experiment rather than a production-grade framework, it illustrates a meaningful pattern: developers want to shape their own agent workflows and reuse them regardless of which underlying model or CLI they happen to be using that day. As proprietary agent features proliferate, lightweight portability layers like this may serve as a useful hedge against vendor lock-in, and they hint at what a more interoperable agent ecosystem could look like.
本ページの本文・要約は AI による自動生成です。正確性は元記事 (zenn.dev) をご確認ください。