Plan Mode context should steer Codex to research facts and decisions before proposing a plan

Open 💬 0 comments Opened May 19, 2026 by 0xZoharHuang

Summary

Plan Mode should be context-engineered as a research-first planning mode, not just a mode that prevents edits and asks the model to write a plan.

For large engineering tasks, a good plan depends on first discovering repo facts, identifying non-discoverable decisions, and asking the user only for the choices that matter. Plan Mode should more consistently steer the agent into that workflow before it emits a final proposal.

Current behavior

In practice, Plan Mode can still produce plans too early. The agent may:

  • propose a plan before enough read-only exploration
  • miss existing interfaces, tests, or constraints that were discoverable from the repo
  • ask broad questions before inspecting likely sources of truth
  • fail to distinguish repo facts from user preferences
  • use request_user_input too late or not at all for high-impact tradeoffs
  • produce a plan that looks structured but is not decision-complete

This is especially visible in large codebases, where an implementation-ready plan must be grounded in actual files, existing architecture, and current test/validation paths.

Expected behavior

Plan Mode should steer the agent toward a stable sequence:

1. Explore first: inspect relevant files, configs, docs, tests, and entrypoints without mutating state.
2. Separate facts from preferences: answer discoverable questions from the environment; ask only for non-discoverable decisions.
3. Use structured questions for high-impact tradeoffs when needed.
4. Produce a plan only after the important facts and decisions are stable.
5. Mark assumptions and defaults explicitly when proceeding without an answer.

This does not require Plan Mode to always use subagents or always ask questions. The main request is stronger mode-specific context engineering so the agent behaves like a careful planner by default.

Why this matters

Plan Mode is most valuable for work that is too risky to start immediately. In those cases, the plan should be the output of investigation, not a substitute for investigation.

A weak Plan Mode failure looks like:

complex request -> plausible plan -> user rejects -> more plausible plan -> implementation still blocked by unverified assumptions

The desired behavior is:

complex request -> read-only audit -> decision questions -> decision-complete plan -> implementation can start without the next agent making new choices

This would also reduce repeated plan churn and make approved plans more useful as handoff artifacts.

Related issues

Related but not identical:

  • #18611: improve Plan Mode decision prompts with richer context
  • #22099: parallel-first subagents and background task management
  • #23164: Plan Mode can fail to call the question asking tool despite needing answers
  • #11321: Plan Mode asks redundant questions
  • #10561: Copy Plan / clear context and start coding workflow

This issue focuses on Plan Mode's prompt/context policy: facts first, decisions second, plan last.

View original on GitHub ↗