TEST 008

Claude Code mods: I built one that stops over-editing

AI for businessClaude Code mods

Short answer

A mod is an add-on for Claude Code that you get by describing it to Claude, such as a guard that stops Claude editing files you didn't ask about. In my test, Claude built that guard from one paragraph in 3 minutes 6 seconds, tested it, and it held an edit to my homepage until I said no. Mods need Claude Code 2.1.287 or later in the terminal (the desktop app's Code tab from 2.1.286), run with your permissions, and last one session unless you copy the folder out and install it as a plugin.

Anthropic launched mods for Claude Code. In plain English, you can now change how Claude Code works and looks, just by asking Claude.

Picture this: you ask Claude for one change, and it edits files you never mentioned. So I asked Claude to build a mod that stops that, and recorded the whole thing. This guide shows what happened, the exact request I typed, two public mods worth knowing about, a prompt that suggests mods for your own work, and the catch.

What the guide covers

  • A mod is an add-on you get by describing it to Claude. No coding needed.
  • I built a guard that stops Claude editing files I didn't ask about. It took 3 minutes 6 seconds and worked on the first try.
  • Other people have built a recording mode that hides keys and figures on screen, and a handoff that moves a long chat to a fresh one.
  • A prompt that interviews you and suggests mods for your own work.
  • Mods run with your permissions. Install other people's only if you trust them.

What a mod is, in plain English

Think of Claude Code as a car straight from the factory. A mod is an add-on you fit yourself: a new gauge on the dashboard, or a lock on a door you don't want opened by mistake. You don't fit it by hand. You describe what you want, and Claude builds it.

Mods come in three rough kinds:

Kind What it does Example
Show Puts something on screen Claude Code doesn't show by itself Token Weather, Anthropic's example, shows how full the context window is as a weather forecast
Guard Stops and asks before an action runs My scope guard: Claude may only edit the file you name, and any other edit waits for your yes
Shortcut Adds your own command /rec turns on a recording mode that hides private details on screen

Mods work in the terminal and in the Code tab of the desktop app. Some parts of Claude Code itself, like the /diff pane, are built as mods.

I built one: a guard against over-editing

The test ran on a fake bakery website with three pages. The homepage says the classic cake is "from $39", and the pricing page lists it at $39. I recorded one run in a single Terminal window, using Claude Code 2.1.294 on Fable 5.1.

This is the whole request I typed:

Code
Make me a Claude Code mod called scope-fence. When I type /fence and a file, you may only edit that file. If you try to edit any other file, stop and ask me first, with two buttons: Allow once, or Keep it out. Show a line above the prompt with the fence and how many edits were inside, held and let through. Keep it small, and test it before you say it's done.

What happened:

  1. Claude read the mods documentation and wrote the mod: a 94-line main file, a test and two small settings files. It checked the mod with Claude Code's validator (passed, with one warning that no author was listed) and ran the test: 1 passed, 0 failed. That took 3 minutes 6 seconds.
  2. Partway through, it asked once whether to turn on hot reloading for the session. I said yes, and the mod loaded as soon as Claude's turn ended.
  3. I typed /fence pricing.html. A line appeared above the prompt: 0 inside, 0 held, 0 let through.
  4. I asked: "Change the classic cake price to $45." Claude changed the pricing page and nothing else. The line read 1 inside.
  5. I asked: "Now update the classic cake price everywhere else it appears on the site." Claude found the homepage and tried to edit it. The mod stopped the edit and asked: Allow once, or Keep it out?
  6. I chose Keep it out. Claude said the homepage was unchanged and explained how to let the edit through if I wanted it. The line read 1 inside, 1 held, 0 let through. Git confirmed that only the pricing page had changed.

Two honest notes. In step 4 Claude didn't try to touch the homepage by itself; the guard only came into play when I asked for more than the fence allowed. And this session had just built the guard, so it knew it was there.

To use it in your own work, paste the request above into Claude Code and change the wording to suit you. Then type /fence with the file you want Claude to stay inside. This version handles one file at a time.

Two public mods worth knowing about

These are community mods, not Anthropic's. I read their instructions but haven't installed them.

  • Recording Mode by Nate Herk. Type /rec before you hit record. It hides API keys, emails, names, phone numbers, money and figures next to words like revenue on screen, while Claude still works with the real data. It also keeps credential and finance files closed. Its own instructions say pattern matching can't catch everything, so watch your footage before you post, and the chat titles in the desktop app's sidebar can't be hidden. nateherkai/claude-code-mods
  • claude-auto-handoff by alexknowshtml. When a chat gets long, Claude Code normally squashes it into a summary, and you can't choose what it keeps. This mod writes a structured handoff note instead and starts a fresh chat that reads it. alexknowshtml/claude-auto-handoff

To browse more, claude.dev/mods is Anthropic's page, and ClaudeMod is a community directory. On 9 October 2026 it listed 12 mods, and some of its GitHub links returned errors when checked, so open each repo before you rely on it.

The prompt: let Claude find the mods you need

The hard part is knowing which mod would help you. Paste this into Claude Code, in the terminal or the Code tab of the desktop app. It asks you a few questions, asks Claude to read only the messages you typed in your last 10 sessions, and suggests up to 7 mods ranked by how much they'd help. It ends by waiting for you to pick.

