Follow Discord
Sweep 03 Dec 2026 · 19:13Z Build v2.1.336 553 read Stable v2.1.332 Latest v2.1.336 Next v2.1.336 Feeds RSS JSON llms.txt llms-full.txt Unofficial
One change · claude-code

Use the mods API changedplugins/mods/api

Nearest release: v2.1.336, published an hour after 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 3 Dec 2026 17:07 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 3 Dec 2026 17:37 UTC.

Upstream edited
Recorded here
Lines+5added
Lines−1removed
From line 38 where the diff opens
First seen 1 Oct 2026 this site's first read of the page
Recorded edits25to this page, all time

#### Set the exit code of a non-interactive run

The whole hunk

from line 38, old and new numbered
/
lines
from line 38
3838 
3939To print a command's text without Claude reading it, return `{ text, isTextDisplayOnly: true }` from a hook that doesn't call [`next`](https://code.claude.com/docs/en/plugins/mods/reference#the-hook-function), and leave `immediate` off the registration. Otherwise, or before v2.1.326, Claude can read the text.
4040 
41#### Set the exit code of a non-interactive run
42 
43To set the exit code when you run `claude -p "/standup"` in your shell, return an `exitCode` field from the `command.run` hook, as an integer from 0 to 255. Make the command the whole prompt, and return from the hook without calling [`next`](https://code.claude.com/docs/en/plugins/mods/reference#the-hook-function). If you pass [`--output-format stream-json`](https://code.claude.com/docs/en/cli-reference#cli-flags), Claude Code ignores the field.
44 
4145### Add a tool
4246 
4347A tool is for Claude. Register it with a name, a description Claude reads, and a JSON Schema for its input. Claude sees it under a longer name made of `mcp__`, your plugin's name, two underscores, and the name you registered. You handle its calls in a [`tool.call`](https://code.claude.com/docs/en/plugins/mods/events#guard-or-change-a-tool-call) hook filtered to that full name. This example, from a plugin named `my-mod`, registers `ticket`, so the full name is `mcp__my-mod__ticket`. It gives Claude a tool that looks up a ticket in an issue tracker:
from line 428
424428Files, processes, and requests have a few rules of their own:
425429 
426430* **Paths**: in `$.fs` and `$.process`, a relative path resolves against the working directory of the session, or of the subagent whose event the hook is handling
427* **`$.fs.list`**: returns one directory's entries as `{ name, kind, size, isLink }` and isn't recursive
431* **`$.fs.list`**: returns one directory's entries as `{ name, kind, size, isLink, mtimeMs }` and isn't recursive. The `mtimeMs` field is a file's modification time in milliseconds since the epoch, or `0` for any other kind of entry.
428432* **`$.process.run`**: takes an argument list and uses no shell. It resolves to `{ exitCode, stdout, stderr }` whatever the exit code. It rejects if the program can't start or is still running at the timeout, which is 30 seconds by default, so wrap it in `try` and `catch`.
429433* **`$.http.fetch`**: follows up to five redirects. On a redirect to a different origin, it keeps only the `accept`, `accept-language`, `content-type`, and `user-agent` request headers you set and drops the rest, so a request that depends on another header, such as `Authorization`, can fail after that redirect. The [limits](https://code.claude.com/docs/en/plugins/mods/reference.md#limits) give its timeout and body sizes.
430434 
Feedback