What problem does this solve?
In auto mode the agent executes tools immediately without giving the user any visibility into what it plans to do. Users working on sensitive codebases want to approve the agent's plan before any files are touched.
Proposed solution
Add a plan mode — similar to Claude Code's plan mode. Before running any tools, the model produces a structured plan of steps it intends to take, then waits for user confirmation before proceeding.
User flow:
● lmcode (model) [plan] › refactor the auth module
lmcode plan:
1. read_file src/auth/core.py
2. read_file src/auth/models.py
3. write_file src/auth/core.py (refactored)
proceed? [y/n] › y
⠋ reading src/auth/core.py…
Implementation sketch:
- New mode
"plan" added to MODES cycle
- In
plan mode, _run_turn uses a two-phase prompt:
- Ask the model to produce a numbered plan (no tool execution yet)
- Print the plan, prompt user for confirmation
- On confirm, execute the full agentic loop with tools enabled
- Requires a separate
plan_system_prompt instructing the model to output a structured plan before acting
Relationship to other modes:
ask → confirm each individual tool call
auto → run all tools without asking
strict → no tools
plan → confirm the full plan upfront, then run auto
Alternatives considered
None considered.
What problem does this solve?
In
automode the agent executes tools immediately without giving the user any visibility into what it plans to do. Users working on sensitive codebases want to approve the agent's plan before any files are touched.Proposed solution
Add a
planmode — similar to Claude Code's plan mode. Before running any tools, the model produces a structured plan of steps it intends to take, then waits for user confirmation before proceeding.User flow:
Implementation sketch:
"plan"added toMODEScycleplanmode,_run_turnuses a two-phase prompt:plan_system_promptinstructing the model to output a structured plan before actingRelationship to other modes:
Alternatives considered
None considered.