Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By danieliserv1.2.1MIT
Event-driven extensibility for Claude Code — fire named events, registered listeners respond with shell scripts, templates, or MCP tool calls. Supports conditional listeners (when:), listener chaining (pipelines), CLI debugging, and namespaced debug logging.
Run automatically on Claude Code events. Claude doesn't decide.
No risk signals detected
Nothing flagged in this plugin's hooks, MCP servers or commands. Other components are not analyzed.
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
claude-code, mcp, events, hooks, plugins, extensibility, agent
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Event-driven extensibility for Claude Code plugins. Fire named events, registered listeners respond with shell output, template content, or MCP tool call instructions (experimental).
Here's agent-hooks in action, injecting KB update tasks based on project context.

# From npm
npm install @danieliser/agent-hooks
# Or add to your Claude Code plugin marketplace
npx agent-hooks init
This creates:
.claude/agent-hooks.yml — starter config with commented examplesscripts/on-event.sh — example shell listenerEvery emit() call requires user approval unless you allow it. Add to .claude/settings.local.json:
{
"permissions": {
"allow": [
"mcp__plugin_agent-hooks_agent-hooks__*"
]
}
}
Or granular:
{
"permissions": {
"allow": [
"mcp__plugin_agent-hooks_agent-hooks__emit",
"mcp__plugin_agent-hooks_agent-hooks__has_listeners"
]
}
}
Edit .claude/agent-hooks.yml:
events:
session.lifecycle.start:
- name: project-context
type: template
path: .claude/templates/context.md
priority: 5
From any Claude Code plugin or agent:
emit(event: "session.lifecycle.start", data: { git_branch: "main" })
Agent → emit("domain.entity.action", data)
↓
MCP Server (agent-hooks)
↓
Config lookup → matched listeners (sorted by priority)
↓
Execute each: shell | template | mcp instructions
↓
Return merged results to agent
emit() with an event name and optional data payloademitFire a named event. Returns listener results and any MCP call instructions (experimental).
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
event | string | yes | — | Event name in dot-notation snake_case |
data | object | no | {} | Event payload (max 10KB) |
timeout | integer | no | 5000 | Max wait time in ms |
mode | string | no | "sync" | "sync" waits for results; "async" fire-and-forget |
Sync response:
{
"event": "my.event",
"invocation_id": "evt-abc123",
"listeners_executed": 2,
"responses": [
{ "name": "listener-a", "status": "success", "result": { ... } },
{ "name": "listener-b", "status": "success", "result": { ... } }
],
"errors": [],
"duration_ms": 45
}
Async response:
{
"event": "my.event",
"invocation_id": "evt-abc123",
"mode": "async",
"listeners_enqueued": 2,
"status": "enqueued"
}
has_listenersCheck if listeners are registered for an event. Fast, no side effects.
| Parameter | Type | Required | Description |
|---|---|---|---|
event | string | yes | Event name to query (no wildcards) |
Response:
{
"event": "my.event",
"has_listeners": true,
"listener_count": 2,
"priorities": [5, 10]
}
Config files are YAML. Both are optional:
.claude/agent-hooks.yml — project-specific listeners~/.claude/agent-hooks.yml — applies to all projectsWhen both exist, they deep-merge. Same-name listeners: project wins. Different names: both fire.
See docs/CONFIGURATION.md for the full schema reference.
Shell — Runs a subprocess. JSON on stdin, JSON on stdout.
- name: slack-notifier
type: shell
command: ./scripts/notify-slack.sh
priority: 20
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
Generated from the plugin's indexed repository (danieliser/agent-hooks) — no native marketplace selected
npx claudepluginhub p/danieliser-agent-hooksPlugins from other owners that cover similar ground