{"slug": "claude-code-mods-plugins-may-now-modify-deeper-behavior", "title": "Claude Code Mods: plugins may now modify deeper behavior", "summary": "Anthropic's Claude Code now supports mods, JavaScript or TypeScript event handlers that run inside the tool and can draw or redraw its interface, intercept tool calls and requests, and run custom code on a /command without a Claude turn. Mods install as plugins from a marketplace via `/plugin install token-chart@your-org` in a session or `claude plugin install token-chart@your-org` in a shell, and some built-in Claude Code features such as `/diff` are themselves mods. Mods differ from existing settings hooks, skills, status lines, and MCP servers because those run outside Claude Code, while a mod's hooks share variables within its file so one hook can record data another displays.", "body_md": "[plugin](https://code.claude.com/docs/en/plugins/overview)that changes how Claude Code looks and behaves. It’s made of JavaScript or TypeScript event handlers: Claude Code calls one when an event happens, such as a tool call, a submitted prompt, or a part of the interface being drawn, and the handler can watch the event, change it, or take it over. Use a mod to add a feature of your own to Claude Code, such as a pane that charts how full your context is after each request. For the files in a mod and a complete example, see\n\n[How a mod works](#how-a-mod-works).\n\nClaude Code’s existing \n\n[hooks](https://code.claude.com/docs/en/hooks)also run on events, as a shell command, HTTP request, or prompt you configure in a settings file. A mod’s handlers are functions that run inside Claude Code instead. Claude Code calls both kinds hooks: on these pages, “hook” means a mod’s handler, and the settings-file kind is a “settings hook”.\n## What a mod can do\n\nSettings hooks, skills, status lines, and MCP servers work from outside Claude Code: each one runs a script, or gives Claude text or tools. A mod runs inside Claude Code, so it can do things they can’t:\n- **Draw an interface you can use** : a pane beside the transcript or a band above the prompt, with tabs, buttons, and text fields. See[Draw in the interface](https://code.claude.com/docs/en/plugins/mods/interface) .\n- **Redraw Claude Code’s own interface** : replace or restyle parts Claude Code draws itself, such as a tool call’s row, the spinner, or the dialog Claude asks questions in. See[Change what Claude Code already draws](https://code.claude.com/docs/en/plugins/mods/interface#change-what-claude-code-already-draws) .\n- **Step into a tool call or a request** : for example, hold a tool call while you ask the user a question, answer it without running the tool, or send one request to a different model. See[Guard or change a tool call](https://code.claude.com/docs/en/plugins/mods/events#guard-or-change-a-tool-call) and[Follow a turn](https://code.claude.com/docs/en/plugins/mods/events#follow-a-turn) .\n- **Run your own code on a command** : a`/command` that runs your function at once, with no Claude turn, even while Claude is working. See[Add a command or a tool](https://code.claude.com/docs/en/plugins/mods/api#add-a-command-or-a-tool) .\n- **Share data between hooks** : a mod’s hooks share the variables in its file, so what one hook records, another can show. For example, one hook can count tool calls while another shows the count beside the spinner, or one can read each request’s token usage while another charts it in a pane. See[React to events](https://code.claude.com/docs/en/plugins/mods/events) .\n\n[Where mods run](#where-mods-run)to understand how they behave elsewhere, such as in the VS Code extension,\n\n`claude -p`, and cloud sessions. If a settings hook, a skill, or an MCP server already does what you need, [compare them](#compare-mods-settings-hooks-skills-and-mcp-servers)before you write a mod. To manage mods for an organization, see\n\n[Manage mods for your organization](https://code.claude.com/docs/en/plugins/mods/admin).\n\n## Get a mod\n\nYou can start with a mod in one of three ways:\n- **Use one you already have** : some of Claude Code’s own features are mods, such as`/diff` . See[Mods built into Claude Code](#mods-built-into-claude-code) .\n- **Make one** : describe what you want in a Claude Code session, and Claude writes the mod. See[Ask Claude for a mod](https://code.claude.com/docs/en/plugins/mods/create#ask-claude-for-a-mod) . To learn how a mod’s code works,[write one yourself](https://code.claude.com/docs/en/plugins/mods/create#write-a-mod-yourself) .\n- **Install one** : see[Install or update a mod](#install-or-update-a-mod)\n\n### Install or update a mod\n\nA mod installs as a plugin, from a marketplace. Give the plugin’s name, an`@`, and the marketplace’s name. These examples install a plugin named `token-chart` from a marketplace named `your-org`:\n- In a Claude Code session, run `/plugin install token-chart@your-org` .\n- In your shell, run `claude plugin install token-chart@your-org` .\n\n[Install plugins](https://code.claude.com/docs/en/plugins/install)covers marketplaces, scopes, the VS Code extension and the Desktop app, and\n\n[keeping plugins updated](https://code.claude.com/docs/en/plugins/install#keep-plugins-updated), all of which apply to a plugin that contains a mod without changes. If you install or update a mod from your shell while a session is open, run\n\n`/reload-plugins` in that session to load it. Otherwise it loads the next time you start Claude Code.\n## Decide whether to trust a mod\n\nA mod is code that runs with your permissions, inside Claude Code. Install mods only from authors and\n[marketplaces you trust](https://code.claude.com/docs/en/plugins/security).\n\n### What a mod can reach\n\nA mod runs with your permissions, so before you install one, know what it has access to. Once it loads, a mod can:\n- **Act on your machine as you** : read and write files anywhere your user account can, start programs, and make network requests\n- **Read your secrets** : environment variables and settings files, including an API key you keep in either\n- **See your session** : every prompt you send and every tool call Claude makes\n- **Change your session** : rewrite a prompt or a tool call, submit a prompt as if you had typed it, or send a message to another of your sessions\n- **Act without asking you** : approve a tool call before you’re asked\n- **Spend your usage** : call a model on your plan or API key\n\n`ask` rule would prompt for, or that one of your own `PreToolUse` hooks blocked. [Extend permissions with hooks](https://code.claude.com/docs/en/permissions#extend-permissions-with-hooks)lists what such a mod can approve, including when it can approve a call that a\n\n`deny` rule refuses.\nA mod can restyle much of Claude Code’s interface, but not the permission prompt. It can’t change what a prompt shows you.\n### List what a mod does before you install one\n\nBefore you install a mod, you can list which events it hooks and what it asks Claude Code to do, such as read a file or make a network request, without running it. Get the plugin’s files first, for example by cloning its repository. Then, in your shell, run`claude plugin validate` on the plugin’s directory:\n`hooks:` and `calls:` lines in the output list the events the mod handles and what it asks Claude Code to do. [Review what a mod can do](https://code.claude.com/docs/en/plugins/mods/admin#review-what-a-mod-can-do)shows the output and which calls to look for.\n\n## Turn mods on or off\n\nMods require Claude Code v2.1.287 or later, and they’re on by default. In your shell, run`claude --version` to check, and update Claude Code if yours is older.\nTo turn mods off, choose how many to stop, and for how long. To turn them back on, undo the same change:\n- **One mod** : disable or uninstall its plugin from the[**Installed** tab in `/plugin`](https://code.claude.com/docs/en/plugins/install#manage-installed-plugins)\n- **Every installed mod, for one session** : start Claude Code with[`--safe-mode`](https://code.claude.com/docs/en/cli-reference#cli-flags) , which also leaves out your other customizations\n- **Every mod you installed, in every session** : set[`\"disableAllHooks\": true`](https://code.claude.com/docs/en/settings-reference#disableallhooks) in`~/.claude/settings.json` . Your settings hooks and custom status line stop too. What your organization manages keeps running.\n\n[Stop user-installed mods from loading](https://code.claude.com/docs/en/plugins/mods/admin#stop-user-installed-mods-from-loading). To find out whether mods can load for you, see\n\n[Check whether mods can load](https://code.claude.com/docs/en/plugins/mods/troubleshoot#check-whether-mods-can-load).\n\nIf you set \n\n`CLAUDE_CODE_ENABLE_FUNCTION_HOOKS` during early access, remove it. Claude Code v2.1.287 and later ignores it, so setting it to `0` doesn’t keep mods off.\n### See which mods a session loaded\n\nTo see which mods a terminal session loaded, run`/plugin` at the Claude Code prompt. A dim line under the tabs gives the count and the names, such as `1 mod active · first-mod`. If a mod you installed isn’t named there, see [Find out why a mod does nothing](https://code.claude.com/docs/en/plugins/mods/troubleshoot#find-out-why-a-mod-does-nothing).\n\n## How a mod works\n\nA mod is a\n[plugin](https://code.claude.com/docs/en/plugins/overview)whose code registers event handlers, called hooks. Claude Code runs a hook when its event happens, such as when Claude calls a tool or when the spinner is drawn. A small mod has three files:\n\n- **`plugin.json`** : the plugin’s[manifest](https://code.claude.com/docs/en/plugins/manifest-reference)\n- **`hooks.json`** :[points to your code file](https://code.claude.com/docs/en/plugins/mods/reference#files)\n- **`register.js`** :[your code](https://code.claude.com/docs/en/plugins/mods/create#write-a-mod-yourself) , called the hooks module. It tells Claude Code which events to run your functions on.\n\n`register.js`. It counts the tool calls Claude makes and shows the count beside the spinner while Claude works, as in `Thinking · tool calls: 3…`.\nhooks/register.js\n\n`calls` variable at the top:\n- **The [`tool.call`](https://code.claude.com/docs/en/plugins/mods/reference#tools) hook** runs each time Claude is about to use a tool. It adds one to`calls` , asks Claude Code to draw the interface again, and lets the tool run as usual.\n- **The [`ui.render`](https://code.claude.com/docs/en/plugins/mods/reference#interface) hook** runs each time Claude Code draws the spinner. It keeps Claude Code’s own spinner and adds the count after the word.\n\n`Thinking · tool calls: 1…`, then `2…`, then `3…`.\n### What a hook can do with an event\n\nClaude Code runs your hook before it acts on the event, so the hook decides what happens next. It has three choices:\n- **Observe** : note what’s happening and let it continue unchanged, as the`tool.call` hook in the example does\n- **Rewrite** : change the event before it continues, as the`ui.render` hook does when it adds the count to the spinner\n- **Answer** : handle the event itself, so the usual behavior doesn’t run, such as refusing a command\n\n[list what a mod does](#list-what-a-mod-does-before-you-install-one)before you install it. For the code behind each choice, see\n\n[React to events](https://code.claude.com/docs/en/plugins/mods/events#how-a-hook-handles-an-event). For what a hook can call, see\n\n[Use the mods API](https://code.claude.com/docs/en/plugins/mods/api).\n\n### Where mods run\n\nA mod’s hooks run in every kind of session that loads the plugin. Drawing is narrower: only the terminal and the Desktop app show a mod’s panes, bands, and replaced rows. This table lists each place you might run Claude Code:\nA mod that draws can check which app it’s running in, and fall back to a line in the transcript or a command’s text reply where nothing draws.\n\n## Control mods for your organization\n\nAdministrators decide whether mods run and which ones, through\n[managed settings](https://code.claude.com/docs/en/managed-settings).\n\n[Manage mods for your organization](https://code.claude.com/docs/en/plugins/mods/admin)covers what happens by default, how to review a mod, and how to enforce a policy with a mod of your own.\n\n## Compare mods, settings hooks, skills, and MCP servers\n\nMods, settings hooks, skills, and MCP servers overlap. This table shows what each one is and when to pick it.\nEach of the others has its own page: \n\n[Hooks](https://code.claude.com/docs/en/hooks),\n\n[Skills](https://code.claude.com/docs/en/skills), and\n\n[MCP](https://code.claude.com/docs/en/mcp). A plugin can hold all four, so a mod can ship in the same plugin as a skill and an MCP server.\n\n## Mods built into Claude Code\n\nSome of Claude Code’s own features are mods. To see the ones your session has, run`/plugin` at the Claude Code prompt and go to the **Installed** tab, which lists them under\n\n**Built-in**. You can’t update or uninstall a built-in mod, and the table’s last column says how to turn each one off. The\n\n[leaves built-in mods out. This table lists each entry by the name](#see-which-mods-a-session-loaded)\n\n`mods active` line`/plugin` shows:\nThe settings and flags that stop installed mods, such as \n\n`disableAllHooks`, `--bare`, and `--safe-mode`, don’t stop built-in mods.\n### Read the source of built-in mods\n\nThe source of four of these mods is public in the\n[. Each one is a complete plugin with its hooks module and tests:](https://github.com/anthropics/claude-code/tree/main/mods)\n\n`mods` directory of the Claude Code repository\n- [`diff`](https://github.com/anthropics/claude-code/tree/main/mods/diff) : the`/diff` pane, with buttons bound to keyboard actions and scrolling the mod handles itself\n- [`agents-md`](https://github.com/anthropics/claude-code/tree/main/mods/agents-md) : loads`AGENTS.md` as project instructions, with a[`userConfig`](https://code.claude.com/docs/en/plugins/components#user-configuration) option\n- [`sec-default`](https://github.com/anthropics/claude-code/tree/main/mods/sec-default) : the guard described in[Know what happens by default](https://code.claude.com/docs/en/plugins/mods/admin#know-what-happens-by-default) , a model for a mod that enforces policy\n- [`telemetry`](https://github.com/anthropics/claude-code/tree/main/mods/telemetry) : adds methods that other mods can call, and ships their types\n\n## Next steps\n\n- [Create a mod](https://code.claude.com/docs/en/plugins/mods/create) : build one that counts tool calls, shows the count beside the spinner, and adds a command, and learn the edit and reload loop\n- [Draw in the interface](https://code.claude.com/docs/en/plugins/mods/interface) : panes, the band above the prompt, buttons, text fields, and state\n- [React to events](https://code.claude.com/docs/en/plugins/mods/events) : tool calls, prompts, turns, and the order mods run in\n- [Use the mods API](https://code.claude.com/docs/en/plugins/mods/api) : commands, tools, model calls, timers, and files\n- [Test a mod](https://code.claude.com/docs/en/plugins/mods/test) : automated tests that run without a session\n- [Troubleshoot a mod](https://code.claude.com/docs/en/plugins/mods/troubleshoot) : the reasons a mod does nothing, and the debug log\n- [Manage mods for your organization](https://code.claude.com/docs/en/plugins/mods/admin) : defaults, managed settings, reviewing a mod, and policy mods\n- [Mods reference](https://code.claude.com/docs/en/plugins/mods/reference) : every event, method, element, and limit", "url": "https://wpnews.pro/news/claude-code-mods-plugins-may-now-modify-deeper-behavior", "canonical_source": "https://code.claude.com/docs/en/plugins/mods/overview", "published_at": "2026-10-01 19:08:41+00:00", "updated_at": "2026-10-01 19:17:01.930691+00:00", "lang": "en", "topics": ["ai-products", "ai-tools", "developer-tools", "ai-agents"], "entities": ["Anthropic", "Claude Code", "token-chart", "MCP", "VS Code"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/claude-code-mods-plugins-may-now-modify-deeper-behavior", "markdown": "https://wpnews.pro/news/claude-code-mods-plugins-may-now-modify-deeper-behavior.md", "text": "https://wpnews.pro/news/claude-code-mods-plugins-may-now-modify-deeper-behavior.txt", "jsonld": "https://wpnews.pro/news/claude-code-mods-plugins-may-now-modify-deeper-behavior.jsonld"}}