DEV Community

Cover image for Unlocking Gemini CLI with Skills, Hooks & Plan Mode
Greg Baugues for Google AI

Posted on • Originally published at x.com

Unlocking Gemini CLI with Skills, Hooks & Plan Mode

In Unlocking Gemini CLI with Skills, Hooks & Plan Mode, we moved past the basics and into the "power user" features of Gemini CLI.

I was joined by Jack Wotherspoon from the Gemini CLI team to show how developers can exert more control over their AI agents and handle complex, multi-step projects with confidence.
From a 20-minute app build to the introduction of a "read-only" research mode, this episode was packed with tools designed to bridge the gap between AI autonomy and developer intent.

The 20-minute build: From idea to deployment

 

To set the stage, Jack showcased Memory Wall, a digital bulletin board built using React, Three.js, and Firebase. The kicker? It took only 20 minutes to go from a blank slate to a live-deployed application.

This served as the playground for the day's deep dives:

1. Deterministic control with hooks

One of the biggest hurdles with AI agents is their non-deterministic nature. Hooks change that. They are scripts that run at specific lifecycle points—like at session start or before a tool call.


 
  • The "dev server" hook: Jack demonstrated a hook that checks if a local dev server is running on startup. If not, Gemini CLI alerts the user and offers to start it.
  • Safety first: You can use hooks to run linters or "security guards" that prevent the AI from writing messy code or deleting sensitive files.

Pro tip: Use the new Background Tasks feature (Control + B) to keep your dev servers running in the terminal without blocking your conversation with Gemini.


2. "Expert Hats": These specialized skills help to refine the behavior of these tools

If you’ve ever worried about "context bloat"—where an AI gets confused by too much information—skills are your solution. Jack described these as "library books on a shelf."

 

  • Progressive disclosure: Instead of loading every best practice into every prompt, Skills load specialized knowledge (like Three.js expertise or documentation style guides) only when they are triggered
  • The skill creator: Gemini CLI now has a built-in skill to help you build skills. Just ask: "Create a docs-writer skill for this project," and the CLI will walk you through a setup interview.

3. The "Ask User" tool


 

Gone are the days of the CLI just guessing what you want. With the new Ask User tool, Gemini CLI can pause and present interactive dialogues, multiple-choice questions, and yes/no prompts. This ensures the agent is aligned with your vision before it touches a single line of code.


4. Look before you leap with Plan Mode (preview)

Perhaps the most anticipated feature is Plan Mode, currently in preview. It transforms Gemini CLI into a read-only researcher.


 
  • Research first: In Plan Mode, the agent explores your codebase and external docs to create a structured "battle plan."
  • User approval: It presents this plan to you for feedback. Only once you give the "green light" does it switch to execution mode to start editing files.

Ready to dive deeper?

Watch: Missed the live demo? Catch the full replay here.

  • Learn: Take the free DeepLearning.ai course to get hands-on and learn more.
  • Contribute: Gemini CLI is open-source! Check out the "Help Wanted" labels on GitHub.

Top comments (2)

Collapse
 
theycallmeswift profile image
Swift

Wow, these are super helpful tips that I wish I had known months ago 😅 The number of times when Gemini and I fight about whether the development sever is running or not...

Collapse
 
klement_gunndu profile image
klement Gunndu

The progressive disclosure idea for skills is smart — loading context only when triggered instead of stuffing everything into the system prompt. We hit the same context bloat issue running multi-agent orchestration and ended up with a similar pattern: shelf-mode knowledge files loaded on demand. Curious if there is a way to chain skill triggers so one skill can invoke another mid-session.