Skip to content

A maior atualização do Claude Code chegou: Claude Code Mods! (INSANO)

Read the Portuguese translation →

Author: Matheus Battisti - Hora de Codar · Watch on YouTube

Video authored by the channel shown, not by IANIA; all rights belong to the creator. Transcript and summary generated automatically; the original-language content is preserved.

Original language: English

Original video: A maior atualização do Claude Code chegou: Claude Code Mods! (INSANO) · Channel: Matheus Battisti - Hora de Codar · 15:43 · Watch on YouTube

Topics: AI agents, Task and workflow automation, Claude Code, AI developer tools

The video introduces Claude Code mods, describing them as flexible TypeScript extensions that can respond to events, affect execution, and add terminal interfaces. The presenter explains how mods differ from hooks, how they can be created or installed, and how to access them through the plugins command. Two project-level examples are built: a context-usage display and an emergency brake that previews destructive commands and lets the user cancel them. The video also demonstrates both mods in use and recommends consulting Anthropic’s documentation.

  • Mods are TypeScript extensions that can interact with Claude Code during execution and add interfaces in the terminal.
  • Unlike hooks, mods can do more than allow or block an action; they can also display information and controls.
  • Mods can respond to events such as tool calls, prompts, turn starts and ends, session changes, slash commands, and screen rendering.
  • The presenter describes three ways to get mods: ask Claude to create one, install one from the marketplace, or use native mods.
  • Mods can be scoped to a project or made global, and are managed through the plugins command.
  • The context forecast mod shows context usage with a visual status, a recent-turn chart, and the latest turn’s contribution.
  • The emergency brake mod previews the effects of destructive commands before execution and offers the choice to proceed or cancel.
  • The presenter advises restarting Claude Code when needed for visual or interactive mods to appear, and recommends reading the official documentation.
Start Chapter Summary
00:00 What Claude Code mods are The presenter introduces mods, compares them with hooks, and explains their event-driven behavior and ability to add terminal interfaces.
03:39 Accessing mods and preparing to create one The video points viewers to the plugins command and explains that Claude Code should be updated before trying the new feature.
04:44 Creating a context forecast mod The presenter asks Claude to build a project-level mod that visually tracks context usage, then restarts and tests it.
09:59 Building and testing an emergency brake A second mod is designed to preview destructive commands, and the presenter tests canceling a folder deletion.
13:36 Documentation and closing thoughts The presenter recommends reading Anthropic’s documentation, reflects on mod flexibility, and wraps up the video.

They interact during Claude’s execution, like hooks, but much more flexible and in TypeScript — 00:00

it can also, besides that, draw elements on the screen — 03:08

It shows how the context is filling up in a more visual way — 06:18

Then the user chooses. Are you going to proceed or cancel? — 11:00

it’s always worth reading the documentation — 14:09

Claude Code, mods, hooks, TypeScript, context forecast, emergency brake, Anthropic

00:00 Anthropic just released a new feature for Claude Code called mods. They interact during Claude’s execution, like hooks, but much more flexible and in TypeScript—for those who program, you’ll remember the JavaScript-derived language with types. In this video, I’m going to show you how they work and how you can create your own mods. In fact, Anthropic has already migrated some Claude features to mods as well. So it’s already active, and you might have

00:31 some installed. So let’s go, let’s get to know the mods. Come on in. So guys, first off, a theoretical explanation of what Claude Code mods are, okay? The idea is for us to draw on the knowledge we have of hooks. Hooks act at specific points during Claude Code’s execution: before the prompt is injected, after it’s received, or at the end of Claude’s execution. While hooks are limited, mods don’t have that

01:01 restriction. They can be inserted anywhere, and they can create interfaces. This thing on the right is an example of what mods can do. For instance, here is a bar showing Claude’s current context. Here it is stopping a destructive command. So that is how we will be using mods to interact with Claude. Regardless of the action it’s performing. We can describe what we want the mod to do right in the prompt, and it will create it for us, and that’s it. It’s very simple and

01:32 easy to understand. So, think of these as small TypeScript functions that step into what Claude Code is doing. They change how it behaves and draw new interfaces right inside the terminal, which is very cool. There are actually many repositories that were built around this. Now that’s no longer necessary; we can easily create our own . So, take a look: every event passes through your mod before it happens, provided we’ve set it that way. We have an event that Claude will run, and if a mod is configured to see events, it will interact to decide whether to stop it or let Claude execute. So this is

02:04 where a specific mod will act, and then there are the other mods. We will be able to have multiple mods running in real time. Just like game mods, really. And after this cycle of various mods executing finishes, if there’s more, Claude continues the execution, like a loop. That will be running between Claude’s actions. And look at this interesting part as well, we can capture various types of events, right? So it’s much more flexible than the hook, as I mentioned, right? We can capture a tool being called, a prompt sent, a turn starting or ending, right?

