Feature request: model-callable EnterPlanMode / ExitPlanMode tools for safe mid-implementation replanning

Open 💬 0 comments Opened Jul 29, 2026 by dbc-hbin

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:

  • EnterPlanMode
  • ExitPlanMode

EnterPlanMode

  1. Callable by the main agent during implementation.
  2. Transitions only at a safe tool/turn boundary.
  3. Suspends source-code writes and enters the real Plan-mode permission state.
  4. Preserves the implementation context and completed valid work.
  5. Makes the transition clearly visible in CLI, App, and IDE clients.
  6. Allows repository inspection and clarification questions.

ExitPlanMode

  1. Presents the revised plan to the user.
  2. Requires explicit user approval before restoring write permissions.
  3. Lets the user keep planning or return to the previous execution mode.
  4. Preserves manual /plan and 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_plan should remain progress tracking and not be conflated with collaboration or permission mode.

Acceptance scenario

  1. Codex begins implementing an approved plan.
  2. Repository evidence disproves a core architectural assumption.
  3. Codex calls EnterPlanMode.
  4. Source writes become unavailable.
  5. Codex investigates, asks questions if necessary, and proposes a revised plan.
  6. The user approves through ExitPlanMode.
  7. 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.

View original on GitHub ↗