Claude Code Mods: Customise Behaviour and UI With a Few Lines of TypeScript
Anthropic launched mods for Claude Code on 1 October 2026: small TypeScript modules, shipped inside plugins, that can rewrite prompts, block or retry tool calls, redact secrets, draw custom UI and add commands. How they work, how to install one with /plugin, and the security caveat — mods run with Claude Code's full access.
On 1 October 2026, Anthropic introduced mods for Claude Code: small TypeScript (or JavaScript) functions that change how Claude Code behaves and looks. They're enabled from Claude Code 2.1.287.
What a mod can do
Under the hood a mod is a set of event handlers. Claude Code calls them when something happens — a prompt is submitted, a tool is about to run, part of the interface is drawn — and the handler can watch the event, rewrite it, or take it over. Examples Anthropic and early users have shown:
- Rewrite prompts before they reach the model.
- Block, change or retry tool calls — for example, require confirmation before any command touches production config.
- Redact secrets from tool output before Claude sees it.
- Draw custom UI: panes, buttons, a status widget showing context usage over recent turns.
- Add commands that run your function directly, without a model turn.
Anthropic rebuilt some built-in features as mods: /diff is now a mod you can switch off in /plugin or replace with your own, and a built-in "You should know" mod scans Claude's output for important details you might miss.
How to get them
Mods ship inside plugins, so you install them the same way:
/plugin
…or from the Claude directory. You can write one yourself, or describe what you want and have Claude Code write it for you. To share one, package it in a plugin and submit it to the directory. (Claude Code Plugins)
The mods API has been moving fast — the changelog has added events like prompt autocomplete, prompt-caching support in $.model.complete, notifications and agent spawning in the first week alone. Check the mods docs for the current API.
The security caveat
Mods aren't sandboxed. They run with the same access to your machine as Claude Code itself. A malicious or buggy mod can read your files, your environment variables and your credentials. Anthropic's advice: only install mods from sources you trust. On Team and Enterprise, admins can manage which mods load. (Plugin security and trust, npm Supply Chain Security)
Mods vs hooks vs skills
- Hooks run shell commands or prompts at lifecycle events — still the simplest way to enforce "always run the formatter". (Claude Code Hooks)
- Skills give Claude instructions and scripts for a kind of task. (Claude Code Skills)
- Mods are code running inside Claude Code, with access to its UI and events — the most powerful and the most trust-sensitive.
Source: Claude blog: Customize Claude Code with mods · Claude Code changelog
EasySpawn runs Claude Code on a persistent server where your plugins, mods and settings stay installed between sessions — and isolated from your laptop. See how it works or join the waitlist.
Related: Claude Code Settings Explained · Claude Code Status Line · Claude Code Output Styles · Secure MCP Servers
Keep reading
Claude Opus 5.5 Released: Near-Fable Performance at a Lower Price
Anthropic released Claude Opus 5.5 on 22 September 2026, the first model in the Claude 5.5 family. It's priced at $4/$20 per million tokens (down from $5/$25 for Opus 5), has a 1M-token context window and 128k output, always-on adaptive thinking, and is now the default model in Claude Code.
Claude Fable 5.1 and Mythos 5.1: Anthropic's Top Models Get an Update
On 1 September 2026 Anthropic released Claude Fable 5.1 (generally available) and Claude Mythos 5.1 (limited availability). Fable 5.1 costs $10/$50 per million tokens with unusually cheap $0.25 cache reads, a 1M-token context and 128k output. What it's for, what's restricted, and how to use it in Claude Code.