2.8 KiB
Model steering (experimental)
Model steering lets you provide real-time guidance and feedback to Gemini CLI while it is actively executing a task. This allows you to correct course, add missing context, or skip unnecessary steps without having to stop and restart the agent.
Note: This is a preview feature currently under active development. It is only available on the preview channel.
Model steering is particularly useful during complex Plan Mode workflows or long-running subagent executions where you want to ensure the agent stays on the right track.
Enabling model steering
Model steering is an experimental feature and is disabled by default. You can
enable it using the /settings command or by updating your settings.json
file.
- Type
/settingsin the Gemini CLI. - Search for Model Steering.
- Set the value to true.
Alternatively, add the following to your settings.json:
{
"experimental": {
"modelSteering": true
}
}
Using model steering
When model steering is enabled, Gemini CLI treats any text you type while the agent is working as a steering hint.
- Start a task (for example, "Refactor the database service").
- While the agent is working (the spinner is visible), type your feedback in the input box.
- Press Enter.
Gemini CLI acknowledges your hint with a brief message and injects it directly into the model's context for the very next turn. The model then re-evaluates its current plan and adjusts its actions accordingly.
Common use cases
You can use steering hints to guide the model in several ways:
- Correcting a path: "Actually, the utilities are in
src/common/utils." - Skipping a step: "Skip the unit tests for now and just focus on the implementation."
- Adding context: "The
Usertype is defined inpackages/core/types.ts." - Redirecting the effort: "Stop searching the codebase and start drafting the plan now."
- Handling ambiguity: "Use the existing
Loggerclass instead of creating a new one."
How it works
When you submit a steering hint, Gemini CLI performs the following actions:
- Immediate acknowledgement: It uses a small, fast model to generate a one-sentence acknowledgment so you know your hint was received.
- Context injection: It prepends an internal instruction to your hint that
tells the main agent to:
- Re-evaluate the active plan.
- Classify the update (for example, as a new task or extra context).
- Apply minimal-diff changes to affected tasks.
- Real-time update: The hint is delivered to the agent at the beginning of its next turn, ensuring the most immediate course correction possible.
Next steps
- Tackle complex tasks with Plan Mode.
- Build custom Agent Skills.