Theory is great. Real-world results are better.This guide shows how actual development teams use ULPI Hooks to solve coordination problems, eliminate merge conflicts, and preserve critical context.Each use case includes: the problem, the solution using hooks, and measurable results.
Scenario: Charlie tries to edit src/auth/login.ts while Alice is working on itWithout hooks:
Charlie edits the file
Alice also edits the file
Both commit locally
Merge conflict when syncing
15 minutes lost to resolution
With hooks:
β Edit Blocked - File ReservedFile: src/auth/login.tsReserved by: Alice (Cursor)Mode: ExclusiveExpires: 1 hour 15 minutesAlice is implementing OAuth login. Estimated completion: 1.5 hoursCoordination Options:1. [Message Alice] - "When will you be done?"2. [Check her progress] - View Alice's commits3. [Work on related file] - auth/middleware.ts available4. [Set reminder] - Notify when file is available[Choose Option]
Charlie chooses option 1 (Message Alice):
π¨ Message to AliceCharlie: "Hey Alice, I need to add rate limiting to the login function. When will you be done with login.ts?"Alice: "I'm adding OAuth, should be done in 30 min. But rate limiting can go in middleware/rateLimiter.ts and I'll call it from login. Want to pair on the integration?"Charlie: "Perfect! I'll build the middleware now."
Before: Constant βare you editing X?β Slack messages
After: Coordination through ULPI messagingBenefit: Async, contextual, automated
Team Morale
Before: Frustration with conflicts
After: βWe never think about conflicts anymoreβQuote: βHooks just work. We forget theyβre there.β β Alice
π Subagent-1 ReportStatus: CompletedFiles: 2/2 βTests: 12/12 passing βLearnings: 3 patterns stored to memoryAvailable for Main Agent to review and other subagents to use.
Subagent 4 (working on tests) starts and loads memories from Subagent 1:
π Subagent-4 Session Startπ§ Loading relevant memories from other subagents:β Loaded: OAuth implementation pattern (from Subagent-1)β Loaded: Error handling approach (from Subagent-1)Subagent-4 can now write tests that match the patterns usedin the auth refactor, even though it didn't do that work.
User: "We're building a social platform. PostgreSQL or MongoDB?"Claude: "For your use case, PostgreSQL because:1. Strong relationships (users, posts, comments)2. ACID compliance for financial data (premium subscriptions)3. Full-text search built-in4. Your team knows SQL"User: "Agreed. This is critical for the whole project architecture."
πΎ Saving Architecture DecisionContent: "PostgreSQL chosen over MongoDB for social platform. Rationale: Relational data model, ACID compliance for payments, full-text search, team expertise."Type: architecture_decisionImportance: 0.98Tags: ["database", "architecture", "postgresql"]β Stored to memory
User: "We're adding payments. What database should we use?"Claude: "Based on our architecture decision from Month 1, we're using PostgreSQL for the whole platform. For payments specifically, PostgreSQL is ideal because we need ACID compliance for transactions. I recommend: - payments table in main PostgreSQL database - Use transactions for payment operations - Leverage PostgreSQL's ACID guarantees"User: "Perfect!" [Claude remembered without re-explanation]
Time saved: 15 minutes (didnβt re-explain DB choice)
# Security team sends urgent broadcastulpi coordination broadcast \ --priority urgent \ --subject "SECURITY: Code freeze - SQL injection vulnerability" \ --body "Critical SQL injection found in user auth. CODE FREEZE until patched. Do not deploy. Do not modify auth module." \ --all-agents
Every agent sees alert before next response:Alice (Cursor):
π¨ URGENT COORDINATION MESSAGEFrom: Security TeamPriority: CRITICALSubject: Code freeze - SQL injection vulnerabilityCritical SQL injection found in user auth.β CODE FREEZE:- Do not deploy any code- Do not modify auth module- Wait for security patch[Acknowledge] [View Details]
Alice clicks [Acknowledge] β Can continue non-auth workBob (Claude Code):Bob is about to modify auth/login.ts when:
π¨ URGENT MESSAGE + PRE-EDIT HOOK BLOCKβ Edit BlockedFile: auth/login.tsReason: Emergency code freeze (security issue)You have unacknowledged urgent message about this file.You must acknowledge before editing auth-related files.[View Urgent Message] [Acknowledge]
Bob views message β Understands β Works on different module
π Session Start: auth-serviceπ§ Loading auth-service memories:β Architecture: OAuth 2.0 with JWT tokensβ Convention: Winston logger for all errorsβ Convention: Jest with 80% coverage minimumβ Active tasks: Rate limiting implementation (60% done)Claude now has auth-service context.
15 minutes later, switch to payment-service repo:
π Session Start: payment-serviceπ§ Loading payment-service memories:β Architecture: Stripe integration with webhook handlingβ Convention: Pino logger (different from auth-service!)β Convention: Supertest for API testsβ Active tasks: Subscription management (planning phase)Claude now has payment-service context.
User (in payment-service): "Add error logging"Claude: "I'll use Pino logger as per payment-service conventions:logger.error({ err, userId }, 'Payment processing failed');"
Claude used Pino (payment-service convention), not Winston (auth-service convention)
π Session StartedDeveloper: alice@company.comAgent: Claude CodeProject: payment-platformTimestamp: 2024-01-15T09:00:00ZCompliance requirements active:β SOC 2 Type IIβ PCI DSS Level 1β GDPRAll actions will be logged for audit.