Direkt zum Inhalt

5. Oktober 20267 Min. LesezeitKIUnternehmen

Claude Code Mods: Erweiterungen greifen jetzt tiefer in den Agenten einClaude Code Mods: extending plugins with clear boundaries

Claude Code Mods machen Plugins zu Eingriffspunkten im Ablauf. Ich ordne ein, was Function Hooks verändern, welche eingebauten Mods es gibt und wo Teams klare Grenzen brauchen.Claude Code Mods extend plugins through function hooks. This article explains what they can do, where teams need boundaries and how to start cleanly.

Claude Code bekommt Mods. Damit verschiebt sich die Erweiterung von der Prompt-Ebene in den Ablauf selbst. Ein Mod ist kein weiterer Textbaustein, den ein Modell irgendwie befolgt. Es ist ein Plugin mit einem Hooks-Modul. Dieses Modul registriert sich an Ereignissen der Engine und entscheidet dann begrenzt, was vor dem nächsten Schritt passieren soll.

Geöffnetes grafitfarbenes Modulsystem mit drei leuchtenden Erweiterungen
KI-generierte Illustration. Ein Bild für Erweiterungen, die kontrolliert in einen Ablauf greifen.
diagrammmods greifen in den Ablauf ein, nicht nur in den Prompt

Ein Hook sitzt zwischen dem Ereignis der Engine und dem nächsten Schritt. So bleibt Erweiterung ein Teil der Ausführung.

01

Ereignis

Ein Mod registriert sich an einem Engine-Ereignis.

02

Regel

Der Hook kann prüfen, ergänzen oder an den nächsten Handler weitergeben.

03

Wirkung

Tool-Aufruf, Oberfläche oder Agentenauftrag bleiben nachvollziehbar im Ablauf.

Quelle: Claude Code Mods README, Stand 05.10.2026.

Was neu ist

Anthropic nennt die technische Grundlage Function Hooks. Im offiziellen Mods-Repository steht das Prinzip knapp: Ein Mod exportiert einen Einstiegspunkt register(on, options). Die registrierten Funktionen bekommen den Engine-Kontext, das Ereignis und eine next-Fortsetzung. Damit können Erweiterungen den Ablauf nicht nur beobachten, sondern an klaren Stellen erweitern.

Das ist ein anderer Hebel als eine dauerhafte Projektanweisung. Eine Anweisung erklärt dem Modell, wie es arbeiten soll. Ein Mod kann dagegen an einer Stelle prüfen, ob ein Werkzeugaufruf in den erlaubten Rahmen fällt, eine Information ergänzen oder eine Oberfläche um einen kleinen, nachverfolgbaren Zustand erweitern.

Was bereits eingebaut ist

Das offizielle Repository dokumentiert vier Mods, die mit Claude Code ausgeliefert werden: sec-default schützt verwaltete Organisationsregeln vor nachträglich installierten Plugins. diff versorgt den Befehl /diff mit einer laufend aktualisierten Ansicht der nicht gespeicherten Änderungen. telemetry ergänzt die interne Erfassung, sofern Telemetrie eingeschaltet ist. agents-md kann AGENTS.md als Projektanweisung laden.

Die wichtige Grenze bleibt: Erweiterbarkeit ist kein Freifahrtschein. Ein Mod sollte eine eng beschriebene Aufgabe übernehmen, seine Rechte klein halten und sich wie jeder andere Teil des Entwicklungsablaufs testen lassen.

Die entscheidende Grenze: Ergänzen oder Bestimmen

Die eingebaute Sicherheits-Schicht sec-default zeigt, worauf es ankommt. Sie sitzt in verwalteten Team- und Enterprise-Umgebungen außen in der Kette und sorgt dafür, dass persönliche Plugins keine bereits festgelegten Organisationsregeln, Prompt-Inhalte oder Tool-Policies aushebeln. Ein eigener Mod ist also kein Ersatz für eine zentrale Sicherheitsvorgabe. Er ist eine Erweiterung innerhalb eines klaren Rahmens.

