Mods in Claude Code: draw panes, add commands, step into tool calls
TL;DR
A mod is a JavaScript/TypeScript plugin running inside Claude Code: it draws panes, adds commands, and rewrites or holds tool calls. It's the most powerful extension but runs with your full permissions, so install only trusted mods and check them with claude plugin validate.
Hooks, skills, status lines and MCP servers all extend Claude Code from the outside: they run a script, or give Claude more text or tools. But what if you want a pane beside the transcript charting how full your context is, or to hold an rm -rf with "proceed / cancel" buttons right in the interface? That's what a mod is for: a kind of plugin that runs inside Claude Code, written in JavaScript or TypeScript.
What mods can do that other tools can't
- Draw a usable interface: a pane beside the transcript or a band above the prompt, with tabs, buttons and text fields.
- Redraw built-in interface: change a tool call's row, the spinner, or the question dialog.
- Step into a tool call or request: hold a tool call to ask you something, answer it without running the tool, or send a request to a different model.
- Commands that run your code immediately: a
/commandthat runs your function with no Claude turn, even while Claude is working. - Share data between hooks: one hook counts, another displays.
What a mod looks like
// hooks/register.js: count tool calls and show them by the spinner
let calls = 0
export function register(on) {
on('tool.call', async ($, e, next) => {
calls += 1
$.ui.invalidate('ui.render')
return next(e)
})
on('ui.render', { component: 'Spinner' }, async ($, e, next) =>
next({ ...e, props: { ...e.props, suffix: ' · tool calls: ' + calls + '…' } }))
}
A small mod has three files: .claude-plugin/plugin.json, hooks/hooks.json pointing to the code, and hooks/register.js. Each hook can observe an event, rewrite it, or answer it instead of the default behaviour. The fastest way to get a mod: describe what you want in a Claude Code session and let Claude write it.
Quick comparison
| Mod | Settings hook | Skill | MCP | |
|---|---|---|---|---|
| Draws interface | Yes | No | No | No |
| Written in | JS/TS | A script + settings.json | Markdown | Any server |
| Pick it when | You need a pane, a custom command, or to rewrite events | Block, allow or log with an existing script | You keep pasting the same instructions | You need an external system |
Installing and trying one
/plugin install token-chart@your-org # install from a marketplace
claude plugin validate ./some-mod # list its events and calls before installing
/plugin # the "N mod active" line shows what loaded
Anthropic shares sample mods in the claude-code-playground repository, such as blast-radius, which holds risky shell commands and shows what they'd change before running. Some Claude Code features themselves, like /diff, are mods.
The risk: mods run with your permissions
- Mods are not sandboxed: they read and write files, start processes, make network requests, read environment variables and settings (including API keys), and see every prompt and tool call.
- A mod can rewrite prompts, submit prompts, and in some setups approve tool calls for you.
- Install only from authors and marketplaces you trust; run
claude plugin validateto see its events and calls first. - To turn them off: uninstall in
/plugin, run--safe-modefor one session, or set"disableAllHooks": true. - A mod can't change what a permission prompt shows you.
How to apply it
- Dev: Ask Claude to write a small mod that shows information you often need (tokens, branch, test status) beside the spinner.
- Tech Lead: Use a
blast-radius-style mod to add a visual confirmation step for destructive commands across the team. - PM/Admin: Set mod policy via managed settings; review mods like code before allowing them.
Sources & references
- Mods overview — Claude Code Docs