Documentation Index
Fetch the complete documentation index at: https://ulpi.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
8 Lifecycle Hooks for Perfect AI Agent Coordination
Your AI agents work in isolation. They overwrite each other’s changes. Critical context disappears before compaction. Important messages get missed. ULPI Hooks fixes all of this—automatically.Zero Merge Conflicts
Context Preserved
Never Miss Messages
Clean Shutdowns
The Problem: AI Assistants Work in Silos
You’ve experienced this frustration working with multiple AI coding assistants:- Constant merge conflicts when two agents edit the same file
- Lost context when Claude compacts your conversation history
- Missed urgent messages from other agents on your team
- Orphaned file locks when sessions crash without cleanup
- No coordination between Claude Code, Cursor, and other tools
The Solution: Deep Lifecycle Integration
ULPI Hooks intercepts 8 critical lifecycle events in your AI coding assistant and enables:- Without Hooks
- With ULPI Hooks
The Chaos of Uncoordinated Agents
File Conflicts:- Agent A edits
auth.ts - Agent B edits
auth.tsat the same time - Merge conflict requires manual resolution
- 15 minutes lost
- Important architecture decision discussed
- Context approaches token limit
- Claude compacts conversation
- Decision details lost forever
- Must re-explain from scratch
- Security issue found by Agent A
- Agent B doesn’t see the urgent message
- Deploys vulnerable code
- Critical bug reaches production
8 Strategic Lifecycle Hooks
Each hook intercepts a critical moment in your AI assistant’s lifecycle:🚀 session-start: Register Agent & Load Context
🚀 session-start: Register Agent & Load Context
- Automatic agent registration with ULPI Coordination
- Display coordination dashboard with active agents
- Show file reservations from other agents
- Initialize memory context from previous sessions
- Present urgent messages waiting for acknowledgment
0- Allow session to start normally2- Block session (e.g., critical pending acknowledgments)
🔒 pre-tool-use:edit: Prevent File Conflicts
🔒 pre-tool-use:edit: Prevent File Conflicts
- Check file reservations in Coordination system
- Block edits if another agent has claimed the file
- Auto-reserve files on first edit (shared or exclusive mode)
- Show which agent has the file reserved
- Suggest coordination via messaging
0- Allow edit (file available or already reserved by this agent)2- Block edit (file reserved by another agent)
📋 post-tool-use:edit: Track Obligations
📋 post-tool-use:edit: Track Obligations
- Show pending tasks related to edited file
- Display required acknowledgments
- Track what needs review after modification
- Update file reservation status
- Log edit for audit trail
0- Always allow (non-blocking hook)
💾 pre-compact: Save Critical Context
💾 pre-compact: Save Critical Context
- Create memory snapshot of current context
- Extract architecture decisions and learnings
- Preserve critical technical details
- Store important code patterns
- Save pending tasks and obligations
0- Allow compaction to proceed2- Block compaction (rarely used)
💬 user-prompt-submit: Alert to Urgent Messages
💬 user-prompt-submit: Alert to Urgent Messages
- Check for urgent unread messages
- Display critical coordination alerts
- Show pending acknowledgments that require attention
- Present important file reservation conflicts
- Alert to high-priority tasks
0- Allow response (no urgent messages)2- Block response (critical message requires acknowledgment)
⏹️ stop: Prevent Unsafe Shutdowns
⏹️ stop: Prevent Unsafe Shutdowns
- Check for pending critical acknowledgments
- Warn about incomplete file reservations
- Block shutdown if critical tasks incomplete
- Allow graceful completion of obligations
- Prevent orphaned locks
0- Allow stop (all clear)2- Block stop (pending critical tasks)
🧹 session-end: Clean Up Resources
🧹 session-end: Clean Up Resources
- Release all file reservations automatically
- Mark agent as offline in Coordination
- Store final memory snapshot
- Complete logging and audit trail
- Clean handoff to next session
0- Always allow (cleanup hook)
👶 subagent-stop: Consolidate Learnings
👶 subagent-stop: Consolidate Learnings
- Store subagent learnings to shared memory
- Release subagent file reservations
- Report results to parent agent
- Update task status
- Clean up subagent resources
0- Always allow (cleanup hook)
Real-World Use Cases
Multi-Agent Development Team
- Alice edits
auth.ts→ pre-edit hook reserves it - Bob tries to edit → blocked with clear message
- Bob messages Alice through Coordination
- They coordinate the changes
- Result: Zero merge conflicts
Parallel Task Execution
- Each subagent claims unique files via pre-edit hooks
- Subagent-stop hooks consolidate learnings to memory
- Session-end hooks clean up all reservations
- Result: 6x faster execution, zero conflicts
Context Preservation
- Pre-compact hook fires automatically
- Creates memory snapshot of key decisions
- Claude compacts conversation safely
- Architecture details preserved
- Result: Never re-explain critical context
Emergency Code Freeze
- Admin sends urgent message to all agents
- User-prompt hooks show alert before every response
- Pre-edit hooks can be configured to block all edits
- Result: Immediate coordination across team
Compatible AI Assistants
ULPI Hooks works with any AI coding assistant that supports lifecycle hooks (MCP-compatible):- Full Support (8/8 Hooks)
- Partial Support (6/8 Hooks)
- Coming Soon
✅ Fully Supported
These assistants support all 8 lifecycle hooks out of the box:- Claude Code - Official Anthropic IDE with complete hook support
- Cursor - Full lifecycle integration including subagent hooks
- Windsurf - Complete hook implementation with MCP bridge
ulpi setup and hooks are installed automaticallyPerformance Metrics
Hooks are optimized for minimal latency impact:| Hook | Avg Latency | MCP Calls | Can Block? |
|---|---|---|---|
| session-start | 150ms | 3-5 | ✅ Yes |
| pre-tool-use:edit | 120ms | 1-2 | ✅ Yes |
| post-tool-use:edit | 80ms | 1 | ❌ No |
| pre-compact | 200ms | 2-3 | ✅ Yes |
| user-prompt-submit | 100ms | 1-2 | ✅ Yes |
| stop | 90ms | 1 | ✅ Yes |
| session-end | 110ms | 2-3 | ❌ No |
| subagent-stop | 95ms | 1-2 | ❌ No |
Automatic Setup
Getting started with Hooks takes one command:Integration with Other ULPI Products
Hooks supercharges other ULPI products by providing automatic integration:Coordination
Memory
Tasks
Skills
Pricing
FREE with Coordination + Memory
- Starter: $29/month includes Hooks
- Professional: $99/month includes Hooks
- Enterprise: Custom pricing includes Hooks
Success Metrics
Teams using ULPI Hooks report:- Zero merge conflicts (down from 12-20 per week)
- 100% context preservation (vs 40% loss without hooks)
- 85% reduction in coordination overhead
- 3x faster multi-agent collaboration
- 60% fewer manual file conflict resolutions
FAQ
Do I need to manually configure each hook?
Do I need to manually configure each hook?
ulpi setup automatically installs and configures all 8 hooks for your IDE. Zero manual configuration required.Will hooks slow down my AI assistant?
Will hooks slow down my AI assistant?
What happens if a hook fails?
What happens if a hook fails?
Can I disable specific hooks?
Can I disable specific hooks?
Do hooks work with local/offline AI models?
Do hooks work with local/offline AI models?
How do I troubleshoot hook issues?
How do I troubleshoot hook issues?
ulpi config set debug=true. Hook execution logs appear in your IDE’s terminal/console.