Drei goldene Lichtbahnen, die durch einen dunklen Rahmen geführt werden
KI-generierte Illustration. Der Rahmen steht für feste Regeln und überprüfbare Zuständigkeiten.
einsatzspektrumnicht jeder Hook braucht dieselbe Eingriffstiefe

Je weiter ein Mod den Ablauf verändern darf, desto klarer müssen Regel, Test und verantwortliche Person sein.

01

Beobachten

Ereignisse sichtbar machen, ohne den Ablauf zu verändern.

02

Hinweisen

Eine begründete Prüfung ergänzen, bevor ein Schritt weiterläuft.

03

Verändern

Nur bei einer klaren, getesteten Regel in den Ablauf eingreifen.

Einordnung von Herrlich Consult, gestützt auf die dokumentierten Hook-Ebenen.

Für die Praxis folgt daraus eine einfache Reihenfolge. Zuerst beobachten: Was passiert an der fraglichen Stelle wirklich? Danach hinweisen: Welche Information hilft einer Person oder einem Agenten, besser zu entscheiden? Erst wenn beides präzise beschrieben und getestet ist, sollte ein Mod einen Schritt verändern. Das hält die Wirkung klein genug, um sie bei einem Update nachvollziehen zu können.

Vom Experiment zur Funktion

Zeitlinie: Ankündigung der Claude Mods am 9. September 2026 und Aufnahme in die Release Notes von Claude Code 2.1.287 am 1. Oktober 2026.

  1. 09.09.2026 · angekündigt

    Ankündigung

    Anthropic benennt die Erweiterbarkeit über Function Hooks als Claude Mods.

  2. 01.10.2026 · veröffentlicht

    Release 2.1.287

    Die Release Notes nennen Claude Mods als neue Möglichkeit, tieferes Verhalten über Plugins anzupassen.

In der Ankündigung vom 9. September beschrieb Anthropic die Idee als tiefere, aber kontrollierbare Erweiterbarkeit. Mit Claude Code 2.1.287 tauchen Claude Mods am 1. Oktober in den Release Notes auf. Die Richtung ist klar: Plugins können näher an die tatsächliche Arbeit rücken, ohne dass jedes Team dafür einen eigenen Agenten-Runner bauen muss.

Was das für die Praxis bedeutet

Für ein Team sind drei Fragen wichtiger als ein möglichst spektakuläres Plugin. Erstens: Welches konkrete Ereignis soll abgefangen werden? Zweitens: Darf der Mod nur hinweisen, oder darf er einen Schritt verändern? Drittens: Woran erkennt man in einem Test, dass die Erweiterung richtig reagiert und nicht nebenbei den Ablauf ausweitet?

Ein sinnvoller erster Mod ist klein. Er kann vor einem riskanten Tool-Aufruf eine verständliche Prüfung einblenden, einen Review-Handoff mit dem geprüften Stand verknüpfen oder Teamregeln aus einer Datei konsistent verfügbar machen. Was er nicht werden sollte: eine zweite, unübersichtliche Steuerungsschicht, die niemand mehr erklären kann.

Warum ein Mod einen Test braucht

Das offizielle Repository behandelt Mods nicht wie lose Skripte. Die Tests registrieren Ereignisse am Engine-Interface, spielen definierte Antworten ein und prüfen anschließend, was die Erweiterung ausgelöst hat. Diese Denkweise ist für eigene Erweiterungen wertvoll: Nicht nur der glückliche Weg zählt. Ein Test sollte auch zeigen, dass der Mod bei einem fehlenden Kontext, einer abgelehnten Aktion oder einem unbekannten Ereignis nicht still zu viel tut.

Drei dunkle Prüfkörper, die durch eine goldene Linie verbunden sind
KI-generierte Illustration. Die Verbindung steht für den Weg vom Auslöser bis zum Testnachweis.
prüfketteein eigener Mod verdient einen kleinen, vollständigen Nachweis

