OpenClaw Hooks Crash Course - Gemma 4 Ollama 100% Local

Mervin Praison · Beginner ·🧠 Large Language Models ·12h ago
Create unlimited custom hooks in OpenClaw — running fully local with Ollama + Gemma 3n E2B In this video I show how to build a Telegram audit hook from scratch so OpenClaw sends a message to your Telegram every time someone runs /new, /reset, or /stop in the chat. Same pattern works for Slack, WhatsApp, webhooks, or any custom function you want to trigger. Everything runs locally on a Beelink Pro mini PC (AMD Ryzen 7 H255, 24GB RAM, 1TB SSD) with OpenClaw pre-installed and Gemma 3n E2B served via Ollama — small model, surprisingly strong performance for an edge device. https://www.bee-link.com/products/beelink-ser9-pro-amd-ryzen-7-h-255-openclaw?variant=48874933846258 https://openclaw-ai.com/en/docs/automation/hooks/ https://mer.vin/2026/05/openclaw-hooks-setup-guide/ What you'll learn What hooks are in OpenClaw and when to use them Setting up Ollama + Gemma 3n E2B on a local box SSH into a pre-installed OpenClaw device from your main machine Folder structure for a custom hook (handler.ts, package.json, hook.md) Wiring into command events (new, reset, stop) Other event types you can hook into: agent events, gateway events, message events Enabling the hook and restarting the gateway Testing the hook end-to-end with Telegram Honest notes This example uses Telegram because the integration is already there, but the handler.ts is where you can call literally anything — your own API, a webhook, a guardrail check, whatever. You can also use hooks defensively, e.g. block or audit reset/clear actions for security. Commands used ollama run gemma3n:e2b openclaw hooks list openclaw hooks enable telegram-audit openclaw gateway restart Folder structure ~/openclaw/hooks/telegram-audit/ ├── handler.ts ├── package.json └── hook.md Resources Beelink Pro (OpenClaw pre-installed): [link] OpenClaw install one-liner: [link] Full hook source code (handler.ts, package.json, hook.md): [link] OpenClaw docs — hooks & events: [link] Related videos OpenClaw + Telegram integration (ful
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Related AI Lessons

Hypothesis Generation for AI Translation Quality: How To Find What’s Worth Testing
Learn to generate hypotheses for AI translation quality using production data to identify areas worth testing and improve translation outcomes
Medium · LLM
Why Is Everyone Learning Python in the AI Era? The Answer May Surprise You
Learn why Python is the go-to language in the AI era and how it can benefit your career
Medium · Python
Why China Open Sources AI While America Keeps It Closed
Learn why China is open-sourcing AI while the US keeps it closed and what this means for the future of AI development
Medium · AI
Google's I/O 2024 announcements just reset the AI developer stack
Google's I/O 2024 announcements introduce new AI tools, resetting the developer stack and enabling more powerful AI applications
Dev.to · albe_sf
Up next
5 Levels of AI Agents - From Simple LLM Calls to Multi-Agent Systems
Dave Ebbelaar (LLM Eng)
Watch →