How It Works
-
Toggle to Plan Mode: Press
Cmd+Shift+M(Mac) orCtrl+Shift+M(Windows/Linux), or use the mode switcher in the UI. -
Agent Writes Plan: In plan mode, all file edit tools (
file_edit_*) are restricted to only modify the plan file. The agent can still read any file in the workspace to gather context. -
Propose for Review: When ready, the agent calls
propose_planto present the plan in the chat UI with rendered markdown. - Edit Externally: Click the Edit button on the latest plan to open it in your preferred editor (nvim, VS Code, etc.). Your changes are automatically detected.
-
Iterate or Execute: Provide feedback in chat, or switch to Exec mode (
Cmd+Shift+M) to implement the plan.
External Edit Detection
When you edit the plan file externally and send a message, mux automatically detects the changes and informs the agent with a diff. This uses a timestamp-based polling approach:- State Tracking: When
propose_planruns, it records the plan file’s content and modification time. - Change Detection: Before each LLM query, mux checks if the file’s mtime has changed.
- Diff Injection: If modified, mux computes a diff and injects it into the context so the agent sees exactly what changed.
Plan File Location
Plans are stored in a dedicated directory under your Mux home:<workspace-name>includes the random suffix (e.g.feature-x7k2), so it’s globally unique with high probability.
ask_user_question (Plan Mode Only)
In plan mode, the agent may callask_user_question to ask up to 4 structured multiple-choice questions when it needs clarification before finalizing a plan.
What you’ll see:
- An inline “tool call card” in the chat with a small form (single-select or multi-select).
- An always-available Other option for free-form answers.
- Recommended: answer in the form and click Submit answers.
- Optional: you can also just type a normal chat message. This will cancel the pending
ask_user_questiontool call and your message will be sent as a regular chat message.
ask_user_questionis only registered for the agent in Plan Mode.- In Exec Mode, the agent cannot call
ask_user_question.
UI Features
Thepropose_plan tool call in chat includes:
- Rendered Markdown: View the plan with proper formatting.
- Edit Button: Opens the plan file in your external editor (latest plan only).
- Copy Button: Copy plan content to clipboard.
- Show Text/Markdown Toggle: Switch between rendered and raw views.
- Start Here: Replace chat history with this plan as context (useful for long sessions).