Die Mod-Tests im offiziellen Repository arbeiten gegen die Engine. Für Teams beginnt der Nachweis schon vor dem ersten Hook.

  1. 01

    Auslöser

    Welches Ereignis startet die Regel?

  2. 02

    Grenze

    Was darf der Mod ausdrücklich nicht?

  3. 03

    Test

    Welcher Fall belegt die erwartete Wirkung?

  4. 04

    Protokoll

    Wo wird die Entscheidung nachvollziehbar?

Quelle: Tests und Typkontrakte im Claude-Code-Mods-Repository, Stand 05.10.2026.

Hinzu kommt ein Realitätscheck: Die Hook-API ist laut Repository Early Access und kann sich zwischen Versionen ändern. Wer einen Mod produktiv nutzt, dokumentiert deshalb die erwartete Claude-Code-Version, prüft den eigenen Testfall nach Updates und hält einen Weg bereit, die Erweiterung schnell abzuschalten. Das ist weniger spektakulär als ein großer Agenten-Entwurf, aber genau so bleibt die Erweiterung beherrschbar.

So baust du deinen ersten Mod

Ein Mod ist ein Ordner mit drei Dateien: einem Manifest, einer Liste der Hooks-Module und dem Modul selbst. Das Beispiel unten ist bewusst klein. Es sperrt Schreibzugriffe auf .env-Dateien und zeigt fehlgeschlagene Bash-Befehle in der Statuszeile an. Damit deckt es zwei der drei Eingriffstiefen ab: Der erste Hook verändert einen Schritt, der zweite gibt nur einen Hinweis. Ich habe den Code mit Claude Code 2.1.289 validiert und getestet. Du kannst jeden Block über das Symbol oben rechts kopieren.

Schritt 1: Ordner anlegen

Version prüfen und Ordner anlegen

Terminal
# Version prüfen: Mods gibt es ab Claude Code 2.1.287
claude --version

# Ordner für den ersten Mod anlegen
mkdir -p ~/.claude/mods/env-schutz/.claude-plugin ~/.claude/mods/env-schutz/hooks
cd ~/.claude/mods/env-schutz

Schritt 2: Manifest und Hooks-Liste

Das Manifest gibt dem Mod einen Namen und eine Version. Die Datei hooks.json sagt der Engine, welches Modul sie laden soll. Der Pfad ist relativ zu dieser Datei.

Das Manifest

.claude-plugin/plugin.json
{
  "name": "env-schutz",
  "version": "0.1.0",
  "description": "Sperrt Edit und Write auf .env-Dateien und meldet fehlgeschlagene Bash-Befehle in der Statuszeile."
}

Wo das Hooks-Modul liegt

hooks/hooks.json
{ "modules": ["./register.ts"] }

Schritt 3: das Hooks-Modul

Jeder Hook bekommt drei Dinge: $ für den Zugriff auf die Engine, e für das Ereignis und next für den restlichen Ablauf. Gibt der Hook { deny } zurück, lehnt Claude Code den Aufruf ab, und das Modell sieht die Begründung. Ruft er next(e) auf, läuft alles wie gewohnt weiter. Der Bash-Hook wartet erst das Ergebnis ab und schreibt dann nur in die Statuszeile.

Der Mod selbst

hooks/register.ts
import type { Register } from 'claude-code'

// Getestet mit Claude Code 2.1.289. Early Access: nach jedem Update erneut testen.
const GESCHUETZT = /(^|\/)\.env(\.|$)/

export const register: Register = on => {
  // 1. Verändern: Schreibzugriffe auf .env-Dateien ablehnen.
  for (const tool of ['Edit', 'Write'] as const) {
    on('tool.call', { tool }, ($, e, next) =>
      GESCHUETZT.test(e.file_path)
        ? { deny: `${$.plugin.name}: ${e.file_path} ist geschützt.` }
        : next(e),
    )
  }

  // 2. Hinweisen: fehlgeschlagene Bash-Befehle in der Statuszeile zeigen.
  on('tool.call', { tool: 'Bash' }, async ($, e, next) => {
    const ergebnis = await next(e)
    const fehler = ergebnis.deny === undefined && ergebnis.isError === true
    $.ui.status(fehler ? `fehlgeschlagen: ${e.command.slice(0, 40)}` : undefined)
    return ergebnis
  })
}

