Purpose
Mods change how Claude Code works and looks. A mod can rewrite a prompt, add new UI, replace a
built-in feature, or add entirely new functionality. This skill helps decide what a mod should do,
where it hooks in, how it interacts with other mods, and how to roll it out safely. It follows the
announcement post; for the actual TypeScript API, see the official mods documentation and getting
started guide.
When to use
- A user wants Claude Code to behave differently without waiting for a new feature.
- A hook is not enough: the change must rewrite an event, draw new UI, or replace a feature.
- A team wants its own controls (CI status, production safeguards, audit logging).
- An admin needs to govern which mods users may install.
Instructions
Check trust first. Mods run with the same access to the machine as Claude Code itself and are
not sandboxed. Only install mods from sources you trust, as with any code.
Mod or hook? Hooks give some control, but cannot rewrite events, draw new UI, or replace
features. If the need is any of those, use a mod.
Pick the event. Claude Code emits an event each time it does something — for example calling a
tool, asking for permission, or drawing part of the screen. Name the event the mod hooks into.
Pick the phase. A mod runs before the event, after it, instead of it, or wraps it
(code before and after). Typical one-function mods:
- Rewrite a prompt before it reaches the model.
- Block, rewrite, or retry a tool call.
- Approve or deny a permission request.
- Redact secrets from tool output before Claude reads it.
Decide the surface (if UI). A mod can edit or replace part of the interface, such as a tool
result or a question from Claude, and add buttons and inputs that other mods can respond to.
Target the terminal, the desktop app, or both.
Plan load order. When several mods hook the same event, they run in load order. The first mod
to load sees the event first and the result last. Put guard or logging mods first.
Replace instead of add, where possible. Some built-in features ship as mods — e.g. /diff.
Turn a built-in off in /plugin or replace it with your own version.
Let Claude write it. Ask Claude Code to create the mod; it can write the TypeScript, install
it, and hot reload it in the session.
Package and share. Mods ship inside plugins. Install from the Claude directory or with
/plugin in the CLI. To share, package the mod in a plugin and submit it to the directory.
Govern for teams. Existing plugin controls apply: admins allow or block plugin marketplaces
(admin console on Team/Enterprise; managed settings on Claude API and third-party API plans).
With Team/Enterprise or managed settings, the built-in sec-default mod loads first and stops
user-installed mods from risky actions such as overriding permission deny rules. Admins may load
their own mods first instead — if so, add sec-default to the list to keep its restrictions.
Fill in references/mod-design-worksheet.md before
building; see it for the team patterns from the post.
Examples
Redact secrets from tool output
- Event: tool call result. Phase: after. Effect: strip secrets before Claude reads the output.
- Load early so later mods also see redacted output.
Production safeguard
- Event: tool call (shell command). Phase: before. Effect: require confirmation when a command
touches production config.
CI/CD status pane
- Surface: a pane beside the conversation (desktop app) showing pipeline status, updated as builds
pass or fail.
Audit logging for an enterprise
- A mod that loads first records every call every other mod makes. Keep
sec-default in the
admin load list.
1---2name: plan-code-mods3description: Plan, scope, and safely adopt Claude Code mods — small TypeScript functions, shipped inside plugins, that hook Claude Code events (tool calls, permission requests, screen drawing) to run before, after, instead of, or around them. Covers choosing a mod versus a hook, event phases, load-order stacking, UI changes in the terminal and desktop app, replacing built-in features such as /diff, team and enterprise controls (marketplace allow/block lists, managed settings, the sec-default mod), and trust rules for installing mods. Use when someone wants to customize Claude Code behavior or UI, write or install a mod, or govern mods across a team.4metadata:5 source: https://skillmd.com/skills/uygnoey/plan-code-mods6---78## Purpose9Mods change how Claude Code works and looks. A mod can rewrite a prompt, add new UI, replace a10built-in feature, or add entirely new functionality. This skill helps decide what a mod should do,11where it hooks in, how it interacts with other mods, and how to roll it out safely. It follows the12announcement post; for the actual TypeScript API, see the official mods documentation and getting13started guide.1415## When to use16- A user wants Claude Code to behave differently without waiting for a new feature.17- A hook is not enough: the change must rewrite an event, draw new UI, or replace a feature.18- A team wants its own controls (CI status, production safeguards, audit logging).19- An admin needs to govern which mods users may install.2021## Instructions22231. **Check trust first.** Mods run with the same access to the machine as Claude Code itself and are24 not sandboxed. Only install mods from sources you trust, as with any code.25262. **Mod or hook?** Hooks give some control, but cannot rewrite events, draw new UI, or replace27 features. If the need is any of those, use a mod.28293. **Pick the event.** Claude Code emits an event each time it does something — for example calling a30 tool, asking for permission, or drawing part of the screen. Name the event the mod hooks into.31324. **Pick the phase.** A mod runs *before* the event, *after* it, *instead of* it, or *wraps* it33 (code before and after). Typical one-function mods:34 - Rewrite a prompt before it reaches the model.35 - Block, rewrite, or retry a tool call.36 - Approve or deny a permission request.37 - Redact secrets from tool output before Claude reads it.38395. **Decide the surface (if UI).** A mod can edit or replace part of the interface, such as a tool40 result or a question from Claude, and add buttons and inputs that other mods can respond to.41 Target the terminal, the desktop app, or both.42436. **Plan load order.** When several mods hook the same event, they run in load order. The first mod44 to load sees the event first and the result last. Put guard or logging mods first.45467. **Replace instead of add, where possible.** Some built-in features ship as mods — e.g. `/diff`.47 Turn a built-in off in `/plugin` or replace it with your own version.48498. **Let Claude write it.** Ask Claude Code to create the mod; it can write the TypeScript, install50 it, and hot reload it in the session.51529. **Package and share.** Mods ship inside plugins. Install from the Claude directory or with53 `/plugin` in the CLI. To share, package the mod in a plugin and submit it to the directory.545510. **Govern for teams.** Existing plugin controls apply: admins allow or block plugin marketplaces56 (admin console on Team/Enterprise; managed settings on Claude API and third-party API plans).57 With Team/Enterprise or managed settings, the built-in `sec-default` mod loads first and stops58 user-installed mods from risky actions such as overriding permission deny rules. Admins may load59 their own mods first instead — if so, add `sec-default` to the list to keep its restrictions.606111. Fill in [references/mod-design-worksheet.md](./references/mod-design-worksheet.md) before62 building; see it for the team patterns from the post.6364## Examples6566**Redact secrets from tool output**67- Event: tool call result. Phase: after. Effect: strip secrets before Claude reads the output.68- Load early so later mods also see redacted output.6970**Production safeguard**71- Event: tool call (shell command). Phase: before. Effect: require confirmation when a command72 touches production config.7374**CI/CD status pane**75- Surface: a pane beside the conversation (desktop app) showing pipeline status, updated as builds76 pass or fail.7778**Audit logging for an enterprise**79- A mod that loads first records every call every other mod makes. Keep `sec-default` in the80 admin load list.