Coordinate multi-agent file editing with locks
Agents safely edit shared codebases without conflicts by claiming jobs and acquiring advisory file locks, ensuring only one agent modifies a file at a time while maintaining a shared team notepad for progress updates.
How it works
The agent first calls get_project_soul to understand project context. It then checks list_jobs and list_agents to see if work is already assigned. For a new task, it posts a job via post_job, claims it with claim_next_job, and acquires a lock on the target file using propose_file_access. It performs the edit using guarded_write to prevent clobbering, updates the team status via update_shared_context, and finally completes the job with complete_job to release the lock. Before stopping, it calls finalize_session.
Prompt
Paste this into an agent that has the servers below connected. Adjust the names and dates to your own.
Refactor the authentication module in auth.py. First, check the current job board and team presence. Post a new job for this refactoring, claim it, and acquire a lock on auth.py. Perform the necessary code changes ensuring no other agent is editing the file. Update the shared context with your progress. Once done, complete the job and finalize the session.MCP servers it needs
Source
The vendor page this playbook is drawn from, and the passage that supports it.
Before editing ANY file: propose_file_access with a descriptive intent. If denied, work on something else. Never edit a file you don't hold.Docs — connect an agent to Axis