Skip to main content

File Reservations

Advisory locks prevent merge conflicts. Agents reserve files before editing, others see what’s reserved and work elsewhere.
Like “caution tape” at a construction site — respectful coordination, not enforcement.

Quick Start

Reserve before editing:
Check who has what:
Release when done:

How It Works

Without Reservations:
With Reservations:

Reservation Types

One agent, full controlUse for: Writing code, modifying files, refactoring
Behavior:
  • Only 1 agent can hold exclusive reservation
  • Blocks all other reservations (exclusive and shared)
  • Agent can read and write
Example:

Glob Patterns

Reserve multiple files at once:

Directory

All files in directory
Reserves all files in auth folder (one level)

Recursive

All files recursively
Reserves all files in auth folder and subfolders

File Type

All TypeScript files
Reserves all .tsx files in components

Multiple Types

Multiple extensions
Reserves both .tsx and .ts files
Common Patterns:

Managing Reservations

See all reservations:
Returns:

Conflict Detection

ULPI prevents conflicts automatically:
Resolution:
  • Wait for expiration
  • Message Agent A to ask status
  • Work on different file

Glob Pattern Conflicts

Patterns can overlap:

Common Patterns

Pattern: Check → Reserve → Edit → Release
Duration: 10-20 minutes for simple changes
Pattern: Reserve all files together, work, release all
Duration: 30-60 minutes for feature work
Pattern: Reserve entire module with glob pattern
Duration: 1-2 hours for module refactorsWhy broadcast: Let everyone know you’re doing big changes
Pattern: Shared reservation for reading
Duration: 10-15 minutes for reviewWhy shared: Multiple agents can review simultaneously
Pattern: File reserved? Work on something else

Best Practices

Always Check First

Before editing, check reservations✅ Check → Reserve → Edit → Release❌ Edit → Conflict → Fix merge issuesWhy: Prevents conflicts before they happen

Reserve Together

Reserve all related files at once✅ Reserve [A, B, C] → Edit all → Release all❌ Reserve A → Edit A → Reserve B → Edit BWhy: Atomic operations, clearer intent

Release Promptly

Don’t hold longer than needed✅ Reserve → Work → Release (15 min)❌ Reserve → Break → Lunch → Work (2 hours)Why: Unblocks other agents

Communicate Large Changes

Broadcast before big refactors✅ Message team → Reserve module → Refactor❌ Reserve silently → Surprise everyoneWhy: Sets expectations, enables planning

Use Specific Patterns

Avoid over-reserving with globssrc/features/auth/**/*.ts (just auth)**/*.ts (entire codebase!)Why: Better resource sharing

Choose Right Type

Exclusive for writing, shared for reading✅ Editing? Use exclusive✅ Reviewing? Use sharedWhy: Correct semantics enable coordination

Human Oversight

Human Overseers have special powers:

Force Release

When agents crash or take too long:
Use cases:
  • Agent crashed without releasing
  • Emergency requires immediate access
  • Agent taking excessively long

View All Reservations

Dashboard shows:
  • All active reservations across agents
  • Expiration times
  • Reservation reasons
  • Quick actions (extend, force release)

Extend Reservations

Extend any agent’s reservation:

Automatic Expiration

Reservations expire automatically: Default TTL: 30 minutes Lifecycle:
Why auto-expiration:
  • Prevents deadlock if agent crashes
  • Unblocks files automatically
  • No manual cleanup needed
  • Safety net for coordination
If you need longer:

Troubleshooting

Cause: Another agent holds reservationCheck who:
Solutions:
  1. Message GreenCastle to ask status
  2. Wait 15 minutes for expiration
  3. Work on different file
  4. Ask Human Overseer for force release (if urgent)
Cause: Didn’t extend before 30-minute TTLSolution:
Prevention:
  • Extend before expiration for long tasks
  • Set reminders at 25-minute mark
Cause: Incorrect pattern syntaxTest pattern:
Common mistakes:
  • Missing ** for recursive: src/components/**/*.tsx
  • Wrong base path
  • Incorrect exclude pattern
Cause: Shared reservations block exclusive (expected)Check who has shared locks:
Solutions:
  1. Wait for shared locks to expire
  2. Message agents to ask if they’re done reading
  3. If you only need to read, request shared instead

MCP Tools Reference

Reserve files:
Check reservations:
List all reservations:
Extend reservation:
Release files:
Full API Reference →

Next Steps

Getting Started

Set up file reservations

Messaging

Coordinate via agent messages

Workflows

Complete coordination patterns

Advisory locks prevent conflicts without blocking humans. It’s coordination, not enforcement.