Schritt 4: der Test

Der Test prüft beide Richtungen: Eine .env-Datei wird abgelehnt, eine normale Datei kommt durch. Mach danach die Gegenprobe. Ersetze das Muster in GESCHUETZT testweise durch etwas, das nie passt. Der erste Test muss dann rot werden. Wird er nicht rot, prüft er nichts.

Der Nachweis

hooks/register.test.ts
import { test, expect } from 'claude-code/testing'

test('Edit auf .env wird abgelehnt', async $ => {
  const r = await $.tool.call({ tool: 'Edit', file_path: '/repo/.env', old_string: 'a', new_string: 'b' })
  expect(r.deny).toContain('geschützt')
})

test('Edit auf normale Datei läuft weiter', async ($, on) => {
  let erreicht = false
  on('tool.call', { tool: 'Edit' }, () => {
    erreicht = true
    return { result: 'ok' as never }
  })
  await $.tool.call({ tool: 'Edit', file_path: '/repo/app.ts', old_string: 'a', new_string: 'b' })
  expect(erreicht).toBe(true)
})

Schritt 5: prüfen und starten

claude plugin validate liest den Mod so, wie die Engine ihn laden würde, und meldet, welche Ereignisse er belegt. claude plugin test führt die Tests gegen die echte Engine aus. Mit --plugin-dir läuft der Mod nur in dieser einen Sitzung. Das ist zugleich dein Notschalter: Startest du ohne den Schalter, ist er wieder aus.

Prüfen und starten

Terminal
# Manifest und Hooks so lesen, wie die Engine sie liest
claude plugin validate ~/.claude/mods/env-schutz

# Tests gegen die echte Engine laufen lassen
claude plugin test ~/.claude/mods/env-schutz

# Eine Sitzung mit dem Mod starten. Ohne den Schalter ist er wieder aus.
claude --plugin-dir ~/.claude/mods/env-schutz

Soll der Mod in jeder Sitzung laden, auch in der Desktop-App, trägst du den Ordner in deine persönlichen Einstellungen ein. Die Projekt-Einstellungen eines Repositorys werten diese Variable nicht aus.

In jeder Sitzung laden

~/.claude/settings.json
{
  "env": {
    "CLAUDE_CODE_PLUGIN_DIRS": "~/.claude/mods/env-schutz"
  }
}

Welche Ereignisse sich eignen

  • tool.call: ein Werkzeugaufruf. Du kannst ihn ablehnen, umschreiben oder sein Ergebnis auswerten.
  • prompt.submit: eine Eingabe, bevor sie beim Modell ankommt.
  • prompt.compose: der Systemprompt. Ein Mod kann einen eigenen Abschnitt anhängen.
  • session.start und command.run: eigene Slash-Befehle registrieren und beantworten.
  • ui.render: eigene Oberfläche, etwa eine Leiste über der Eingabe oder ein Seitenfenster.

Wenn du schon Shell-Hooks in der settings.json nutzt, laufen die weiter. Ich greife zum Mod erst, wenn ein Shell-Hook nicht mehr reicht. Etwa wenn ein Aufruf umgeschrieben werden soll statt nur gesperrt, oder wenn die Regel einen eigenen Test braucht.

der kern in drei sätzen

Claude Code Mods sind Plugins mit Function Hooks, nicht nur zusätzliche Prompts. Sie können an definierten Ereignissen im Ablauf reagieren und machen damit Erweiterungen präziser. Der Mehrwert entsteht nur dann, wenn Rechte, Wirkung und Tests des Mods genauso klar sind wie der Rest des Entwicklungsprozesses.

