|
| 1 | +# Use Plan Mode with model steering for complex tasks |
| 2 | + |
| 3 | +Architecting a complex solution requires precision. By combining Plan Mode's |
| 4 | +structured environment with model steering's real-time feedback, you can guide |
| 5 | +Gemini CLI through the research and design phases to ensure the final |
| 6 | +implementation plan is exactly what you need. |
| 7 | + |
| 8 | +> **Note:** This is a preview feature under active development. Preview features |
| 9 | +> may only be available in the **Preview** channel or may need to be enabled |
| 10 | +> under `/settings`. |
| 11 | +
|
| 12 | +## Prerequisites |
| 13 | + |
| 14 | +- Gemini CLI installed and authenticated. |
| 15 | +- [Plan Mode](../plan-mode.md) enabled in your settings. |
| 16 | +- [Model steering](../model-steering.md) enabled in your settings. |
| 17 | + |
| 18 | +## Why combine Plan Mode and model steering? |
| 19 | + |
| 20 | +[Plan Mode](../plan-mode.md) typically follows a linear path: research, propose, |
| 21 | +and draft. Adding model steering lets you: |
| 22 | + |
| 23 | +1. **Direct the research:** Correct the agent if it's looking in the wrong |
| 24 | + directory or missing a key dependency. |
| 25 | +2. **Iterate mid-draft:** Suggest a different architectural pattern while the |
| 26 | + agent is still writing the plan. |
| 27 | +3. **Speed up the loop:** Avoid waiting for a full research turn to finish |
| 28 | + before providing critical context. |
| 29 | + |
| 30 | +## Step 1: Start a complex task |
| 31 | + |
| 32 | +Enter Plan Mode and start a task that requires research. |
| 33 | + |
| 34 | +**Prompt:** `/plan I want to implement a new notification service using Redis.` |
| 35 | + |
| 36 | +Gemini CLI enters Plan Mode and starts researching your existing codebase to |
| 37 | +identify where the new service should live. |
| 38 | + |
| 39 | +## Step 2: Steer the research phase |
| 40 | + |
| 41 | +As you see the agent calling tools like `list_directory` or `grep_search`, you |
| 42 | +might realize it's missing the relevant context. |
| 43 | + |
| 44 | +**Action:** While the spinner is active, type your hint: |
| 45 | +`"Don't forget to check packages/common/queues for the existing Redis config."` |
| 46 | + |
| 47 | +**Result:** Gemini CLI acknowledges your hint and immediately incorporates it |
| 48 | +into its research. You'll see it start exploring the directory you suggested in |
| 49 | +its very next turn. |
| 50 | + |
| 51 | +## Step 3: Refine the design mid-turn |
| 52 | + |
| 53 | +After research, the agent starts drafting the implementation plan. If you notice |
| 54 | +it's proposing a design that doesn't align with your goals, steer it. |
| 55 | + |
| 56 | +**Action:** Type: |
| 57 | +`"Actually, let's use a Publisher/Subscriber pattern instead of a simple queue for this service."` |
| 58 | + |
| 59 | +**Result:** The agent stops drafting the current version of the plan, |
| 60 | +re-evaluates the design based on your feedback, and starts a new draft that uses |
| 61 | +the Pub/Sub pattern. |
| 62 | + |
| 63 | +## Step 4: Approve and implement |
| 64 | + |
| 65 | +Once the agent has used your hints to craft the perfect plan, review the final |
| 66 | +`.md` file. |
| 67 | + |
| 68 | +**Action:** Type: `"Looks perfect. Let's start the implementation."` |
| 69 | + |
| 70 | +Gemini CLI exits Plan Mode and transitions to the implementation phase. Because |
| 71 | +the plan was refined in real-time with your feedback, the agent can now execute |
| 72 | +each step with higher confidence and fewer errors. |
| 73 | + |
| 74 | +## Tips for effective steering |
| 75 | + |
| 76 | +- **Be specific:** Instead of "do it differently," try "use the existing |
| 77 | + `Logger` class in `src/utils`." |
| 78 | +- **Steer early:** Providing feedback during the research phase is more |
| 79 | + efficient than waiting for the final plan to be drafted. |
| 80 | +- **Use for context:** Steering is a great way to provide knowledge that might |
| 81 | + not be obvious from reading the code (e.g., "We are planning to deprecate this |
| 82 | + module next month"). |
| 83 | + |
| 84 | +## Next steps |
| 85 | + |
| 86 | +- Explore [Agent Skills](../skills.md) to add specialized expertise to your |
| 87 | + planning turns. |
| 88 | +- See the [Model steering reference](../model-steering.md) for technical |
| 89 | + details. |
0 commit comments