ratchet docs

Writing plugins

A plugin is a folder with a plugin file in it, and sometimes code and Claude extras. Say what should happen in the plugin file first, and reach for code only when the file can't say it.

On this pageQuick startThe template, file by fileFolder layoutThe plugin filePermissionsCode pluginsThe memory folderLimitsVersions and updatesPublish a pluginTest it on your PCExamples

Quick start

The Plugins page has a Make your own box with the path of the plugin guide that ships with ratchet, and Copy path. The easiest start is to ask Claude, for example make me a ratchet plugin that pings Slack when an agent finishes, and point it at that guide. A template folder, _template, sits next to the guide.

By hand:

  1. Copy the _template folder and rename the copy, for example to my-plugin.
  2. In its ratchet-plugin.json, set name to the same name.
  3. On the Plugins page, press Add plugin → Folder… and type the folder's full path.
  4. Open the plugin, press Review and allow, check the lines, and press Allow.

The template, file by file

ratchet-plugin.json:

{
  "name": "my-plugin",
  "version": "0.1.0",
  "description": "One line an owner can read at a glance in the Plugins list",
  "permissions": ["claude.extras", "events", "card.note", "code"],
  "main": "index.mjs"
}

index.mjs:

export default function (api) {
  api.on("agent.started", (event) => {
    api.note(event.agent.id, "hello");
  });
}

claude/.claude-plugin/plugin.json:

{
  "name": "my-plugin-extras",
  "description": "Claude skills, agents and hooks this plugin adds to every agent it applies to"
}

Once allowed, every new agent ratchet starts gets the note hello on its card, and the claude folder is loaded into it. Each permission is there for a reason: claude.extras because the claude folder exists, events for api.on, card.note for api.note, and code because the file sets main. Delete what you don't use.

Folder layout

my-plugin/
  ratchet-plugin.json   the plugin file (required)
  index.mjs             code, only when the plugin file sets "main"
  claude/               Claude extras in Claude Code's own plugin format
    .claude-plugin/
      plugin.json
    skills/  agents/  hooks/  commands/
  README.md             what the plugin does, for the person installing it

The name is 1 to 40 characters of lowercase letters, digits and dashes, starting with a letter or digit, for example slack-ping. Names starting with _ are reserved for ratchet and refused. It's the folder name under ~/.ratchet/plugins/, the settings key and the memory folder name. name in the plugin file must match that folder exactly. When you add a plugin from a folder, a git link or a pack, ratchet names the folder after name for you.

The plugin file

ratchet-plugin.json holds one JSON object:

FieldRequiredWhat it is
nameYesMust equal the folder name.
versionYesAny text, but use 1.2.3 form so updates work. See Versions and updates.
descriptionYesOne line, shown in the Plugins list.
noticeNoOne plain sentence on one line, 1 to 200 characters after trimming spaces, shown as a note in the plugin's detail on the PC and the phone, and on its update card when an update waits for Allow. Use it for something the owner should know before turning the plugin on, such as a Claude feature that stops working. It is never part of the Allow lines.
permissionsYesA list of permission names. No unknown names, no duplicates.
settingsNoFields the owner fills in, by key.
launchNoenv and args: changes to how Claude starts.
helperNoA program ratchet runs while the plugin is on.
setupNoPrograms to install and files to copy when the owner taps Set up. Needs the setup permission.
reactionsNoWhat to do on events, with no code.
mainNoA .mjs or .js file in the plugin folder: a relative path, no ...

If the file is wrong, ratchet refuses it and names the field, for example launch.args: must be a non-empty array of strings.

settings

"settings": {
  "port": { "type": "number", "label": "Proxy port", "default": 8787, "min": 1024, "max": 65535 },
  "token": { "type": "string", "label": "API token", "sensitive": true, "required": true },
  "telemetry": { "type": "boolean", "label": "Send usage statistics", "default": false },
  "model": { "type": "string", "label": "Model", "default": "sonnet", "choices": [{ "value": "sonnet", "label": "Sonnet" }, { "value": "glm", "label": "GLM", "requires": "token" }] }
}
  • type is string, number or boolean, and label is what the owner sees. Both are required.
  • default must match the type. min and max limit a number.
  • choices turns a string setting into a pick list. Each choice has a value and a label, values are unique, and default must be one of them. A choice with requires naming another setting is offered only once that setting has a value.
  • sensitive values are stored but never shown again: the owner sees set. Leaving the field empty keeps the stored value; the owner removes it with Clear, on the PC.
  • A required setting that is empty makes new agents start without the plugin, with needs setting: <label> on their card. Empty means never filled in with no default, cleared by the owner (the default does not come back), or only spaces.

