Feature Request: Native Subagent System (spawn_subagents / chain_subagents)

Resolved 💬 2 comments Opened Jan 2, 2026 by elchapita43 Closed Jan 2, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

Summary

I've implemented a native subagent system for Codex CLI that allows the main agent to delegate tasks to parallel workers with isolated context windows.

Problem

Currently, when Codex needs to explore a codebase, it fills its own context window with raw file contents. This leads to:

  • Context exhaustion during exploration
  • Need for aggressive auto-compaction
  • Loss of important details when compacting

Issue #2604 (219+ upvotes) requests this feature.

Solution Implemented

I built a working implementation with:

  • spawn_subagents: Parallel execution (up to 24 agents)
  • chain_subagents: Sequential execution with {{previous_output}} templating
  • Context isolation per subagent
  • Read-only "explore" mode with restricted tools
  • Hardcoded gpt-5.1-codex-mini for subagents
  • Transcript persistence for resume capability

Implementation

Request

Would the team be interested in reviewing this for potential merge? Happy to adapt the implementation to fit your roadmap and coding standards.

View original on GitHub ↗

2 Comments

github-actions[bot] contributor · 7 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #6611

Powered by Codex Action

etraut-openai contributor · 7 months ago

Thanks for the suggestion. We're already tracking this feature in https://github.com/openai/codex/issues/2604, which has received many upvotes. We generally prioritize features based on upvotes, so please add yours to #2604 if you haven't already done so.