Ai Hook banner
hughcube hughcube

Ai Hook

AI community

Description

Ultra-fast AI-agent hook dispatcher & autonomous rule engine (Rust + embedded QuickJS). Write guardrail rules once, run them across Claude Code, Google Antigravity, CodeBuddy and OpenAI Codex. Sandboxed, zero-dependency, ~2-3ms per tool call.

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

ai-hook — Unified Multi-Agent Security Interceptor & Autonomous Rule Dispatcher

[![CI](https://github.com/hughcube/ai-hook/actions/workflows/ci.yml/badge.svg)](https://github.com/hughcube/ai-hook/actions/workflows/ci.yml) [![Release](https://img.shields.io/github/v/release/hughcube/ai-hook)](https://github.com/hughcube/ai-hook/releases) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

**It exists for two things: hiding complexity, and making rules pleasant to write.** **① Hide the complexity** — hook-protocol differences across agents, platform quirks, and subprocess/context-fetching plumbing are all wrapped into one native binary: the same rules are written once and run everywhere, with no per-agent, per-platform script matrix. On Windows it also collapses the old one-process-per-fetch stutter into a single process with millisecond-scale in-process evaluation. **② Better rule authoring** — a rule is just plain JS: a rich `ctx` context, native microsecond `sys` primitives, one uniform deny/ask/inject decision protocol with desktop/terminal interaction, plus `list`/`test`/`bench`/`tutorial` tooling — instead of hand-written shell glue and cross-platform trial and error. Zero variable pollution, a single-process closed loop, and extreme speed all fall out of this design. Hooks for **Claude Code**, **Google Antigravity**, **CodeBuddy / WorkBuddy**, **OpenAI Codex**, **Gemini CLI**, **OpenCode** — one rule set, every agent, on Windows / macOS / Linux.

**OpenCode note:** OpenCode has no out-of-process hook protocol of its own — it loads in-process JS/TS plugins (see [opencode.ai/docs/plugins](https://opencode.ai/docs/plugins/)). ai-hook reaches it through the community bridge [`magarcia/opencode-claude-hooks`](https://github.com/magarcia/opencode-claude-hooks), which forwards Claude-Code-shaped envelopes and sets `OPENCODE_COMPAT=1`. Install the bridge (or use the in-process plugin appro