Use a setting's value in launch.env, launch.args, helper.command, helper.env and helper.ready.url with ${settings.<key>}. An unknown key in launch.env or launch.args skips the plugin with unknown setting <key> on the card; in a helper field the helper fails to start. Keys are letters, digits and _ only, so ${settings.api-token} is left as written.

launch

"launch": {
  "env": {
    "ANTHROPIC_BASE_URL": "http://localhost:${settings.port}",
    "MY_FLAG": { "if": "telemetry", "then": "on", "else": "off" }
  },
  "args": ["--some-start-option"]
}

Launch changes apply to each new agent ratchet starts while the plugin is on and not off in that project. An env value is text, or { "if", "then", "else" } where if names a boolean setting. args are added to Claude's start options. Plugins apply in the owner's Order at launch; if two set the same env name, the later one wins and both rows show the clash.

Claude extras: the claude folder

A claude folder in Claude Code's own plugin format (skills, agents, hooks, commands) is loaded into each agent ratchet starts, with Claude Code's --plugin-dir option pointing at it. A skill shows up under the name from claude/.claude-plugin/plugin.json, for example waves-extras:wave-status. A plugin can be nothing but this:

{
  "name": "waves",
  "version": "0.1.0",
  "description": "Wave skills for Claude",
  "permissions": ["claude.extras"]
}

helper

From the Headroom plugin:

"helper": {
  "command": ["headroom", "proxy", "--port", "${settings.port}"],
  "env": { "HEADROOM_BEACON": { "if": "telemetry", "then": "on", "else": "off" } },
  "ready": { "url": "http://localhost:${settings.port}/health" },
  "requires": { "command": "headroom", "installHint": "uv tool install --python 3.13 \"headroom-ai[proxy]\"" }
}
  • ratchet starts command when the plugin is on (at start-up, on Allow, when switched on) and stops it when the plugin is switched off or removed, or ratchet exits.
  • requires is checked first. If requires.command isn't on the PATH, the row shows installHint and nothing starts. To let the owner install it with one tap, add a setup.
  • ready.url must be a plain http:// address on localhost, 127.0.0.1 or [::1]. ratchet asks it every second, for up to a minute. Until it answers, new agents start without this plugin.
  • env is added to ratchet's own environment for the helper. The helper's output goes to the plugin's log.
  • A helper that exits is restarted once. A second exit counts as a failure.

setup

"permissions": ["helper.run", "setup"],
"setup": {
  "about": "Downloads about 138 MB and takes about 1 minute.",
  "uninstallHint": "To delete Headroom: uv tool uninstall headroom-ai",
  "folders": ["~/.local/bin"],
  "steps": [
    {
      "label": "uv, the Python tool installer",
      "provides": "uv",
      "windows": ["powershell.exe", "-NoProfile", "-ExecutionPolicy", "Bypass", "-Command", "irm https://astral.sh/uv/install.ps1 | iex"],
      "mac": ["/bin/sh", "-c", "curl -LsSf https://astral.sh/uv/install.sh | sh"],
      "linux": ["/bin/sh", "-c", "curl -LsSf https://astral.sh/uv/install.sh | sh"]
    },
    { "label": "Headroom", "provides": "headroom", "all": ["uv", "tool", "install", "--python", "3.13", "headroom-ai[proxy]"] },
    { "label": "the jira-story skill", "copy": "skills/jira-story", "to": "~/.claude/skills/jira-story" }
  ]
}

A setup is a list of steps. An install step runs a command, then checks that the program it provides can be found. A copy step copies a file or folder from the plugin into the owner's home. Nothing runs until the owner taps Set up on the plugin's card. Turning the plugin on, Allow, starting an agent and updates never run a step. Allow lists this PC's command for every install step, and the label and destination of every copy step. Labels appear as you wrote them, so users read them as your words. A changed step needs a new Allow.