Häufige Fragen

Was ist ein Claude Code Mod?

Ein Mod ist ein Claude-Code-Plugin, dessen Verhalten in einem Hooks-Modul liegt. Es registriert sich an Ereignissen der Engine und kann den Ablauf prüfen, ergänzen oder an den nächsten Handler weitergeben.

Sind Mods dasselbe wie Prompts?

Nein. Ein Prompt gibt dem Modell Anweisungen. Ein Mod arbeitet als Plugin am Ablauf von Claude Code und kann zum Beispiel auf Tool-Aufrufe, Oberflächenereignisse oder Agentenaufträge reagieren.

Was sollte ein Team vor einem eigenen Mod klären?

Zuerst den konkreten Auslöser, die erlaubte Wirkung, die Rechte des Plugins und einen Testfall. Ein Mod sollte eine begrenzte Aufgabe lösen und seine Wirkung nachvollziehbar machen.

Sind Claude Code Mods schon eine stabile Schnittstelle?

Nein. Function Hooks sind laut offiziellem Repository Early Access. Teams sollten eigene Mods klein halten, versionieren und nach Updates gezielt testen.

Quellen und Stand

Stand: 05.10.2026. Technische Grundlage, eingebaute Mods, Testansatz und Early-Access-Hinweis: Claude Code Mods README. Release-Hinweis: Claude Code 2.1.287. Einstellungen für Organisationen und Testhinweise: Claude Code Settings Examples.

Claude Code now has mods. That moves extension work from the prompt into the flow itself. A mod is not one more text block the model follows somehow. It is a plugin with a hooks module. The module registers on engine events and then decides, within limits, what happens before the next step.

Opened graphite module system with three glowing extensions
AI-generated illustration. An image for extensions that step into a flow under control.
diagrammods act in the flow, not only in the prompt

A hook sits between the engine event and the next step. That keeps the extension part of the execution.

01

Event

A mod registers on an engine event.

02

Rule

The hook can check, add context or pass on to the next handler.

03

Effect

Tool call, interface or agent task stay traceable in the flow.

Source: Claude Code Mods README, as of 5 October 2026.

What is new

Anthropic calls the technical basis function hooks. The official mods repository states the principle briefly: a mod exports an entry point register(on, options). The registered functions receive the engine context, the event and a next continuation. So an extension can do more than watch the flow. It can extend it at clearly defined points.

That is a different lever than a standing project instruction. An instruction tells the model how to work. A mod can check at one specific point whether a tool call stays within the allowed frame, add a piece of information, or give the interface a small, traceable state.

What is already built in

The official repository documents four mods that ship with Claude Code. sec-default protects managed organisation rules from plugins installed later. diff feeds the /diff command with a live view of unsaved changes. telemetry adds to internal tracking when telemetry is switched on. agents-md can load AGENTS.md as a project instruction.

The important limit stays in place: extensibility is not a free pass. A mod should take on one narrowly described job, keep its permissions small and be testable like any other part of the development flow.

The decisive line: add or decide

The built-in safety layer sec-default shows what matters. In managed team and enterprise setups it sits at the outer end of the chain and makes sure personal plugins cannot override organisation rules, prompt content or tool policies that are already set. Your own mod is therefore no replacement for a central security policy. It is an extension inside a clear frame.

Three golden light paths guided through a dark frame
AI-generated illustration. The frame stands for fixed rules and accountable ownership.
range of usenot every hook needs the same depth

The further a mod may change the flow, the clearer rule, test and owner have to be.

01

Observe

Make events visible without changing the flow.

02

Advise

Add a reasoned check before a step continues.

03

Change

Step into the flow only with a clear, tested rule.

Assessment by Herrlich Consult, based on the documented hook levels.

In practice this gives a simple order. Observe first: what really happens at that point? Then advise: which information helps a person or an agent decide better? Only when both are described precisely and tested should a mod change a step. That keeps the effect small enough to follow after an update.

From experiment to feature