02:36 This is similar to what the Hook does, right? Sessions opening and closing, commands being typed in slash commands, each piece of the screen being rendered . So it is very flexible. And here’s a very interesting difference for us to understand how the Hook processes and how the mod processes, right? The hook only decides whether it passes through. It’s like a gate, really, right? So, we have hooks inserted into our flow, and it verifies something; if it works, it continues, if not, it blocks. But the mod doesn’t, it can also, besides that,

03:08 draw elements on the screen, not just for context, as I’m showing here, but command acceptances. Its use in practice becomes very interesting, right, in our day-to-day. We can highly customize Cloud Code. There are basically three ways for us to create a mod, right? We can ask Claude, just like a prompt, the same way we did to create hook skills. We can install from the marketplace, just like we did with plugins, right, which we have the command for inside Claude itself, okay? And the native mods, which we already

03:39 have some of, I’ll show you, all stay under the slash plugin command. And there we can enable and disable mods that already exist from Claude itself and our future ones that we will create , alright? So, guys, a very interesting resource. Let’s go learn and create some in practice. And guys, just before we start, our JV course launched today, okay? I’ve already sent emails to the people who signed up for the list, and I’m here to announce the founding class , right, the first group that will have access to a special price. The link

04:11 will be here in the pinned comment. So go ahead and secure your spot in the JV course. I actually want to bring a video using mods with JV, guys, which will be very interesting too. You can integrate the two, okay? When you click on this link, you will land on this page where everything is explained in detail about how the course works. If you have any questions, there is a WhatsApp button to talk to us, and mainly watch this video here, okay? In this video, I explain detail by detail what happens inside. Let’s head over to Cloud, everyone. First things first, okay? What do you have to do? Update

04:44 Cloud. This came out recently. Alright. Let me just change this real quick. I was creating a project there for us to work on later. And you’re going to run a “cloud update,” okay? That will make it update to this version here, which is the version that already has plugins . If there’s a newer one later on, great, but it’s at least version 2187, okay? Now, going back to Cloud, if you type “/plugins,” okay? You’ll already be able to access the active plugins. So, put it here, look: “/plugins.” Then

05:16 here under installed, if you scroll down a bit, you’ll see your builds. These plugins are plugins that when Cloud updated, they already transferred part of the code functionality to plugins, okay? So it’s something that was born and the team is already using, and ours will be on this tab too, okay? How do we create a plugin? We’ll have to ask it, right? That’s one of the possibilities. So here I’ll do an example that will be very easy for

05:48 everyone to understand, visually as well. So create a mod in Cloud Code called “context forecast.” A weather forecast for my context window, a line above the prompt. What does the line show? A symbol and a word according to how much the context window has filled up. So, below 25%, sun and clear in yellow; 25 to 49%, cloud and cloudy in cyan; 50 to 74, umbrella and rain in blue; 75 to 89, lightning and storm in

06:18 magenta. So, what does this do? It shows how the context is filling up in a more visual way so I can understand when it’s time, for example, to compact it if I want, or clear the session if I want, so I can save tokens. Then it will have the percentage used, a mini bar chart for the last 12 turns, and how much the last turn added, right? So the last pass, right, the last prompt, how much it added to this context. And all in Portuguese, updating every turn; use simple symbols that align with any

06:49 font. Terminal without emojis, right? So here I’m talking more about my environment, right? Because maybe on Linux it’s a bit more flexible, right, folks? But here on Windows, we know how it is to program. So, I’m already giving him this disclaimer and I’m setting this mod to be project-level. Just like skills, we can also create mods per project, which is quite interesting, because I don’t pollute my global context with things I only want to use here. I’ll create it right here in this project so we can do the class

07:19 test. But you can create it globally to work in all the projects you have, okay ? So, one more resource that already follows this best practice. I see you have a plugin authoring skill that comes with Cloud, right? And here it will start to create it. Then we just have to wait, and we’ll have access to this little plugin of ours. So, we’ll be able to use a plugin here that serves what purpose? For us to track the context in a graphical, visual, and easy way, right? So, one of the possible uses. Well, guys, it shows me

07:53 here how it would look, right? So it gave an idea. So, we have the preview here, right? And I’ll restart it here so we can see the plugin in action. So, remembering, guys, you created the plugin, if it interacts with what we’re doing in the terminal, if it’s visual, you have to restart it here for it to appear, okay? At first, it won’t act, we need to ask it something here for it to start, right? So I’ll put here: list all the files in this project and

08:24 explain to me step-by-step how the summary at the top calculates the total that’s in the cart that still needs to be bought. I’m talking about the Feira Fácil project. Just to provide context too, guys. I wanted a small project here just to have something to do in Cloud, so as not to work with nothing. It’s a very simple project that will help us test the mods, okay? You notice that nothing has come up yet, right? But right after, it will show it here.

08:56 So, look here, guys, so it explained it , right? It did what Cloud had to do. And here we have the context now, right ? So, I’ll make another small change. If we look at the project there, it has shades of green, right? I’ll ask it to change to blue shades. So, the project has predominantly shades of green, change it to a blue shade. Then it’s done, right? And so it keeps adding to the context. So we have this little bar here to track how it’s doing. And

