60 XP · 9 min
Sandbox replay

Plan Mode

Watch the agent plan a multi-file change before touching anything. The plan is the artifact — review it like a PR description.

Sandbox transcript · canned, illustrative
user
Plan: refactor src/auth/* to extract a useSession() hook. Don't change behavior. List the files you'd touch.
assistant
I'll read the current auth layout first so the plan is grounded.
tool
tool: Glob · src/auth/**/*.{ts,tsx}
Found 7 files: AuthProvider.tsx, SessionContext.tsx, login.tsx, signup.tsx, hooks.ts, utils.ts, types.ts
tool
tool: Read · src/auth/SessionContext.tsx
(file content)
tool
tool: Read · src/auth/hooks.ts
(file content)
assistant
Plan: 1. Add `useSession()` in src/auth/hooks.ts that wraps `useContext(SessionContext)`. 2. Replace direct `useContext(SessionContext)` calls in login.tsx and signup.tsx with `useSession()`. 3. Leave AuthProvider.tsx untouched. 4. Update src/auth/index.ts barrel to export useSession. 5. No type changes; the hook returns the existing Session type from types.ts. No files edited yet. Approve to execute.
user
Looks good. Execute.
tool
tool: Edit · src/auth/hooks.ts
+ export function useSession() { return useContext(SessionContext); }
tool
tool: Edit · src/auth/login.tsx
- const session = useContext(SessionContext) + const session = useSession()
tool
tool: Edit · src/auth/signup.tsx
- const session = useContext(SessionContext) + const session = useSession()
tool
tool: Edit · src/auth/index.ts
+ export { useSession } from './hooks'
assistant
Done. 4 files edited as planned, no behavior changes. Want me to run the tests?
Check your understanding
Q1.What's the point of plan mode?
· Score 100% on the quiz.