# Concurrent Agents

How to work safely when many Claude Code and Codex agents share this one checkout at once.

- Repository: https://github.com/BuilderIO/agent-native (7579 stars)
- Category: AI and agents
- License: MIT
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add BuilderIO/agent-native --skill concurrent-agents -g -a claude-code -y`
Codex: `npx skills add BuilderIO/agent-native --skill concurrent-agents -g -a codex -y`
Cursor: `npx skills add BuilderIO/agent-native --skill concurrent-agents -g -a cursor -y`
Gemini CLI: `npx skills add BuilderIO/agent-native --skill concurrent-agents -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add BuilderIO/agent-native`

## Description

How to work safely when many Claude Code and Codex agents share this one checkout at once. Use before editing any file, before concluding someone reverted your work, before any branch operation, and before committing, pushing, or merging, this is almost always relevant here.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Concurrent Agents

Steve runs many Claude Code and Codex sessions against this one checkout on
purpose, often on the same branch or file. Default assumption on every task:
the working tree is shared branch state. Read existing changes before editing
them, and never reset, clean, stash, or overwrite local work without explicit
authorization.

## Read before you edit

Before touching a file that already has uncommitted changes, re-read it and
build your edit on top of what's there. Landing your own complete fix over a
peer's in-progress one has happened repeatedly, "another agent landed its own
complete fix for the exact same bug in the exact same file, overwriting my
in-progress edits on disk." There is no conflict, no warning; the edit vanishes.

## Diagnosing "did someone revert my work", correctly

`git diff --stat` line counts are not evidence of a revert, a refactor can
show the same magnitude of deletions. An agent once announced a revert from
stat counts alone and was wrong; it cost a full investigation to disprove.
Before you say "reverted" out loud, run:

```bash
git log --oneline <base>..HEAD    # what actually landed, in order
git diff <base>..HEAD -- <path>   # the real hunks for the files in question
```

Read the hunks: a revert removes logic and puts nothing equivalent back; a
refactor removes the same lines and adds different code doing the same job.
Only the hunks tell you which happened, never `--stat` alone.

## Shallow or grafted worktrees

Shallow clones and grafted worktrees do not have complete ancestry. Treat
`git log -S` and `git merge-base --is-ancestor` results at their boundary as
inconclusive; fetch complete history or verify the date through the remote
commit or pull-request record before calling a change the first occurrence.

## Branch operations follow checkout ownership

The rest: https://github.com/BuilderIO/agent-native/blob/HEAD/.agents/skills/concurrent-agents/SKILL.md
