codex icon indicating copy to clipboard operation
codex copied to clipboard

Feature Request: Add a plan Mode to Codex CLI

Open BobbyWang0120 opened this issue 3 months ago • 1 comments

What feature would you like to see?

I would like to request the addition of a plan mode in the Codex CLI, similar to the functionality provided in Claude Code.

Motivation

For AI-assisted coding, having a dedicated planning phase is extremely valuable. Instead of executing directly, the model should first gather information, perform research, and then propose a structured plan. The user can then review the plan, choose to approve or deny, and optionally provide feedback explaining why. The model should iterate on the plan until the user approves it, and only then proceed to execution.

Proposed Behavior 1. User switches Codex CLI into plan mode. 2. Codex generates a complete step-by-step plan. 3. User reviews the plan and either: • Approves (execution starts), or • Denies with feedback (Codex refines the plan). 4. Iteration continues until the plan is approved. 5. Codex executes the approved plan.

Benefits • Creates a clear separation between planning and execution. • Improves transparency and user control. • Reduces errors from premature execution. • Aligns Codex with emerging best practices for AI coding tools, where a planning stage is becoming a standard.

This feature would significantly improve the usability of Codex CLI for real development workflows.

Are you interested in implementing this feature?

No response

Additional information

No response

BobbyWang0120 avatar Sep 07 '25 09:09 BobbyWang0120

Duplicated of https://github.com/openai/codex/issues/2101

bernaferrari avatar Sep 07 '25 15:09 bernaferrari

Hi @bernaferrari thanks for marking this as a dupe.

Since there's so much interest in this feature any chance of reconsidering its priority?

cadamsdotcom avatar Sep 10 '25 01:09 cadamsdotcom

They know it is important and they are making it, but they have a very big todo list.

bernaferrari avatar Sep 10 '25 01:09 bernaferrari

@bernaferrari is this todo list or plan visible somewhere? I like to see if they are adding features like giveing me more control over each change codex does? like cursor or claude code

kargarisaac avatar Sep 14 '25 09:09 kargarisaac

No but just look at releases, they are almost daily.

bernaferrari avatar Sep 14 '25 15:09 bernaferrari

The behavior of Codex can be defined through a configuration file named AGENTS.md. You can set the Plan mode in the global configuration (~/.codex/AGENTS.md) or in the AGENTS.md file of the project root directory.

View the global memory of the project at claude.md
[CLAUDE.md](CLAUDE.md)

Enter Mode 1: PLAN(Simultaneous Display Mode)
Mode switching method
Input: :plan or :execute
plan->PLAN mode
:execute->EXECUTE mode
After switching, the current mode will be displayed. Do not perform any operations after the switch but wait for user input

### Mode 1: PLAN
** Objective ** : To create a detailed technical specification sheet before writing any code
** Thinking mode :**
- Systems thinking: Consider all affected components
Critical thinking: Verify and refine the feasibility of the plan
- Goal-oriented: Always focus on the original requirements
** Allowed :**
✅ detailed implementation plan (down to file path)
✅ specific function name and signature design
✅ clear instructions for modification
✅ complete architecture overview
"Prohibited:
❌ write any actual code
❌ provide "sample" code snippets
❌ skip or oversimplify the specification
"Output format:
[MODE: PLAN]
Implementation list
[Specific Operation 1: Modify line 45 of src/api/handler.js...]
2. [specific operation 2: create a new file SRC/utils/validator js...].
...
n. [Final Verification Steps]
After completing the plan, it is necessary to ask the user whether to switch to the EXECUTE mode.
---
### Mode 2: EXECUTE
** Objective ** : Strictly implement the approved plan
** Thinking mode :**
- Precise implementation: Code exactly as planned
- Continuous verification: The result must be confirmed at each step
- Timely feedback: Report any deviation immediately upon discovery
** Allowed :**
✅ only perform the operations specified in the plan
✅ marks completed list items
✅ minor adjustments (reasons required)
"Prohibited:
❌ silent deviation from plan
❌ add unplanned features
❌ Major logical modification (return PLAN required)
** Execution Agreement :**
1. Complete the list item by item
2. Report any necessary adjustments
3. Update the task progress
项目的全局记忆查看claude.md
[CLAUDE.md](CLAUDE.md)

进入到Mode 1: PLAN(同时显示模式)
### 模式切换方式
输入::plan 或者 :execute
:plan->PLAN模式
:execute->EXECUTE模式
切换后显示当前模式,切换后不要进行任何操作,而是等待用户输入

### Mode 1: PLAN
**目的:** 在写任何代码前,创建详细的技术规格书
**思维模式:**
- 系统思维:考虑所有受影响的组件
- 批判思维:验证和完善计划的可行性
- 目标导向:始终围绕原始需求
**允许:**
✅ 详细的实施计划(精确到文件路径)
✅ 具体的函数名和签名设计
✅ 明确的修改说明
✅ 完整的架构概览
**禁止:**
❌ 编写任何实际代码
❌ 提供"示例"代码片段
❌ 跳过或过度简化规格说明
**输出格式:**
[MODE: PLAN]
实施清单:
1. [具体操作1:修改 src/api/handler.js 第45行...]
2. [具体操作2:创建新文件 src/utils/validator.js...]
...
n. [最终验证步骤]
完成计划后需要询问用户是否切换到 EXECUTE 模式。
---
### Mode 2: EXECUTE
**目的:** 严格执行已批准的计划
**思维模式:**
- 精确实施:完全按计划编码
- 持续验证:每步都要确认结果
- 及时反馈:发现偏差立即报告
**允许:**
✅ 只执行计划中明确的操作
✅ 标记已完成的清单项
✅ 微小调整(需说明理由)
**禁止:**
❌ 静默偏离计划
❌ 添加计划外的功能
❌ 重大逻辑修改(需返回 PLAN)
**执行协议:**
1. 逐项完成清单
2. 报告任何必要的调整
3. 更新任务进度

viaco2ove avatar Sep 19 '25 01:09 viaco2ove

I proposed a potential high-level architectural plan that outlines how to implement this in my issue #4897 . Feedback is appreciated.

coygeek avatar Oct 08 '25 03:10 coygeek