Enhancement
Add a third mode, Ask, alongside the existing Build/Plan tabs — read-only Q&A about the codebase, with no expectation of producing a plan or making edits.
Current state
src/screens/repl.ts:247:
const tabs = new TabBar(["Build", "Plan"]);
Cycled with Tab/Shift+Tab (repl.ts:4367, 4382). Each tab has a distinct system prompt in src/agent/system-prompt.ts:136-141 (MODE_PROMPTS), plus tool-restriction logic in repl.ts around line 2992-2993 (planMode gates read-only tools + exit_plan_mode) and a D4 routing hint (task: planMode ? "plan" : undefined, repl.ts:3027-3028).
Plan mode is read-only but purpose-built to end in a plan: the model is instructed to call exit_plan_mode with a concrete plan, which on approval auto-switches the tab back to Build (repl.ts:1369-1375, 3306-3314). That's the wrong shape for someone who just wants to ask "what does this function do" or "why is X implemented this way" — they don't want a plan-approval handoff, they want a direct read-only answer and to stay put.
Why not just use Plan for this
Using Plan mode for a plain question forces the model toward producing a plan and calling exit_plan_mode (per its system prompt), and the D4 task: "plan" routing hint sends it through the plan-tuned cascade — mismatched for simple explanation/lookup questions. Right now users have to fall back to Build mode (with full edit tools available) just to ask something, which also risks the model making unrequested edits.
Suggested implementation
TabBar(["Build", "Plan", "Ask"]) (or reorder as preferred).
- New
MODE_PROMPTS["Ask"] in system-prompt.ts: read-only tools, answer directly, no plan/exit_plan_mode requirement — e.g. "Read-only Q&A. Explore with read-only tools and answer the question directly — no plan needed, no edits. If the question implies the user actually wants a change made, say so and suggest switching to Build (or Plan for anything nontrivial)."
- Extend the tool-restriction branch at
repl.ts:2992-2993 so Ask gets the same read-only tool set as Plan minus exit_plan_mode (it never needs to hand off).
- D4 task hint (
repl.ts:3027-3028): Ask should probably send task: "search" (closest existing D4 shape) rather than undefined, to get the same server-side routing benefit Plan already gets.
- Skip the Plan-specific auto-switch-to-Build logic (
repl.ts:3306-3314) for Ask — it just answers and stays on the Ask tab.
Non-goals
Not proposing changes to Plan's or Build's existing behavior — purely additive.
Enhancement
Add a third mode, Ask, alongside the existing Build/Plan tabs — read-only Q&A about the codebase, with no expectation of producing a plan or making edits.
Current state
src/screens/repl.ts:247:Cycled with
Tab/Shift+Tab(repl.ts:4367,4382). Each tab has a distinct system prompt insrc/agent/system-prompt.ts:136-141(MODE_PROMPTS), plus tool-restriction logic inrepl.tsaround line 2992-2993 (planModegates read-only tools +exit_plan_mode) and a D4 routing hint (task: planMode ? "plan" : undefined,repl.ts:3027-3028).Plan mode is read-only but purpose-built to end in a plan: the model is instructed to call
exit_plan_modewith a concrete plan, which on approval auto-switches the tab back to Build (repl.ts:1369-1375,3306-3314). That's the wrong shape for someone who just wants to ask "what does this function do" or "why is X implemented this way" — they don't want a plan-approval handoff, they want a direct read-only answer and to stay put.Why not just use Plan for this
Using Plan mode for a plain question forces the model toward producing a plan and calling
exit_plan_mode(per its system prompt), and the D4task: "plan"routing hint sends it through the plan-tuned cascade — mismatched for simple explanation/lookup questions. Right now users have to fall back to Build mode (with full edit tools available) just to ask something, which also risks the model making unrequested edits.Suggested implementation
TabBar(["Build", "Plan", "Ask"])(or reorder as preferred).MODE_PROMPTS["Ask"]insystem-prompt.ts: read-only tools, answer directly, no plan/exit_plan_moderequirement — e.g. "Read-only Q&A. Explore with read-only tools and answer the question directly — no plan needed, no edits. If the question implies the user actually wants a change made, say so and suggest switching to Build (or Plan for anything nontrivial)."repl.ts:2992-2993soAskgets the same read-only tool set asPlanminusexit_plan_mode(it never needs to hand off).repl.ts:3027-3028): Ask should probably sendtask: "search"(closest existing D4 shape) rather thanundefined, to get the same server-side routing benefit Plan already gets.repl.ts:3306-3314) for Ask — it just answers and stays on the Ask tab.Non-goals
Not proposing changes to Plan's or Build's existing behavior — purely additive.