Create a mod changedplugins/mods/create
Nearest release: v2.1.333, published 2 hours before upstream edited the page. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.
Upstream edited this page at 30 Nov 2026 21:16 UTC, give or take a minute or two: the time comes from Anthropic’s own sitemap rather than from a commit. This site recorded the change at 30 Nov 2026 21:37 UTC.
Upstream edited
Recorded here
Lines+5added
Lines−5removed
From line
33
where the diff opens
First seen
1 Oct 2026
this site's first read of the page
Recorded edits19to this page, all time
The whole hunk
from line 33, old and new numbered
/
from line 33
3333
3434Choose one of these answers:
3535
36* **Turn them on**: the mods in the session's mods folder load when the turn ends, and reload at the end of each turn that changes them. Your answer lasts for the session, including after you resume it.
36* **Turn them on**: the mods in the session's mods folder load when the turn ends, and reload at the end of each turn that changes their code. Your answer lasts for the session, including after you resume it.
3737* **Not now**: nothing loads for now. The files stay where Claude wrote them, and the mods load the next time that session starts. To keep a mod from ever loading, delete its directory.
3838
3939**3. Check that the mod loaded**
from line 42
4242
4343**4. Try the mod**
4444
45Use what you asked for. For the example prompt, the current branch name appears above the prompt box. If the mod doesn't do what you wanted, tell Claude what to change. The mod reloads at the end of each turn that changes its files, so you can try the change as soon as Claude finishes.
45Use what you asked for. For the example prompt, the current branch name appears above the prompt box. To adjust the mod, tell Claude what to change. The mod reloads at the end of each turn that changes its code, so you can try the change as soon as Claude finishes.
4646
4747If a transcript line that starts with the mod's name says the [change didn't load](https://code.claude.com/docs/en/plugins/mods/troubleshoot.md#this-mods-change-didnt-load), paste that line into your next message when you ask Claude for a fix. Claude doesn't see the line unless you paste it.
4848
from line 239
239239* **Answer**: the `command.run` hook returns its own result and never calls `next`. The second argument to `on`, `{ command: 'tally' }`, is a filter, called a [matcher](https://code.claude.com/docs/en/plugins/mods/events.md#filter-which-events-a-hook-handles), so the hook runs only for `/tally`.
240240* **Rewrite**: the `ui.render` hook calls `next` with a copy of `e` whose `suffix` holds the count, so Claude Code draws its usual spinner with your text after the word
241241
242Claude Code watches a directory loaded with `--plugin-dir` and hot-reloads the hooks module when a file in it changes. Each reload runs `register` again, so `calls` resets to `0` and `/tally` starts counting again. To keep a value across reloads, see [Keep state](https://code.claude.com/docs/en/plugins/mods/interface.md#keep-state).
242When you change the hooks module's code during an interactive `--plugin-dir` session, Claude Code hot-reloads the module. Each reload runs `register` again, so `calls` resets to `0` and `/tally` starts counting again. To keep a value across reloads, see [Keep state](https://code.claude.com/docs/en/plugins/mods/interface.md#keep-state).
243243
244244## Keep working on a mod
245245
from line 255
255255
256256Then ask for the change, for example `add a /tally-reset command to this mod that sets the tally back to zero`. Claude edits the hooks module, runs `claude plugin validate`, and fixes what it reports. A directory you load with `--plugin-dir` is a [protected path](https://code.claude.com/docs/en/permission-modes.md#protected-paths), so in `default` and `acceptEdits` modes you're asked to approve each of Claude's edits to the mod. The protected paths table gives the result for the other permission modes.
257257
258Files Claude saves during its turn reload when the turn ends, so you can try `/tally-reset` as soon as Claude finishes.
258The mod reloads when Claude's turn ends, so you can try `/tally-reset` as soon as Claude finishes.
259259
260260### Get type definitions for your version
261261
from line 265
265265| :- | :- |
266266| `claude-code/index.d.ts` | Every event and its input and result, every mods API namespace and method, and the elements each surface can draw |
267267| `claude-code-tools/index.d.ts` | The built-in tools' inputs and results, so that checking `e.tool === 'Bash'` narrows `e` |
268| `claude-code-mcp/index.d.ts` | The inputs of the MCP tools that were connected the last time you saved a file in the mod |
268| `claude-code-mcp/index.d.ts` | The inputs of the session's MCP tools, updated when the mod hot-reloads with a server connected |
269269| `index.d.ts` in a directory named for a plugin | What that plugin adds to the mods API. There's one directory for each plugin your `plugin.json` lists under `dependencies`. |
270270| `tsconfig.json` | Compiler options that fit a hooks module |
271271
No line in this hunk matches that.