Stop two agents editing the same file
File claims across machines and the commit guard are built and off until switched on: claims and overlap checks go through the team relay, scoped to repo and branch, and repoops guard warns on or blocks a commit to a claimed file (repo-dashboard #7585). Paths are hashed unless the team turns on sharing them. The production check on two machines is still to go.
Use case
Stop two agents editing the same file: done inside an agent's session with RepoOps, starting when an agent is about to edit files.
Who would use it
A tech lead whose team runs several agents at once in the same repository.
What value it provides
Each agent claims the files it is about to change. A second agent sees the claim, who holds it and since when, and picks other work. The commit guard warns on or blocks a commit to a claimed file.
Why it matters to the user
Conflicting edits stop before they cost a rebase, whichever agent each person uses.
The problem
Two agents on two machines edit the same file on the same afternoon. Nobody finds out until the merge conflict, and one of them does its work again.
Expected outcomes
- Merge conflicts between two agent sessions on the same branch
- Commits the guard warned on or blocked
How it runs
Products and connections
| Product | Role in this workflow | Docs |
|---|---|---|
| RepoOps | Claim the files for this session, scoped to repo and branch (claim_files); Check for another session's claim before editing (check_session_overlap); Warn on or block a commit to a file another session claimed (repoops guard) | Reference · RepoOps docs |
Outside the family: Git, through a pre-commit hook.
What a person approves
Nothing. No step asks a person for an approval.
How to access it from an agent
No run to start. The agent calls claim_files and check_session_overlap on the RepoOps MCP server, and repoops guard runs as a pre-commit hook. It is not a workflow run, so it counts no workflow request.
Call the products yourself, step by step:
| Product | Endpoint | Tools |
|---|---|---|
| RepoOps | https://mcp.repoops.ai/mcp | search_brain get_pre_edit_context propose_brain_entry get_incident_attribution |