Skip to content

When to Use Agent vs Ask Mode

Agent vs Ask mode is the choice between two stances toward an AI coding tool — read-only analysis and read-write execution — with a third, unattended tier beyond them. Cursor calls the first two Ask and Agent, Claude Code calls them plan and normal mode, Codex calls them read-only and workspace-write sandboxes. Picking the wrong point wastes context or ships unreviewed edits.

You ask a quick question about your Express payment handler — “why does processPayment sometimes double-charge?” — and thirty seconds later the agent 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 did not ask for, on a critical path, under time pressure.

The same mistake costs you the other way round. Open the tool in its default agent mode to ask “how does payment processing work here?” and it starts reading files and running greps, burning 40,000 tokens of context before producing a three-sentence answer you could have had for a fraction of that.

Both are mode problems, not model problems. Every modern coding tool exposes the same spectrum — read-only exploration, guided execution, unattended autonomy — and using the wrong point on it is the fastest way to turn a five-minute question into an hour of cleanup.

  • A clear mapping of the three modes across Cursor, Claude Code, and Codex
  • The exact toggle, flag, or approval policy for each one
  • A two-phase workflow (explore read-only, then execute) that stops the agent editing files you never agreed to touch
  • A copy-paste exploration prompt that produces a reviewable refactor plan without changing a line
  • A scoped execution prompt that limits the agent to one step, with a hard stop before it continues
  • Decision criteria for when autonomy is safe, and the failure modes when it is not

Two stances do most of the work. Read-only is the explorer: the agent searches the codebase, reads files, traces call sites, and answers questions, but cannot edit anything or run mutating commands. Use it to build an accurate shared understanding before any code changes. Read-write is the implementer: the agent edits files, runs commands, and fixes errors to carry out a plan you have already approved. Beyond them sits a third tier — unattended execution — which is worth its own decision rather than being treated as “agent mode with fewer prompts”.

CapabilityCursorClaude CodeCodex
Read-only analysisAsk mode (or Plan mode to draft a plan)Plan Mode (Shift+Tab)--sandbox read-only -c approval_policy=on-request
Guided executionAgent mode (default)Normal Mode (default)--sandbox workspace-write -c approval_policy=on-request
Unattended, sandboxed executionAuto-Run “Run Everything” / Cloud Agent--dangerously-skip-permissions / Sandbox--sandbox workspace-write -c approval_policy=never (trusted runs only)

Use this when you want to understand code without modifying it. The agent reads files and answers questions but cannot make changes.

Select Ask in the mode dropdown at the bottom of the chat input. The agent will analyze code and answer questions without making changes. @-mention the files you care about (@src/routes/payments.ts) so it starts from precise context. For investigations that should end in a written plan rather than edits, Plan mode is the sibling to reach for:

How does the authentication flow work? Trace the request from
the login endpoint through middleware to the session store.
Show me the key files and functions involved.

Ask mode is token-efficient because the agent focuses on answering your question rather than exploring broadly. It uses the codebase index for retrieval rather than reading files one by one.

Best for: Code review, architecture analysis, onboarding to a new codebase, understanding unfamiliar code, investigating bugs before fixing them.

The default mode for all three tools. The agent reads files, makes changes, and runs commands, but asks for permission at key points. This is the workhorse mode for most development tasks.

Agent mode is the default. Cursor reads files, proposes edits, and runs terminal commands, writing a checkpoint before each set of edits so a bad step is a rollback rather than a repair job. Review in the diff view and accept or reject per hunk — bulk-accepting is how off-plan edits get in:

Implement the rate limiter middleware following the pattern in
@src/middleware/auth.ts. Write tests in @src/middleware/__tests__/.
Run the tests after implementation.

Configure which tools the agent can use in Cursor Settings. You can allow file edits but require approval for terminal commands, or vice versa.

Best for: Feature implementation, bug fixes, refactoring, test writing, most day-to-day development work.

The agent runs without interruption. Powerful for well-defined, low-risk tasks; dangerous for anything touching sensitive code.

Auto-Run set to Run Everything (informally called YOLO mode) auto-accepts all changes and commands. Cloud Agent runs tasks asynchronously in an isolated cloud environment:

Fix all ESLint warnings in src/components/. Run npm run lint
after each fix to verify. Commit each fix separately with a
descriptive message.

Cloud Agent is the safer option for autonomous work: it runs on a clone of your repo, so your local working directory stays untouched until you review and merge. Cursor’s own security guidance says never to use Run Everything, because it skips all safety checks.

Best for: Lint fixes, formatting, bulk renames, documentation generation, test boilerplate, migration scripts across many files.

The mechanics differ per tool; the discipline does not. Start read-only to understand and plan, review that plan as a discrete artifact, and only then switch to execution for one scoped step at a time. Three prompts carry the whole pattern.

The first runs in read-only mode and forces a plan without a single edit:

The second runs after you have reviewed that plan. The hard stop at the end is the point: one step, then a report, then your decision.

The third closes the loop before you accept the diff. Read-only mode does not make a plan correct; it makes it reviewable, and this is the second line of defense:

Those three are the production-grade version of the pattern, written for one refactor. The prompt below is the same shape as a reusable session script — three phases in one place, with the mode switch called out between them, for when you are setting up the work rather than executing it:

  1. Are you trying to understand code, not change it? Use read-only/analysis mode.
  2. Is the task well-defined with clear verification? Use guided execution mode and let the agent work through the task with your periodic review.
  3. Is the task mechanical and low-risk? Consider full autonomy with appropriate isolation (cloud agent, sandbox, cloud thread).
  4. Is the task touching sensitive code? Use guided execution with per-file approval.
  5. Are you unsure? Start with guided execution. You can always loosen permissions mid-session; you cannot un-apply an edit you never saw.

Advanced teams use different modes simultaneously across multiple sessions.

Run a Cloud Agent on a lint-fix task (autonomous) while you use the main Agent for feature development (guided). Review the Cloud Agent’s changes when they are ready, without interrupting your feature work.

The autonomous half of that split needs its scope written down, because nobody is watching it:

  • The agent runs ahead of an unreviewed plan. Skip the read-only phase and it executes against its own assumptions. Review the plan as a discrete artifact before switching modes.
  • You stay in analysis mode too long. Thirty minutes of questions consumes the context the implementation needed. Time-box analysis to five or ten minutes, then switch.
  • You mix modes within a single prompt. “Analyze the auth module, then refactor it” forces an internal mode switch, and the agent usually skips the analysis and jumps to the refactor. Separate them into distinct prompts.
  • Agent mode edits files you did not intend. A vague prompt in execution mode invites scope creep. Name the files, use checkpoints to roll back, and reject hunks that touch anything off-plan.
  • The Codex workspace sandbox includes sensitive repo files. workspace-write can edit files such as .env or deploy manifests when they sit inside the workspace, and on-request does not prompt for every such edit. Keep secrets out of the workspace, and stay in read-only until the plan is reviewed on sensitive repositories.
  • Full autonomy on a task that needed judgment. Autonomy works where “correct” is mechanical and verifiable. API design, error-handling strategy, and performance work all produce better results in guided mode.
  • You forget to switch back. After an investigation in analysis mode, an agent that seems unresponsive to implementation requests is usually just still in read-only. Check the mode indicator before debugging the prompt.