Code
Read only. Don't build, install or write any mod yet.

Help me find Claude Code mods worth having for the way I work. A mod is a small add-on Claude Code builds from a description: something it shows me, a guard that stops or asks before an action, or a shortcut command.

Step 1. Interview me. Ask me 3 to 5 short questions in one message, then wait for my answers. Cover:
- what I mostly use Claude Code for
- what I check by hand after you finish
- which actions make me nervous (deleting, spending, posting, anything I can't undo)
- where I wait or get stuck
- anything I keep repeating to you

Step 2. After I answer, read my last 10 Claude Code sessions (usually under ~/.claude/projects on this computer). Read only the messages I typed myself. Skip your replies, tool output, scheduled tasks and helper runs, so this stays cheap. If you can't find my sessions, say so and work from my answers.

Step 3. Suggest up to 7 mods, ranked by how much they'd help me: first anything that stops a costly or public mistake, then time saved each week, then how often it comes up. For each one:
- a name
- my own words that led to it, with the date (quote me; if there's no quote, say so)
- 3 to 5 "What it should show" lines
- what kind it is: show, guard or shortcut
- whether something already covers it (a setting, a permission rule, a skill, an existing mod). If so, tell me that instead of suggesting a mod.
- the catch: what could go wrong or get in my way
- size to build: small, medium or large

Then list a few ideas that aren't worth a mod, and why.

Rules: read only. Don't create files in the mods folder. Leave out passwords, keys, tokens, account numbers and other people's details. Mark what you saw and what you're guessing.

Show me the ideas first. Don't build anything until I pick.

When you see an idea you like, say "Build idea 2". According to Anthropic's guide, Claude builds it, asks once to turn on hot reload, and the mod appears when its turn ends. My test above built the guard from a direct request rather than from this prompt's suggestions, but those steps were the same.

Check the "already covers it" line before you build. When I ran a longer version of this prompt on my own sessions, some ideas, like a usage meter and a pause before paid actions, turned out to be things Claude Code already shows or a permission rule already handles.

How to keep a mod after the session

A mod that Claude builds on the spot loads only in that session, and its folder is cleaned up later. To keep it, the folder has to be copied out and installed as a plugin. You can ask Claude: "Copy this mod out of the session folder and install it as a plugin for every session." A mod is a plugin, so it installs and shares like any other plugin.

If someone shares a mod with you, installing it takes a few commands in Claude Code: add their marketplace, install the plugin, then reload plugins. Anthropic's guide lists the exact commands.

The catch

  • Mods are not sandboxed. Anthropic's docs say a mod runs with your permissions: it can read and write your files, start programs, make network requests, read secrets in your settings, see and rewrite your prompts and Claude's tool calls, submit a prompt as if you typed it, approve a tool call before you're asked, and spend your usage. Install only from people you trust.
  • Before installing someone else's mod, run claude plugin validate on its folder. It lists every event the mod hooks and everything it asks Claude Code to do, without running it.
  • Mods are new, and Anthropic says the API can change between versions.
  • A mod built in a session lasts one session unless you install it.
  • A guard mod is a safety net. It doesn't replace Claude Code's permission rules.

How the test ran

On 9 October 2026 I recorded one run in a single Terminal window: Claude Code 2.1.294 on Fable 5.1, with my own settings and connectors switched off, in a fake bakery website folder tracked with Git. Claude built the mod from the request above, asked once to enable hot reloading, and the guard held one edit outside the fence. The suggestion prompt was checked the same day on Haiku 4.5 with read-only tools: it asked five questions first, read one session by searching for my typed messages, suggested five ranked ideas and built nothing. Facts about how mods work come from Anthropic's docs, guide, mods page and video. Descriptions of community mods come from their own READMEs, read on 9 October 2026. Check them if something has changed.

Questions

Do I need to know how to code?

No. I described the mod in one paragraph and Claude wrote, checked and tested it. Anthropic's guide says you don't need to learn the API to try one.

Which version do I need?

Claude Code 2.1.287 or later in the terminal. The Code tab of the desktop app supports mods from 2.1.286. Mods are on by default.

Does a mod use up my Claude usage?

Building one does, like any request. Mine moved my weekly usage by about one point. A mod that only checks or shows things runs as code and doesn't call the model unless it was written to.

Will the suggestion prompt change anything on my computer?

The prompt tells Claude to read only and to stop before building. That is an instruction, not a lock. In my check, with editing tools switched off, it asked questions, read one session and built nothing.

Is the guard a replacement for permission settings?

No. It watches Claude's three file-editing tools. A terminal command that writes a file can get past it. For a firmer block, use a deny rule in Claude Code's permission settings.

Are the mods on GitHub and ClaudeMod made by Anthropic?

No. They are community mods. Anthropic's own examples are on claude.dev/mods and in its docs.

Sources

  1. Mods overview (Claude Code docs)
  2. Getting started with Claude Code mods (Anthropic, Addy Osmani, 1 October 2026)
  3. Claude Code mods (Anthropic)
  4. Mods in Claude Code, change how Claude Code works (Anthropic on YouTube, 5 October 2026)
  5. Recording Mode and other mods by Nate Herk (community, not Anthropic)
  6. claude-auto-handoff (community, not Anthropic)
  7. ClaudeMod community directory, Mods (community site, not Anthropic)