add-hook
CommunityExtend Renfield with async plugin hooks
Authorebongard
Version1.0.0
Installs0
System Documentation
What problem does it solve?
Enables developers to extend Renfield by registering asynchronous callbacks at well-defined lifecycle and message insertion points so external packages can inject context, post-process messages, add API routes, or register agent tools without modifying core code.
Core Features & Use Cases
- Async Hook Registration: Register async callbacks for events like startup, shutdown, register_routes, register_tools, post_message, post_document_ingest, and retrieve_context.
- Context Injection & Post-Processing: Inject additional LLM context during retrieval and run fire-and-forget post-processing for analytics, knowledge extraction, or moderation.
- Agent & API Extensions: Add custom agent tools to the Agent Loop and mount additional FastAPI routers for plugin functionality.
- Use Case: Implement a plugin that extracts entities from every chat exchange, supplies context from an external knowledge graph, and registers a custom agent tool to act on user intents.
Quick Start
Create an async register() that calls register_hook for the events you need and set the PLUGIN_MODULE environment variable to my_plugin.hooks:register so Renfield loads your plugin at startup.
Dependency Matrix
Required Modules
None requiredComponents
references
💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: add-hook Download link: https://github.com/ebongard/renfield/archive/main.zip#add-hook Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.