Create Hook logo

Create Hook

Community
lploc94
create-hook

Use when creating, editing, testing, selecting or sharing a Raw agent hook for session, turn or tool events. Covers raw.hook/2, gating, notifications, dashboard editing and packages.

Overview

Publisherlploc94
Repositoryraw-cli
Skill namecreate-hook
Stars
107
Forks
14
Bundled files
2
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 2 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by lploc94 on GitHub. Read the source before you install it.

Installation

Install the Create Hook AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/lploc94/raw-cli/tree/main/examples/skills/create_hook
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/lploc94/raw-cli.git /tmp/raw-cli
mkdir -p .claude/skills
cp -r /tmp/raw-cli/examples/skills/create_hook .claude/skills/create-hook
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Create Hook in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Create Hook on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Create Hook is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Create a Raw hook

A hook is a folder containing hook.json and an executable script. It belongs to one selected agent, not to every Raw session. Hooks run with the user's OS permissions. Create one only when the user wants an event-triggered action; tool policy rules remain the right place for simple allow/ask/deny matching.

Read references/packages.md for sharing and references/dashboard.md for browser editing, using read_file when relevant. The installed docs/hooks.md is the full protocol reference. Do not claim that raw.hook/2 implements another product's hook protocol.

Choose placement and event

Use ~/.config/raw/hooks/NAME/ with ID local/NAME, or hooks/NAME/ beside the selected config with ID agent/NAME. The folder name and manifest name must match, using lowercase letters, digits, _ or -, starting with a letter. The agent selects an ordered unique list: "hooks":{"use":["agent/guard"]}. No hook runs when the list is absent or empty. A package hook uses pkg/ALIAS/hooks/EXPORT.

Events: SessionStart, UserPromptSubmit, PreToolUse, PostToolUse, PostToolUseFailure, Stop, SessionEnd. Use UserPromptSubmit or PreToolUse to deny an action. Other events are notifications; they cannot change a completed result. SessionStart also fires on resume; SessionEnd means the current attachment closed. Post-tool events require an actual handler invocation; policy/approval denials do not fire them.

Manifest and script

hook.json requires name (string), events (nonempty array), and command (nonempty PATH command or a contained ./ executable). Optional args is a string array; ./ args resolve inside the hook folder. Optional timeout_ms is an integer 1..600000, default 60000; interrupting the run cuts a running observing hook to a 2-second cleanup window. Each event entry requires name; tool events may add match (canonical tool-ID glob with * and ?) and when:{"any":"schema.path[*].field","regex":"RE2 pattern"}. Both filters must match before Raw spawns the script. when must identify a string, number or boolean field in the selected tool's input schema (numbers and booleans match as text); command is valid for builtin/bash. match/when on non-tool events are invalid. Unknown fields are invalid. No shell expansion occurs in command or args.

json
{"protocol_version": 2, "name":"guard","events":[{"name":"PreToolUse","match":"builtin/bash","when":{"source": "arguments", "any":"command","regex":"(^|[;&|()\\n])\\s*rm(\\s|$)"}},{"name":"PostToolUseFailure","match":"builtin/bash"}],"command":"node","args":["./index.mjs"],"timeout_ms":5000}

Raw sends one UTF-8 JSON object on stdin with protocol_version:2, event, cwd, optional agent/session/turn IDs and event payload. A tool event has tool.identity, tool.name, tool.arguments, and a post-event may have tool.result. Respond with empty stdout or one JSON object. Exit 0 plus {"decision":"continue"} continues; {"decision":"deny","reason":"..."} or exit 2 denies a gate. A short message appears in host output. Malformed output, timeout, nonzero exit, spawn failure or overflow blocks a gate and warns on a notification. A continue decision cannot override tools.rules ask/deny. Raw records a bounded receipt; it does not log raw stdin/stdout by default. Selected folders are snapshotted (at most 256 regular files and 16 MiB total; links are rejected).

js
let input = "";
process.stdin.setEncoding("utf8");
process.stdin.on("data", chunk => input += chunk);
process.stdin.on("end", () => {
  const request = JSON.parse(input);
  if (request.event === "PreToolUse") {
    process.stdout.write(JSON.stringify({ decision: "deny", reason: "Review removal commands first" }));
  } else {
    process.stdout.write(JSON.stringify({ message: "Bash command failed" }));
  }
});

For notification-only behavior, select PostToolUse, Stop or SessionEnd and return an optional message. Keep side effects idempotent because a later user operation may invoke the hook again. Do not print incidental text to stdout; write diagnostics to stderr within the output limit.

Attach and verify

  1. Create the folder and files. Add the exact ID to agents.NAME.hooks.use while preserving other config and selection order. Keep the config file mode 0600. raw --config PATH config list checks config structure; it does not run a hook.
  2. In dashboard, use Library → Hooks to create, edit and validate the folder, then attach it to an agent. Save with the current revision. Inspect the event, matcher, command, args and timeout before activating. Browsing and installing are passive.
  3. Test a harmless matching and nonmatching call using the selected agent; inspect hook receipts in CLI or dashboard history. Check a gate denial, a notification, and a resume if the hook handles SessionStart. A changed hook selection takes effect on the next attach/turn; meaningful changes may rotate cache keys once.
  4. For distribution, export the agent or declare a hooks export in raw-package.json; pack/install/bind in an isolated recipient config, remove author paths, then test the selected hook. Report executable prerequisites such as node or python3.

Never assume a hook is sandboxed or that exit-0 approval bypasses policy. Preserve unrelated agents and selected components.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Create Hook AI skill do?

Use when creating, editing, testing, selecting or sharing a Raw agent hook for session, turn or tool events. Covers raw.hook/2, gating, notifications, dashboard editing and packages.

Why use Create Hook on TypingMind?

Because you install it once and use it with any model. Create Hook is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Create Hook in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/lploc94/raw-cli/tree/main/examples/skills/create_hook. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Create Hook?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Create Hook?

As many as you like. As long as a model supports skills, you can use Create Hook with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Create Hook AI skill free?

Yes. It is published on GitHub by lploc94 under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