FieldRule
setupNeeds the setup permission. 1 to 10 steps.
setup.foldersOptional, 1 to 5 entries, each ~/… or an absolute path, no ... Searched for programs, and put first on the search path for the steps and the helper.
setup.about, setup.uninstallHintOptional, at most 200 characters.
label1 to 60 characters, unique within the setup.
Install stepprovides is a bare program name. Then either all, or any of windows, mac and linux, each a non-empty list of non-empty strings.
Copy stepcopy is a file or folder inside the plugin. to starts with ~/, has no .., and is not under ~/.ratchet.
EitherA step is one kind or the other, never both. No ${settings…} inside a step.
  • ~ is the owner's home folder.
  • An install step runs as written, with no shell in between. A step that needs a pipe starts a shell itself, as the uv step does. It runs in the home folder, with no window and no keyboard input.
  • Its output goes to the plugin's log with secrets hidden. Exit code 0 is success, and then provides must be found. A step over 15 minutes is stopped.
  • A step whose provides is already found is skipped. A step with no command for this PC's system cannot run, and the card says so.
  • A copy step never overwrites a file ratchet did not put there, nor one the owner changed since. Removing the plugin deletes only the unchanged files ratchet copied.
  • One setup runs at a time, and a failure never counts toward the three-failure limit.

reactions

"reactions": [
  { "on": "agent.finished", "do": "alert", "text": "{agent} finished on {branch}" },
  { "on": "agent.started", "do": "note", "text": "watching {branch}" },
  { "on": "agent.finished", "do": "run", "command": ["git", "status", "--short"] },
  { "while": "agents.working", "do": "awake" }
]
  • on is an event: ratchet.started, ratchet.stopping, agent.started, agent.working, agent.question, agent.permission or agent.finished. ratchet doesn't check the event name: a misspelled one never fires.
  • do is alert or note (with text), or run (with command, a list of words). There is no shell, so on Windows run .cmd tools such as npm as ["cmd", "/c", "npm test"].
  • In text, {agent} is the agent's label or name, {repo} is ratchet's id for the repo, {branch} its branch and {event} the event name.
  • A note needs an agent, so it can't react to ratchet.started or ratchet.stopping.
  • A run command runs in the agent's folder, or in the plugin's memory folder when the event has no agent. Its output goes to the plugin's log.
  • { "while": "agents.working", "do": "awake" } holds the PC awake while any agent in an open repo is working or waiting for you, including agents started outside ratchet, and lets it sleep when none are.
Keep reactions quick

Each reaction must finish within 5 seconds, or it counts as a failure. A command that can't start also counts. A command that ends with an error code does not.

Permissions

List every permission the plugin uses. ratchet works out what the plugin file needs and refuses a file that uses something it didn't ask for, for example uses run without asking for it. Any plugin can list more than its file needs. A plugin with code usually does, because only the code knows what it will call.

PermissionNeeded forAllow line
launch.envlaunch.envChanges settings Claude starts with
launch.argslaunch.argsAdds Claude start options
claude.extrasa claude folderAdds Claude skills, agents and hooks to your agents
helper.runhelperStarts a program
eventsany on reaction, api.on, api.everyReacts when agents start, wait or finish
card.notenote, api.noteShows notes on agent cards
alertalert, api.alertSends phone alerts
awakeawake, api.awakeKeeps the PC awake
runrun, api.runRuns commands
agent.startapi.agents.start, api.agents.usage, api.agents.find, api.agents.stopStarts new agents and stops its own
worktreeapi.worktrees.startCreates worktrees and branches
askapi.askAsks you to approve or reject steps
task.optionapi.tasks.offer, api.tasks.showAdds a choice to New task
setupsetupSets things up on this PC, or one line per step (see below)
codemainRuns its own code — trust it like any program you install

Some lines get more exact: launch.env that sets ANTHROPIC_BASE_URL reads Changes where Claude sends requests, and other env names are listed; launch.args and helper.run show the options and the command; a run reaction in a plugin without code shows its command. A setup with steps shows one line per step instead of Sets things up on this PC: Installs "Headroom", if it is missing, when you tap Set up: uv tool install --python 3.13 headroom-ai[proxy] for an install step, with this PC's command; Copies "<label>" to <destination> when you tap Set up for a copy step; and Looks for its programs in ~/.local/bin too when it has setup.folders.

Code plugins

Set main when the plugin file can't say what you need: reading a file an agent wrote, starting agents, adding a choice to New task, asking the owner. The file's default export is a function. ratchet calls it once with api when the plugin loads: at start-up, on Allow, when it's switched on, after an update, and again when the owner changes one of its settings.

Code runs inside ratchet

It runs in ratchet's own process, with ratchet's rights on the owner's PC. The Allow dialog says so, and the plugin is marked has code.

When a plugin has main, events go to its code only: its on reactions are not carried out. A while awake reaction still is.

The api object

api only has the members its allowed permissions unlock. Without the permission, the member is missing: "alert" in api is false.

MemberNeedsWhat it does
api.name, api.dataDir, api.settings, api.log(line)Always thereThe plugin's name, its memory folder, its setting values, and a line for its log.
api.cost(model, tokens, fast?)Always thereratchet's own Claude price in US dollars for these token counts ({ input, output, cacheRead, cacheWrite5m, cacheWrite1h }), or null for a model it doesn't know.
api.hideSecret(value)Always thereHides that value in every log line, the diagnostics text and crash reports, for example a key your code read itself.
api.on(type, handler)eventsCalls handler(event) for that event type.
api.every(ms, name)eventsSends a timer event named name every ms; anything under 10 seconds is raised to 10 seconds. Receive it with api.on("timer", ...).
api.note(agentId, text)card.noteOne note per plugin per agent card. A newer one replaces the older.
api.alert(text, agentId?)alertA phone alert, under the owner's alert rules.
api.awake.hold(), api.awake.release()awakeHolds the PC awake, or lets it go. Unloading the plugin lets it go.
api.run(command, cwd, timeoutMs?)runRuns command (a list of words) in cwd, 60 seconds by default. Resolves to { code, stdout, stderr }. It never rejects: a command that can't start or runs out of time resolves with code -1 and the reason in stderr. There is no shell, so on Windows run .cmd tools such as npm as ["cmd", "/c", "npm test"]. Output goes to the log.
api.agents.start({ repoId, cwd, prompt, label, model?, env?, task? })agent.startStarts an agent with your label on its card. Resolves to the agent. model is a model id of up to 80 letters, digits and . _ : [ ] -, passed to Claude as --model. env sets up to 32 environment settings for this one agent, each value up to 4096 characters, and null removes one; PATH, CLAUDE_CONFIG_DIR and RATCHET_* are refused. task names one of your own New task tasks, and cwd must then be that task's worktree.
api.agents.usage(agentId)agent.startThat agent's token use per model and ratchet's price for it, or null if it isn't listed.
api.agents.find(agentId)agent.startA fresh look at one agent, in the same shape as event.agent, or null if it isn't listed. An agent that is still starting shows as working.
api.agents.stop(agentId)agent.startStops an agent this plugin started. Resolves to true if it was running, false if it had already ended. Any other agent is refused.
api.worktrees.start({ repoId, branch, prompt, label, model?, env? })worktreeMakes a worktree and branch and starts a labelled agent in it. Resolves to the agent. model and env work as in api.agents.start.
api.tasks.offer({ label, line, start })task.optionAdds your choice to New task. When the owner picks it, ratchet makes the worktree and calls start(request) with { taskId, repoId, prompt, cwd, branch }. start must resolve to the first agent it starts, within 60 seconds. label is one line of 1 to 40 characters, line one line of up to 120.
api.tasks.show(taskId, { stage, note?, links?, details? })task.optionSets the task's card: a stage of up to 32 characters, an optional note of up to 120, up to 4 links to files in the task's worktree (labels up to 40) and up to 6 detail lines of up to 120. Each is one line.
api.ask({ agentId, question, feedback? })askAsks the owner Approve or Reject on that agent. Resolves to the question's id. The answer comes as an ask.answered event. With feedback, a prompt of up to 40 characters, Reject asks the owner for one line of feedback, and the answer carries it.

Events

EventShape
ratchet.started, ratchet.stopping{ type }
agent.started, agent.working, agent.question, agent.permission, agent.finished{ type, agent: { id, repoId, name, label, plugin, cwd, branch, status, model } }
timer{ type, name }
ask.answered{ type, ask: { id, plugin, agentId, question, at, answer, feedbackPrompt, feedback } }, where answer is "approve" or "reject"
  • Agent events are only for agents ratchet started. label and plugin are null unless a plugin started the agent. status is working, waiting or done. model is the agent's model id, or null when it isn't known.
  • In ask.answered, feedbackPrompt is the feedback you passed to api.ask, and feedback is the line the owner wrote when rejecting. Both are null otherwise.
  • ratchet looks at its agents about every 10 seconds. An agent first seen already done still sends agent.started, then agent.finished. Opening a repo can send these once for its finished agents, so make handlers safe to run twice.
  • Each event reaches each plugin once. A slow plugin doesn't hold up other plugins or the agent.
  • An answer given while the plugin wasn't loaded arrives the next time it loads, even after a restart.

The 5 second limit

Every call into a plugin (the load, each handler, each timer) is cut off after 5 seconds. The one exception is the start function of a New task choice, which gets 60 seconds. A throw, a rejected promise and a timeout each count as one failure, and 3 in a row turn the plugin off. The work you started may carry on, but it still counts. So don't await slow work inside a handler: start it, and handle the result when it comes.

api.on("agent.finished", (event) => {
  const command = process.platform === "win32" ? ["cmd", "/c", "npm test"] : ["npm", "test"];
  api
    .run(command, event.agent.cwd, 10 * 60 * 1000)
    .then((r) => api.log(r.code === -1 ? "tests did not run: " + r.stderr : "tests exited with " + r.code));
});

Example: plan, build, approve, merge

A code plugin that waits for a planning agent, starts a labelled lane agent in its own worktree, asks the owner before merging, and keeps its place in the memory folder so a restart doesn't lose it. Permissions: events, worktree, ask, agent.start and code.

import { existsSync, readFileSync, writeFileSync } from "node:fs";
import path from "node:path";

export default function (api) {
  const file = path.join(api.dataDir, "flow.json");
  const load = () => (existsSync(file) ? JSON.parse(readFileSync(file, "utf8")) : {});
  const save = (flow) => writeFileSync(file, JSON.stringify(flow));

  api.on("agent.finished", async (event) => {
    const agent = event.agent;
    const flow = load();
    if (agent.plugin === null && !flow.started && existsSync(path.join(agent.cwd, "plan.md"))) {
      save({ started: true, repoId: agent.repoId, mainCwd: agent.cwd });
      api.worktrees
        .start({ repoId: agent.repoId, branch: "lane-a", prompt: "Build step A of plan.md", label: "lane a" })
        .catch((err) => api.log("lane a did not start: " + err.message));
      return;
    }
    if (agent.label === "lane a" && !flow.askId) {
      const askId = await api.ask({ agentId: agent.id, question: "Lane a is done. Merge it?" });
      save({ ...flow, askId });
    }
  });

  api.on("ask.answered", (event) => {
    const flow = load();
    if (event.ask.id !== flow.askId || event.ask.answer !== "approve") return;
    api.agents
      .start({ repoId: flow.repoId, cwd: flow.mainCwd, prompt: "Merge the lane-a branch", label: "merge" })
      .catch((err) => api.log("merge did not start: " + err.message));
  });
}

The lane agent's card reads lane a with the plugin's name, its worktree says it was made by the plugin, and the question shows on the lane agent with Reject and Approve.

The memory folder

api.dataDir is ~/.ratchet/plugin-data/<name>/. It survives ratchet restarts and plugin updates, and is deleted only when the owner removes the plugin. Keep your progress there, like flow.json above. A run reaction on an event without an agent runs there too.

Limits

  • 5 seconds per call into a plugin, 60 seconds for a New task start; 3 failures in a row turn it off, with one phone alert. Any call that works resets the count.
  • A timer set to less than 10 seconds fires every 10 seconds.
  • A helper has a minute to answer its ready.url, and is restarted once.
  • The log keeps the last 200 lines, in memory only.
  • A pack fetched from a link can be at most 256 KB.
  • A plugin can't answer an agent's question or permission prompt, and Away mode never answers a plugin's question.
  • A plugin draws nothing of its own. Its settings, notes and Approve and Reject buttons are drawn by ratchet.

Versions and updates

ratchet offers an update when a git or pack plugin's link has a higher version in MAJOR.MINOR.PATCH form (a leading v is fine), for example 0.2.0 after 0.1.0. Raise version for every release you publish. A version that isn't in that form is never offered as an update, and pressing Update on the same version only says <name> is already at <version>.

ratchet compares the permission list of the new version with what the owner allowed:

  • Same or fewer permissions: the update applies as soon as the owner presses Update to <version>.
  • Anything new: the old version keeps running, and the owner sees Update 0.2.0 asks for more with Review and allow 0.2.0 and Stay on 0.1.0.

The same rule covers a plugin edited in place: if its file starts asking for more, it stops acting until the owner allows it again.

Publish a plugin

As a git repo. Put ratchet-plugin.json at the top of the repo, one plugin per repo, and share the link. ratchet clones it with the owner's own git login, so a private repo works for anyone who can clone it.

As a pack. A pack is a JSON file that lists plugins by git link. Share it as a file or an https:// link:

{
  "name": "team-pack",
  "plugins": [
    { "git": "https://github.com/your-team/ratchet-headroom.git" },
    { "git": "[email protected]:your-team/slack-ping.git", "ref": "main" }
  ]
}

ref is an optional branch or tag. ratchet installs from that ref and keeps checking it for updates. A plugin pinned to a tag stays on it. Changing the pack only affects new installs; to move an installed plugin, remove it and add the pack again. Each plugin in a pack asks for its own Allow. If one fails to install, the others still install and the error names the failing link.

Test it on your PC

  • Add it with Add plugin → Folder…. That copies it, so to try a change either edit the installed copy in ~/.ratchet/plugins/<name>/, or remove the plugin and add it again.
  • ratchet reads the plugin file again whenever it lists plugins or starts an agent, so launch changes and reactions pick up edits. Switch the plugin off and on to reload its code and restart its helper.
  • Check the Allow dialog: every line should be something you meant.
  • Start an agent with New task and watch the plugin's Activity (Show all N lines opens the full log) and the agent's card. Use api.log to write your own lines.
  • Try the unhappy paths: a missing helper program, a required setting that was never filled in, a handler that throws. The agent should start anyway. A skipped launch shows on the agent's card, for example headroom skipped: not installed; a throw shows on the plugin's row as Problem: <message>.

Examples

Stay awake, shipped with ratchet. No settings, no code:

{
  "name": "stay-awake",
  "version": "0.1.0",
  "description": "Keeps the PC awake while any agent is working",
  "permissions": ["awake"],
  "reactions": [{ "while": "agents.working", "do": "awake" }]
}

Headroom, shipped with ratchet. A helper program and one environment setting:

{
  "name": "headroom",
  "version": "0.2.1",
  "description": "Shrinks long sessions by sending Claude through the Headroom proxy",
  "notice": "Claude's Remote Control does not connect in sessions Headroom runs in, so the Claude app can't drive them. ratchet's own phone access still works.",
  "permissions": ["launch.env", "helper.run", "setup"],
  "settings": {
    "port": { "type": "number", "label": "Proxy port", "default": 8787, "min": 1024, "max": 65535 },
    "telemetry": { "type": "boolean", "label": "Send usage statistics to Headroom", "default": false }
  },
  "launch": { "env": { "ANTHROPIC_BASE_URL": "http://localhost:${settings.port}" } },
  "setup": {
    "about": "Downloads about 138 MB and takes about 1 minute.",
    "uninstallHint": "To delete Headroom: uv tool uninstall headroom-ai",
    "folders": ["~/.local/bin"],
    "steps": [
      {
        "label": "uv, the Python tool installer",
        "provides": "uv",
        "windows": ["powershell.exe", "-NoProfile", "-ExecutionPolicy", "Bypass", "-Command", "irm https://astral.sh/uv/install.ps1 | iex"],
        "mac": ["/bin/sh", "-c", "curl -LsSf https://astral.sh/uv/install.sh | sh"],
        "linux": ["/bin/sh", "-c", "curl -LsSf https://astral.sh/uv/install.sh | sh"]
      },
      { "label": "Headroom", "provides": "headroom", "all": ["uv", "tool", "install", "--python", "3.13", "headroom-ai[proxy]"] }
    ]
  },
  "helper": {
    "command": ["headroom", "proxy", "--port", "${settings.port}"],
    "env": { "HEADROOM_BEACON": { "if": "telemetry", "then": "on", "else": "off" } },
    "ready": { "url": "http://localhost:${settings.port}/health" },
    "requires": { "command": "headroom", "installHint": "uv tool install --python 3.13 \"headroom-ai[proxy]\"" }
  }
}

Staged tasks, shipped with ratchet, is the full code example. It adds a New task choice with api.tasks.offer, starts, finds and stops its agents, prices their tokens with api.cost, and asks for approval with feedback. Its code is in the staged-task folder next to the plugin guide.

Done ping. A phone alert and a web hook call when an agent finishes, no code:

{
  "name": "done-ping",
  "version": "0.1.0",
  "description": "Pings the team hook and your phone when an agent finishes",
  "permissions": ["events", "alert", "run"],
  "reactions": [
    { "on": "agent.finished", "do": "alert", "text": "{agent} finished on {branch}" },
    { "on": "agent.finished", "do": "run", "command": ["curl", "-s", "-d", "text=agent finished", "https://example.com/hooks/builds"] }
  ]
}

New to plugins as a user? Start with Using plugins.

Written for ratchet 0.8.0.