Timeline: Claude Mods announced on 9 September 2026 and listed in the release notes of Claude Code 2.1.287 on 1 October 2026.

  1. 9 Sep 2026 · announced

    Announcement

    Anthropic names extensibility through function hooks Claude Mods.

  2. 1 Oct 2026 · released

    Release 2.1.287

    The release notes list Claude Mods as a new way to customise deeper behaviour through plugins.

In the announcement on 9 September, Anthropic described the idea as deeper but controllable extensibility. With Claude Code 2.1.287, Claude Mods appeared in the release notes on 1 October. The direction is clear: plugins can move closer to the actual work without every team building its own agent runner.

What this means in practice

For a team, three questions matter more than the most spectacular plugin. Which concrete event should be caught? May the mod only advise, or may it change a step? And how does a test show that the extension reacts correctly and does not quietly widen the flow?

A sensible first mod is small. It can show an understandable check before a risky tool call, link a review handoff to the state that was checked, or make team rules from a file consistently available. What it should not become is a second, opaque control layer that nobody can explain any more.

Why a mod needs a test

The official repository does not treat mods as loose scripts. The tests register events on the engine interface, feed in defined answers and then check what the extension triggered. That mindset is worth copying for your own extensions. The happy path is not enough. A test should also show that the mod does not silently do too much when context is missing, an action is refused or an event is unknown.

Three dark test blocks connected by a golden line
AI-generated illustration. The connection stands for the path from trigger to test evidence.
test chainyour own mod deserves a small, complete proof

The mod tests in the official repository run against the engine. For teams, the proof starts before the first hook.

  1. 01

    Trigger

    Which event starts the rule?

  2. 02

    Boundary

    What must the mod explicitly not do?

  3. 03

    Test

    Which case proves the expected effect?

  4. 04

    Record

    Where does the decision become traceable?

Source: tests and type contracts in the Claude Code Mods repository, as of 5 October 2026.

Then there is a reality check. According to the repository the hook API is early access and can change between versions. If you use a mod in production, write down the Claude Code version you expect, run your test case after updates and keep a way to switch the extension off quickly. That is less spectacular than a big agent design, and it is exactly what keeps the extension under control.

How to build your first mod

A mod is a folder with three files: a manifest, a list of hooks modules and the module itself. The example below is deliberately small. It blocks writes to .env files and shows failed Bash commands in the status line. That covers two of the three levels: the first hook changes a step, the second only gives a hint. I validated and tested the code with Claude Code 2.1.289. Copy any block with the icon in its top right corner.

Step 1: create the folder

Check the version and create the folder

Terminal
# Check the version: mods exist from Claude Code 2.1.287
claude --version

# Create the folder for your first mod
mkdir -p ~/.claude/mods/env-guard/.claude-plugin ~/.claude/mods/env-guard/hooks
cd ~/.claude/mods/env-guard

Step 2: manifest and hooks list

The manifest gives the mod a name and a version. The file hooks.json tells the engine which module to load. The path is relative to that file.

The manifest

.claude-plugin/plugin.json
{
  "name": "env-guard",
  "version": "0.1.0",
  "description": "Blocks Edit and Write on .env files and shows failed Bash commands in the status line."
}

Where the hooks module lives

hooks/hooks.json
{ "modules": ["./register.ts"] }

Step 3: the hooks module

Every hook receives three things: $ for access to the engine, e for the event and next for the rest of the flow. If the hook returns { deny }, Claude Code refuses the call and the model sees the reason. If it calls next(e), everything runs as usual. The Bash hook waits for the result first and then only writes to the status line.

The mod itself

hooks/register.ts
import type { Register } from 'claude-code'

// Tested with Claude Code 2.1.289. Early access: test again after every update.
const PROTECTED = /(^|\/)\.env(\.|$)/

