AI and agents · Step by step

Make your first Claude Code mod, no coding.

A mod changes how Claude Code looks and behaves from the inside. You don't have to code anything: you ask in your own words, Claude writes it, and about 5 minutes later you're using it. Here are three to copy and paste, and how to ask for your own.

no coding
about 5 minutes
3 mods ready to paste
5 steps
01

What do you want your mod to do?

start here

Pick one and the guide shows you only its steps.

⌄
All you need is Claude Code, which comes with Claude's paid plans; the free one doesn't include it. If you don't have it yet, here's how to install it. It has to be version 2.1.287 or newer, and in VS Code, for panels, 2.1.299. The mods feature comes turned on: there's nothing else to install to make your own. If you don't know your version, ask Claude: what version of Claude Code do I have?
02

A brake before deleting

Five steps, top to bottom.

⌄
  1. Ask for it

    Open Claude Code and start a new conversation: in the terminal, by typing claude; in VS Code, from its panel. Paste this:

    The prompt
    Make me a mod: before Claude deletes something or runs git reset --hard or a force push, it stops, tells me how many files would go and how much they weigh, and lets me choose to continue or cancel. It must also work when the delete is chained with other commands. Write the question in English.

    With Sonnet it took one to three minutes. With Opus on high effort, about 13 in my test. If you want it fast, first type /model sonnet; it stays for your next conversations, and to change it type /model. If you don't have auto mode, it will ask for permission several times, with long commands and sometimes odd-sounding warnings, because it's reading and writing the mod: choose plain Yes, without the options that allow more things. The question in the next step may show up while it is still writing: answer it anyway. Claude will give the mod whatever name it likes. If it offers to upload it to GitHub, you don't need to: say no.

    It went well if you get the question in the next step and Claude tells you the mod is written.
  2. Turn it on

    Claude Code asks you Turn on the mods Claude writes in this session? Choose Turn them on, the second option: go down with the arrow and press Enter. Careful: the one already selected is the first, How does this work?, and that one only explains it. If you press Enter twice in a row, it ends up as no.

    Claude Code's question to turn on mods, with the Turn them on option selected
    It went well if you see a line with your mod's name and This mod is now loaded.
  3. Test it

    Paste these two sentences, one after the other, waiting for Claude to finish the first. One creates a test folder and the other deletes it, so nothing of yours gets touched:

    First
    Create a folder called brake-test with three text files.
    Then
    Now delete the brake-test folder.
    The mod stops before deleting: 3 files, 14 B, and the options to continue or cancel
    It went well if, before deleting, Claude stops, tells you how many files there are and how much they weigh, and lets you choose to continue or cancel. If you cancel, nothing gets deleted.

    The brake watches delete commands, not when Claude overwrites a file, and sometimes it asks more than it needs to. Without auto mode, after the brake you also get the usual permission prompt. Claude doesn't see the brake's box: in one of my tests it said it hadn't fired when it had, and offered to fix it. If that happens, tell it that it did fire. Claude will tell you what it covers and what it doesn't: read it.

  4. If something's off, tell it

    Tell it like you'd tell a person. For example: also ask me before touching my invoices folder. If it doesn't count the files right, tell it that too: in one of my tests it showed 0 files and in another it didn't even stop, because Claude created and deleted the folder in the same command. That's why this test is two sentences. The mod reloads by itself when Claude finishes.

  5. Keep it

    So far, your mod only exists in this conversation, and Claude Code deletes that folder after a while (a month, unless you changed it). Paste this and it stays. If it asks for permission, just say yes, without choosing the option that allows more things:

    Keep it
    Save this mod in ~/mods/brake and keep it on in all my sessions by adding its full path to CLAUDE_CODE_PLUGIN_DIRS in the env of ~/.claude/settings.json. First make a copy of that file and show me the change. If that variable already has other paths, keep them. Do not change anything else in that file and check that it is still valid.
    It went well if you open a new conversation and your mod still works. From here on it runs in all your sessions and with your permissions, so keep only the ones you tested. If you update Claude Code, repeat the test: a mod can stop working without warning.
+

If something fails

What happened to me and what the documentation says.

⌄

It says Unknown command

The mod isn't on. Usually that's because you didn't choose Turn them on. The easiest way: open a new conversation, ask again and this time choose Turn them on.

I chose Not now

Same as above: open a new conversation, ask again and choose Turn them on.

Claude says it can't

Check that you're in a folder you told Claude Code you trust: it asks the first time you open it. Without that it doesn't load. And on a work computer, your company may have mods blocked.

I use VS Code

The brake worked for me in VS Code. Panels show up from version 2.1.299, and buttons are pressed with a click, not with their key. If something in your mod doesn't show up, ask Claude to draw it in a panel.

+

Remove a mod

Just as easy.

⌄

Ask Claude: remove the brake mod from all my sessions. Or type /plugin, press Tab until the Installed tab, pick your mod and turn it off with Space. In VS Code, type /plugins and do it from Manage plugins.

+

For the curious

What a mod is on the inside and why you're the one who turns it on.

⌄

A mod is a code file that Claude Code runs when something happens, like a tool call or something being drawn on screen. Claude writes it in ~/.claude/dev-mods/, with help from a skill it comes with, plugin-authoring.

That's why it asks before turning it on: a mod runs with your same permissions and can do whatever you can do on your computer. With one you asked for, you know what you asked for: check that it does that. With someone else's, check first who made it. More in the official documentation.

Tested on November 3, 2026 with Claude Code 2.1.317 in a Mac terminal with Sonnet, and the brake also in VS Code with Opus and in the terminal without auto mode, on a Max plan with my setup, in test folders.