Customize Claude Code with mods in TypeScript

Anthropic introduced mods: small TypeScript functions that change how Claude Code works. A mod can rewrite a prompt, add UI, replace a built-in feature, or add new functionality. Mods ship inside plugins and run in the CLI and desktop app.

Why it mattered The first supported way to reshape Claude Code itself: hook events, redraw the interface, swap built-ins, and share the result as a plugin.

Anthropic introduced mods for Claude Code: small TypeScript functions that change how the tool works. Each time Claude Code acts, it emits an event, and a mod can run before, after, or instead of it, or wrap it. One function can rewrite a prompt, block or retry a tool call, approve a permission request, redact secrets, or draw new interface elements.

Mods are not sandboxed. They run with the same machine access as Claude Code itself, so Anthropic warns users to install only from trusted sources. Some built-in features now ship as mods: /diff became one, and more will follow. On Team and Enterprise plans, a built-in sec-default mod loads first and blocks risky overrides.