export const register: Register = on => {
  // 1. Change: refuse writes to .env files.
  for (const tool of ['Edit', 'Write'] as const) {
    on('tool.call', { tool }, ($, e, next) =>
      PROTECTED.test(e.file_path)
        ? { deny: `${$.plugin.name}: ${e.file_path} is protected.` }
        : next(e),
    )
  }

  // 2. Advise: show failed Bash commands in the status line.
  on('tool.call', { tool: 'Bash' }, async ($, e, next) => {
    const result = await next(e)
    const failed = result.deny === undefined && result.isError === true
    $.ui.status(failed ? `failed: ${e.command.slice(0, 40)}` : undefined)
    return result
  })
}

Step 4: the test

The test checks both directions: a .env file is refused, a normal file goes through. Then run the counter-check. Replace the pattern in PROTECTED with something that never matches. The first test must turn red. If it stays green, it tests nothing.

The proof

hooks/register.test.ts
import { test, expect } from 'claude-code/testing'

test('Edit on .env is refused', async $ => {
  const r = await $.tool.call({ tool: 'Edit', file_path: '/repo/.env', old_string: 'a', new_string: 'b' })
  expect(r.deny).toContain('protected')
})

test('Edit on a normal file goes through', async ($, on) => {
  let reached = false
  on('tool.call', { tool: 'Edit' }, () => {
    reached = true
    return { result: 'ok' as never }
  })
  await $.tool.call({ tool: 'Edit', file_path: '/repo/app.ts', old_string: 'a', new_string: 'b' })
  expect(reached).toBe(true)
})

Step 5: check and start

claude plugin validate reads the mod the way the engine would load it and reports which events it uses. claude plugin test runs the tests against the real engine. With --plugin-dir the mod runs in this one session only. That is also your kill switch: start without the flag and it is off.

Check and start

Terminal
# Read manifest and hooks the way the engine reads them
claude plugin validate ~/.claude/mods/env-guard

# Run the tests against the real engine
claude plugin test ~/.claude/mods/env-guard

# Start a session with the mod. Without the flag it is off again.
claude --plugin-dir ~/.claude/mods/env-guard

If the mod should load in every session, including the desktop app, add the folder to your personal settings. A repository's project settings do not read this variable.

Load in every session

~/.claude/settings.json
{
  "env": {
    "CLAUDE_CODE_PLUGIN_DIRS": "~/.claude/mods/env-guard"
  }
}

Events worth starting with

  • tool.call: a tool call. You can refuse it, rewrite it or evaluate its result.
  • prompt.submit: an input before it reaches the model.
  • prompt.compose: the system prompt. A mod can append its own section.
  • session.start and command.run: register and answer your own slash commands.
  • ui.render: your own interface, for example a band above the input or a side pane.

If you already use shell hooks in settings.json, they keep running. I only reach for a mod when a shell hook is no longer enough. For example when a call should be rewritten rather than just blocked, or when the rule needs its own test.

the core in three sentences

Claude Code mods are plugins with function hooks, not just extra prompts. They can react at defined events in the flow and make extensions more precise. The value only appears when rights, effect and tests of the mod are as clear as the rest of the development process.

Frequently asked questions

What is a Claude Code mod?

A mod is a Claude Code plugin whose behaviour lives in a hooks module. It registers on engine events and can check the flow, add to it or pass it on to the next handler.

Are mods the same as prompts?

No. A prompt gives the model instructions. A mod works as a plugin on the Claude Code flow and can react, for example, to tool calls, interface events or agent tasks.

What should a team settle before building its own mod?

First the concrete trigger, the allowed effect, the plugin's permissions and a test case. A mod should solve one bounded job and make its effect traceable.

Are Claude Code mods a stable interface yet?

No. According to the official repository, function hooks are early access. Teams should keep their own mods small, version them and test them deliberately after updates.

Sources and status

As of 5 October 2026. Technical basis, built-in mods, test approach and early-access note: Claude Code Mods README. Release note: Claude Code 2.1.287. Settings for organisations and testing notes: Claude Code Settings Examples.

WeiterlesenKeep reading

← zurück zum herrlichblog← back to the herrlichblog