Feature request: model-callable EnterPlanMode / ExitPlanMode tools for safe mid-implementation replanning
Problem
Codex supports a user-controlled Plan mode, but the main agent cannot enter the actual Plan mode by itself after implementation has started.
During implementation, live repository evidence can invalidate a core assumption, reveal a missing product decision, or prove that the selected approach is wrong. Codex can update a planning checklist, but update_plan does not switch the session into the real read-only Plan mode or change its permission state.
Today, reproducing this workflow requires a custom replanner subagent, AGENTS.md dispatch rules, and a PreToolUse hook. That works, but it adds configuration and still lacks a first-party collaboration-mode transition.
Requested behavior
Expose first-party, model-callable tools equivalent to:
EnterPlanModeExitPlanMode
EnterPlanMode
- Callable by the main agent during implementation.
- Transitions only at a safe tool/turn boundary.
- Suspends source-code writes and enters the real Plan-mode permission state.
- Preserves the implementation context and completed valid work.
- Makes the transition clearly visible in CLI, App, and IDE clients.
- Allows repository inspection and clarification questions.
ExitPlanMode
- Presents the revised plan to the user.
- Requires explicit user approval before restoring write permissions.
- Lets the user keep planning or return to the previous execution mode.
- Preserves manual
/planand Shift+Tab controls.
Safety model
- Entering Plan mode reduces permissions, so it should not require approval.
- Exiting Plan mode increases permissions, so it should require user approval.
- A transition must not interrupt a partially completed write operation.
update_planshould remain progress tracking and not be conflated with collaboration or permission mode.
Acceptance scenario
- Codex begins implementing an approved plan.
- Repository evidence disproves a core architectural assumption.
- Codex calls
EnterPlanMode. - Source writes become unavailable.
- Codex investigates, asks questions if necessary, and proposes a revised plan.
- The user approves through
ExitPlanMode. - Codex resumes implementation without losing completed valid work.
Motivation
This would make mid-implementation replanning a first-party, permission-safe workflow instead of something users need to recreate with custom agents and hooks.
Tested with Codex CLI 0.145.0.