Skip to content

Choosing the Right Mode: Agent vs. Ask

You ask the AI a quick question about your Express payment handler — “why does processPayment sometimes double-charge?” — and thirty seconds later it has silently rewritten four files, changed the Stripe idempotency logic, and edited a migration you never wanted touched. Now you are reviewing a diff you didn’t ask for, on a critical path, under time pressure.

That failure mode is almost always a mode problem, not a model problem. The AI was in execution mode when it should have been read-only. Every modern coding tool exposes this split — read-only exploration versus read-write execution — and using the wrong one is the single fastest way to turn a five-minute question into an hour of cleanup.

  • A two-phase workflow (explore read-only, then execute) that keeps AI from editing files you never agreed to touch
  • The exact toggle, flag, or approval policy for read-only vs. execution mode in Cursor, Claude Code, and Codex
  • A copy-paste exploration prompt that produces a reviewable refactor plan without changing a single line
  • A scoped execution prompt that limits the AI to one step at a time, with a checkpoint before it continues
  • The failure modes to watch for when execution mode runs ahead of your review

Think of these as two stances you take with your AI partner. Every tool implements them differently, but the distinction is universal.

Read-Only: The Explorer

Purpose: Learning, planning, and questioning.

The AI searches your codebase, reads files, traces call sites, and answers questions — but it cannot edit anything or run mutating commands. This is Cursor’s Ask mode, Claude Code’s plan mode, and Codex’s read-only sandbox. Use it to build a shared, accurate understanding before any code changes.

Read-Write: The Implementer

Purpose: Execution, refactoring, and action.

The AI edits files, runs commands, and fixes errors to carry out an approved plan. This is Cursor’s Agent mode, Claude Code’s default / accept-edits modes, and Codex’s --full-auto or workspace-write sandbox. Use it only once you have a plan you trust.

The Strategic Workflow: Explore, Then Execute

Section titled “The Strategic Workflow: Explore, Then Execute”

The reliable pattern is to start read-only to understand and plan, review that plan, and only then switch to execution mode for one scoped step at a time. Here is the same workflow in each tool.

Open the chat pane and use the mode dropdown at the bottom of the input box to select Ask. Cursor will read files and answer but never edit. @-mention the handler (@src/routes/payments.ts) so it has precise context, run your exploration prompt, then review the plan it produces.

When the plan looks right, switch the dropdown to Agent and paste your scoped execution prompt. Cursor creates a checkpoint before each set of edits, so you can roll back to any prior state if a step goes wrong, and you accept or reject each diff per hunk.

Run this in read-only mode (Cursor Ask, Claude Code plan mode, or codex --sandbox read-only). It forces a plan without any edits.

Once the plan is reviewed, switch to execution mode and constrain the AI to a single step with a hard stop.

Even with the right mode, this workflow has predictable failure points:

  • Agent runs ahead of an unreviewed plan. If you skip the read-only phase, the AI executes against its own assumptions. Always review the plan as a discrete artifact before switching modes.
  • Cursor Agent edits files you didn’t intend. A vague prompt in Agent mode invites scope creep. Name the files in your prompt, and use checkpoints to roll back if it wanders. Reject hunks that touch anything off-plan.
  • Codex --full-auto touches production config. The workspace-write sandbox can edit any file in the repo, including .env or deploy manifests. Keep secrets out of the workspace, and drop to --ask-for-approval untrusted on sensitive repos.
  • Plan mode hands you a plan that’s subtly wrong. Read-only mode doesn’t make the plan correct — it makes it reviewable. The self-review prompt above is your second line of defense before any code lands.