Google has added hooks to Gemini CLI, its terminal-based competitor to Anthropic’s Claude Code.
Hooks ensure that Gemini CLI runs a given script or program inside of the agentic loop and bring a larger degree of control to the agentic development loop. These could be used, for example, to run security scanners or compliance checks, log tool interactions, inject relevant information into the context window, or even adjust the model’s parameters on the fly.
As the Gemini CLI team notes in the announcement, “efficiency in the age of agents isn’t just about writing code faster; it’s about building custom tools that adapt to your specific environment.”

Hooks in Gemini CLI (Credit: Google).
While a developer could try to instruct the agent to run a specific script at certain times within the loop in the prompt or AGENTS.md file, given the non-deterministic nature of those agent models, there’s no guarantee that this will actually happen or that the agent won’t forget about this instruction over time.
If this sounds familiar, it’s likely because you already know about Claude Code Hooks, which first introduced this idea last September (though there is also a GitHub issue from July 2025 that proposes this feature). Google’s implementation is not quite a one-to-one match to Anthropic’s, but it should only take a few minutes to adapt an existing Claude hook to Gemini CLI.
Like with hooks in Claude Code, Gemini CLI also implements roughly a dozen lifecycle events where a hook can fire. That may be right at the session start, after the user submits a prompt but before the agent starts planning (to add context, for example), before tools are selected (to optimize the tool selection or filter available tools), and similar moments in the agent loop.

Defining a Gemini CLI hook (Credit: Google).
The hooks are defined as JSON files that describe when they are invoked and which script they should run. Those scripts are standard Bash scripts and Google notes that it is essential to keep those hooks fast because they do run synchronously and delays in the script will also delay the agent response.
Google recommends that developers use parallel operations and caching when possible to keep the operations fast.
One interesting use case for hooks is to utilize the ‘AfterAgent’ hook, which fires when the agent loop ends, to force the agent into a continuous loop to work on a difficult task — while also refreshing the context between those runs to avoid context rot.
As for security, it’s important to stress that hooks will have the user’s privileges, and Google notes that developers should review the source code of any third-party hooks.
Hooks, which are now available as part of the Gemini CLI v0.26.0 update, can also be packaged inside Gemini CLI extensions. That’s Google’s format for packaging prompts, MCP servers, sub-agents, and agent skills — and now hooks — into a single sharable package.
The post Gemini CLI gets its hooks into the agentic development loop appeared first on The New Stack.
In this episode, Andy talks with Dr. Andrew Wittman, former Marine, police officer, federal agent, and leadership coach, about his new book Inner Armor: Perpetual Resilience. If you lead projects and teams, you already know pressure is coming. The real question is what you do when it arrives.
Andrew explains why the brain can work against you under stress, and how the questions you ask yourself shape the options you can see. You'll learn the Two Minute Rule and how it can help you shift from "we can't" thinking into problem-solving mode. Andy and Andrew also explore how filters and assumptions influence what leaders notice, why limitation can be more dangerous than fear, and what it looks like to build a First Responder Mindset so you can hold your poise when stakeholders push back.
They close with a powerful discussion on identity and a practical look at raising resilient kids. If you're looking for insights on leading with clarity and composure when the stakes are high, this episode is for you!
You can learn more about Andrew and his work at GetWarriorTough.com.
For more learning on this topic, check out:
Join other listeners from around the world who are taking our AI Made Simple course to prepare for an AI-infused future.
Just go to ai.PeopleAndProjectsPodcast.com. Thanks!
If you or someone you know is thinking about getting PMP certified, we've put together a helpful guide called The 5 Best Resources to Help You Pass the PMP Exam on Your First Try. We've helped thousands of people earn their certification, and we'd love to help you too. It's totally free, and it's a great way to get a head start.
Just go to 5BestResources.PeopleAndProjectsPodcast.com to grab your copy. I'd love to help you get your PMP this year!
I know you want to be a more confident leader–that's why you listen to this podcast. LEAD52 is a global community of people like you who are committed to transforming our ability to lead and deliver. It's 52 weeks of leadership learning, delivered right to your inbox, taking less than 5 minutes a week. And it's all for free. Learn more and sign up at GetLEAD52.com. Thanks!
Thank you for joining me for this episode of The People and Projects Podcast!
Talent Triangle: Power Skills
Topics: Leadership, Resilience, Stress Management, Decision Making, Mindset, Emotional Regulation, Stakeholder Management, Communication, Self-Leadership, Identity, Team Performance
The following music was used for this episode:
Music: Imagefilm 034 by Sascha Ende
License (CC BY 4.0): https://filmmusic.io/standard-license
Music: Synthiemania by Frank Schroeter
License (CC BY 4.0): https://filmmusic.io/standard-license