ML.ai

Investigate and plan, with writing switched off

Edit and write tools are switched off, while tests and typecheckers still run. Review the plan, then switch to Build to make the change.

ML.ai

Explorer

src/auth/registration.tssession.tsvalidate.tsapi/search.tstests/registration.test.tssession.test.tspackage.jsontsconfig.json

Fix the registration validation bug and run the relevant tests.

plan.md

Fix registration validation

  1. 1.Reproduce: an empty email passes signupSchema
  2. 2.Tighten email and password rules in src/auth/validate.ts
  3. 3.Add empty, whitespace and short password cases to tests
  4. 4.Run pnpm test registration
Edit refused in Plan modeInvestigate and describe the fix instead: switch to Build to apply it.

Ask ML.ai...

Who Plan mode is for

Developers starting large changes who want to map the codebase, identify trade-offs, and produce a step-by-step plan before committing to any edits.

  • Anyone about to touch many files

    Map the codebase and get a step-by-step plan before any file is edited.

  • Teams weighing trade-offs

    Settle the choices up front so they do not resurface halfway through the build.

  • Reviewers who want small diffs

    Plan steps that each land as their own reviewable diff once you switch to Build.

How it works

The agent reads, searches and runs checks while edit and write tools stay off. You get a plan to review, and the repo stays as it is until you switch to Build.

A plan with files, steps and tests named up front

The agent reads the code the change touches, then writes the plan as numbered steps. Each step names the files involved and the test that proves it worked.

Proposed changes are described and never written to disk

Where a step needs code, the plan shows the lines it would add. Edit and write tools are denied for the turn, so those lines stay proposals until you move to Build.

Edit tools are denied, so the change waits for Build

If a Plan mode turn calls for an edit, the edit tool is denied and the agent describes the change instead. Switch the next turn to Build and it goes through a normal permission prompt.

Open decisions come back to you as clear options

When the plan forks, the agent lays out the options and the trade-offs of each. You pick one, and the rest of the plan is written around your choice.

What changes between Build and Plan mode

Build mode

Build mode has the full tool set, and every edit and command still goes through Allow, Always or Deny with the real diff in front of you.

Plan mode

Reading, search, tests and typecheckers stay on while edit and write tools are denied, so the turn ends with a plan and an untouched repo.

How to plan in one turn and build in the next

Mode applies to a single turn, so you can plan in one message and build in the next without starting a new conversation.

1Set the composer to PlanPick Plan in the mode switch and describe the change. For a deeper read-only pass, call architect with @ instead.
2Read the plan and push backAsk follow-up questions in Plan mode for as long as you need. Each reply refines the plan without touching a file.
3Switch the next turn to BuildChange the mode to Build and ask the agent to carry out the plan, one step at a time or all at once.
4Approve each edit as it landsEvery edit opens as a real diff with Allow, Always or Deny, so you can check each step against the plan you agreed.

Plan mode details that are easy to miss

A few details about how Plan mode behaves that are easy to miss the first time you use it.

Plans can drift from the real code

A plan written against last week’s code can miss a file that has changed since, and a step that looked safe on paper breaks as soon as someone starts typing.

How ML.ai handles it

The agent reads the current files and can run your tests and typecheckers while planning, so every step is grounded in how the repo behaves right now.

Long plans get lost in the chat

A ten-step plan buried in a long conversation is hard to hand to a teammate or to pick up again the next morning.

How ML.ai handles it

Call planSubAgent with @ and the plan is saved to a file you can commit, share, or split into separate pieces of work.

Mode only lasts for one turn

Because mode applies per turn, it is easy to assume you are still in Plan mode after switching to Build for a single change.

How ML.ai handles it

The mode chip in the composer shows the current mode for every message, and edits in Build still stop at an Allow, Always or Deny prompt before they land.

ML.ai Settings
GeneralModelsAgentsSkillsMCP serversPermissionsUsage

Auto routing

Each step goes to the model that fits it

Agents

Pick a subagent and it stays selected until you swap it. Only general carries out changes end to end.

@explore · Where is the refresh token rotated?

› Searched refreshToken · 14 matches

› Read src/auth/session.ts, src/auth/rotate.ts

› Answered · 0 files changed

@exploreAsk ML.ai... @ to delegate

AutoBuild

Agents

Use architect or planSubAgent for a deeper read-only pass that lists critical files, trade-offs and a step-by-step plan.

ML.ai

Explorer

app/auth/login.tssession.tsMrotate.tsapi/me.tsmiddleware.tstests/session.test.tspackage.json

Found the refresh path. Updating the session helper now.

GreprefreshToken · 6 matches in app/auth

Fs.readapp/auth/session.ts

Fs.writeapp/auth/session.tspending

app/auth/session.ts2 lines changedlines 42-50

42export async function refresh(token) {

43 if (!token) return null;

44 if (!token?.exp) throw new Error('expired');

45 return await rotate(token);

46}

47

48async function rotate(token) {

49 const next = await issue(token.sub);

50 return next;

Permission requiredFs.write app/auth/session.ts

Permission prompts

Once you switch to Build, every edit and command opens with a real diff and an Allow, Always or Deny choice.

FAQs

Can auto-approve widen Plan mode permissions?

No. Plan mode denies edit and write tools for the turn, whatever your approval settings. Shell commands still pass through the safety classifier, whose absolute refusals hold in every mode, auto-approve included.

How do I know a plan is ready for Build?

Every step should name the files it touches and the test that proves it. If not, ask the agent to fill the gaps while you are still in Plan mode.

Should I settle trade-offs before switching to Build?

Yes. Check which trade-offs the plan settled and whether you agree with each one, since a choice you skip tends to come back halfway through the build.

How big should each plan step be?

Small enough to land as its own reviewable diff, so each one is easy to approve once you switch the turn to Build.

Plan your next large change before writing a line

Map the files, weigh the trade-offs and agree on the steps in Plan mode, then switch to Build when the plan looks right.