Skip to content

feat: plan mode — model proposes a plan before executing any tools #21

@VforVitorio

Description

@VforVitorio

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:
    1. Ask the model to produce a numbered plan (no tool execution yet)
    2. Print the plan, prompt user for confirmation
    3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    Status

    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions