Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Scaffolds, builds, ships, and edits Vellum plugins that bundle hooks, tools, and skills into one installable package.
23% 95%+73 ptsof test cases passed
Passed 21 of 22 test cases with the skill, and 5 of 22 without it.
This test ran on v1. v2 is the current version and hasn’t been tested on gemini-3.6-flash yet.
3 of 3 safety checks passed
Not used yet
Run your own code at fixed points in a turn. Hooks let a plugin read or transform what flows through the Assistant without forking the core loop.
A hook is a function that the Assistant calls at a known boundary in its lifecycle. The harness owns the loop, and your code runs at named points along the way. Each hook lives in its own file under hooks/<name>.ts, and the filename is the hook name.
Hooks load from two places. Inside a plugin they live under <plugin>/hooks/<name>.ts. You can also drop a standalone hook directly under <workspace>/hooks/<name>.ts — no package.json, no plugin scaffolding, just the hook file. Standalone workspace hooks behave identically to plugin hooks (same contexts, same init/shutdown lifecycle); for a given event, plugin hooks run first and the workspace hook runs last.
The loop moves a conversation turn through a series of lifecycle events. The hooks are the places your code can run as the turn moves from one event to the next.
| Node | What it means |
|---|---|
| User prompt | The incoming user message that kicks off a turn. The user-prompt-submit hook fires as the prompt enters the loop. |
| Context check | Decides whether the conversation fits within the model's context window. If it does not, control branches to Compaction before the model is called. |
| Model call | The inference request sent to the LLM. The pre-model-call hook fires immediately before the request is dispatched. |
| Model response | The raw output returned by the model. The post-model-call hook fires here, and the loop branches based on what the model returned: a tool call, a continuation, a stop, or a context error. |
| Assistant reply | The final message delivered to the user. The stop hook fires just before the reply is sent, marking the end of the turn. |
| Compaction | Summarizes or truncates older conversation history so the context fits within the model's window. The post-compact hook fires after compaction, and control returns to the Model call node. |
| Tool result | The output of a tool execution. The post-tool-use hook fires here, and the result loops back to the merge junction for another model call. |
The loop can iterate several times within a single user turn: every tool result returns to a fresh model call, and a post-model-call hook can choose to continue rather than end the turn. Because of this, pre-model-call, post-model-call, and post-tool-use can each fire more than once per turn.
The Assistant also hooks into Lifecycle Events that sit outside the Agent Loop: init fires at bootstrap, shutdown fires at teardown, conversation-deleted fires after a conversation is deleted from storage, and message-deleted fires after a single message row is deleted.
These are the lifecycle hooks. The full set of wired hook names lives in the HOOKS constant.
initContext: InitContext
When: Once, when the plugin is first registered (on boot or install).
Use it to: Validate config and open resources. This is where plugin-owned storage is set up: create data files under pluginStorageDir and apply the plugin's own schema, idempotently — init runs on every boot. Throwing aborts the plugin's load.
Example: image-fallback
| Field | Type | Access | Description |
|---|---|---|---|
config | unknown | Read-only | Parsed config for this plugin, read from <pluginDir>/config.json. |
Next to this one in the catalogue, plus more from the same author.