Clooks: A Persistent Hook Runtime for Claude Code

✍️ OpenClawRadar📅 Published: April 2, 2026🔗 Source
Clooks: A Persistent Hook Runtime for Claude Code
Ad

Performance Problem and Solution

As Claude Code pipelines grow more robust, hook counts can increase from 2-3 lightweight checks to 50+ handlers across SessionStart, PreToolUse, PostToolUse, and Stop events. Each hook typically spawns a fresh Node or Python process, creating latency from pure spawning overhead that accumulates per session.

Clooks solves this by providing a persistent HTTP daemon that handles hook dispatch without process spawning. Since Claude Code already supports HTTP hooks natively, Clooks gives you a daemon worth pointing them at.

Performance Benchmarks

From the source benchmarks:

  • Single invocation: ~34.6ms → ~0.31ms
  • Full session (120 calls): ~3,986ms → ~23ms
Ad

Core Features

  • clooks migrate: Converts existing hooks automatically with one command, no rewriting required
  • LLM handlers: Call Claude directly from hook config with prompt templates and variables like $TRANSCRIPT, $GIT_DIFF, $ARGUMENTS
  • Batch grouping: Handlers with the same batchGroup share a single API call
  • Dependency resolution: depends: [other-handler] syntax with topological sorting into parallel execution waves
  • Plugin system: Package reusable hook sets as clooks-plugin.yaml, install with clooks add
  • Hot reload: Edit the manifest, daemon picks it up instantly
  • Metrics + cost tracking: clooks stats shows what's firing, clooks costs tracks LLM spend

Getting Started

Install with: npm install -g /clooks

Then run: clooks migrate

Current version is v0.5, actively developed with rough edges. The tool is open to contributions.

📖 Read the full source: r/ClaudeAI

Ad

👀 See Also

Hubcap Bridge: Persistent Two-Way Messaging Between CLI and Browser JavaScript via CDP
Tools

Hubcap Bridge: Persistent Two-Way Messaging Between CLI and Browser JavaScript via CDP

Hubcap Bridge is a new feature in the Hubcap CLI tool that creates a persistent two-way message channel between local processes and JavaScript running in browser pages via the Chrome DevTools Protocol. It enables Claude Code skills to interact with web apps through their internal JavaScript APIs without requiring public API access.

OpenClawRadar
Claude Code Lazy-Loads Tool Schemas via ToolSearch to Save Tokens
Tools

Claude Code Lazy-Loads Tool Schemas via ToolSearch to Save Tokens

Claude Code defers tool schema loading by sending only tool names upfront and requiring a ToolSearch call to fetch schemas before use. This architecture cuts token burn significantly.

OpenClawRadar
LLMock: HTTP-based mocking server for deterministic LLM testing across processes
Tools

LLMock: HTTP-based mocking server for deterministic LLM testing across processes

LLMock is a real HTTP server that mocks OpenAI, Claude, and Gemini APIs, allowing developers to run deterministic tests across multiple processes without hitting real APIs. It supports SSE streaming, tool calls, predicate routing, and request journaling with zero dependencies.

OpenClawRadar
Mnemos: Open-Sourced Local-First Memory Layer for Coding Agents
Tools

Mnemos: Open-Sourced Local-First Memory Layer for Coding Agents

Mnemos is a local-first memory layer for solo coding-agent workflows that addresses common memory system failures like scope bleed, stale facts, and unbounded transcript growth. The public beta includes SQLite starter profiles, MCP support for Claude Code/Desktop, and a biomimetic pipeline with components like SurprisalGate and MutableRAG.

OpenClawRadar