09:28 eventually, if we clear or compact it, this will be reduced, right? It’s a way to use the mods there. Look, it changed here. And if I run a compact, just to test, it tends to decrease, right? Well , guys, the compaction didn’t change anything here because I believe there wasn’t that much data in the context, right? It ended up not being able to compact anything, right? But anyway, now we have this context status here, very easy to check. And when we want to

09:59 work with it in some way, by clearing or compacting, it’s simpler to run the command because we don’t need to go into the context to analyze it; it’s all right here and visible, okay? Let me create another example here for you. So, this one will act on cloud actions, right? So, I’ll ask for a plugin here called “emergency brake,” right? They need to have a name because they are installed in the/plugin directory, right? So, the cloud ones are named, which is why I’m giving them names. This one will do the following: every

10:29 time a command is run that recursively deletes things or discards work, the mod holds the command before executing it. It works for both Linux style and PowerShell. So, removal commands here are blocked, let’s say. While the command is held, the mod figures out what it will affect without deleting anything. So, it reads or understands the problem or the damage before deleting files. Which files and folders , how many there are, and the total size. If it’s a Git command, it also shows which files with unsaved changes

11:00 would be lost. It opens a panel on the side of the chat called “emergency brake” with the command, a summary of the damage, the list of files, and two buttons. Then the user chooses. Are you going to proceed or cancel? If there’s no room for a side panel, it shows the same content above the prompt, right? Because it also depends on the screen here, right? So that also provides flexibility. Proceed, it runs the command normally; cancel. The mod notifies that I canceled and what would have been deleted. Then I give those examples there that are in Windows, which have to be at the project level,

11:31 and it will start to create. Just to show you guys, right? This is where the created files are kept. So they are type files, as I told you, there is a plugin configuration file, which is what shows up there in/plugin, right? And then it also sets it here in the cloud folder, but the actual content of the plugin stays here, right? How it’s executed, how it works under the hood. So let’s see here if it delivers the handbrake. Hey, guys. So this one took a little longer, right? And since it was in the same session, it also consumed tokens and added them to it,

12:02 right? So you can see here that it’s adding up, right, the session and our handbrake? So it created the same thing here, right? It’s a bit more complex, which is why it takes time. I’m going to restart, okay? I’ll even use his suggestion here later to show you guys. I’ll just start the cloud here. I’m just restarting to be safe, because in my other tests I needed to restart for some to work, right? So doing it once

12:32 to avoid any issues. I showed that the cloud plugins stay here, but ours do too, look. Check here under project. If I go to install in the plugins, our two project mods are already there, right? So this one is for this scope, but it could be global as well. Got it? So let’s do the test here. Delete the next folder from Feira Fácil. Then it will identify it, and when running the command, whatever it is, be it Linux or Windows, it will warn me. Oh, this

13:05 didn’t turn out very practical, right? There was a lot, but you can see it here, right? Look, the damage: 153 files, 19 folders. Then I can proceed or cancel. I’ll cancel it. Look, I chose to cancel. Since there was so much, the terminal is a bit hard to read here. Let’s just wait a bit and see what happens here. Look, it put cancelled. I didn’t delete anything and the next folder is still there, okay? So we gained this brake here so we

13:36 don’t run destructive commands for no reason. And so it goes, right, guys? We have to identify the points where we want to place the mods and ask it to create them. Whenever possible, it will structure it for us. We will be able to execute our work very easily, as if we were doing the vibe check on the projects, right? With prompts, we will also get where we need to. Also, just to show you guys, they released an article about the mods. So this is where I got my information from, right?

14:09 You can take a better look at how it works and understand it from Cloud itself, right? How they, uh, instruct the creation, right? There are even some examples and such. So, it’s always worth reading the documentation, right? I always advise you to do that, as it is the most reliable source of information. This will change one day, they will update it, and it stays for life. It’s what Claude Anthropic releases, okay? Guys, to wrap up here, as I said, I’ll bring content about JV with mods too, but go ahead and sign up

14:40 for the JV course, it’s at this special launch price, it’s lifetime access, includes support for questions, the link will be here in the pinned comment , alright? I’m waiting for all of you there. so we can create projects with JV and show you how to use it effectively to save tokens and have faster, more secure projects, okay, guys? So, regarding Claude code mods, that’s it. I intend to explore the topic more, but tell me, did you like it? Leave in the comments what you thought of this feature. To me, it was

15:12 just another refactoring of Claude, as it is. They attributed this feature to be able to designate already existing functionalities, right? to a simpler and easier way to maintain. And with that, they’ve already released the ability for us to create our own mods, right, which stay inside plugins. And this will generate flexibility and customization for Claude, just like I showed you. And I believe it’s a feature that will have a lot of news coming our way. We will probably see

15:43 several cool mods and be able to use them in our projects. Well guys, that’s it for today. I’ll be signing off here. See you in the next video.