Skip to content

Commit ef64fec

Browse files
[docs] Add parallel agent worktree policy
1 parent 048ee51 commit ef64fec

2 files changed

Lines changed: 82 additions & 0 deletions

File tree

AGENTS.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,46 @@
11
# OB1 Agent Instructions
22

3+
## Parallel Agent Worktrees
4+
5+
When multiple AI agents or assistant chats work on this repo, do not put them in the same checkout.
6+
7+
### Setup pattern
8+
9+
- Treat the main repo checkout as the canonical repo for pulling, inspection, and creating worktrees.
10+
- Create one Git worktree per active agent, task, or PR-sized workstream.
11+
- Give each worktree a descriptive folder name and a matching branch name.
12+
- Start every agent task by naming the exact absolute worktree path it owns.
13+
- The assigned worktree path is the boundary. The chat is not the boundary.
14+
15+
### Agent assignment template
16+
17+
Start each parallel-agent task with:
18+
19+
```text
20+
Repository worktree:
21+
/ABSOLUTE/PATH/TO/PROJECT-WORKTREE
22+
23+
Branch:
24+
codex/SHORT-TASK-NAME
25+
26+
Task:
27+
DESCRIBE THE EXACT WORK.
28+
```
29+
30+
### Rules
31+
32+
- Do not switch branches in the canonical repo while another agent may be working.
33+
- Do not edit sibling worktrees unless explicitly asked.
34+
- Before staging or committing, run `git status --short` and stage only files that belong to the current task.
35+
- If `main` or another branch changed underneath the worktree, pause before merging or rebasing unless the task explicitly says to finish the PR end to end.
36+
- After a branch is merged and the worktree is clean, remove the finished worktree with `git worktree remove /ABSOLUTE/PATH/TO/PROJECT-WORKTREE`.
37+
38+
### Quick checks
39+
40+
- If another chat suddenly changed branches, both chats were probably in the same working directory.
41+
- If `git worktree add` says a branch is already checked out, create a new branch name or remove the old clean worktree.
42+
- If cleanup fails, inspect `git status --short` and preserve uncommitted work.
43+
344
## Required Step: Update Linear
445

546
- For feature work tied to a Linear issue, update Linear at the start of the work, at meaningful checkpoints, and before handing back to the user.

CLAUDE.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,47 @@ resources/ — Official companion files and packaged exports.
2424

2525
Every contribution lives in its own subfolder under the right category and must include `README.md` + `metadata.json`.
2626

27+
## Parallel Agent Worktrees
28+
29+
When multiple AI agents or assistant chats work on this repo, do not put them in the same checkout.
30+
31+
### Setup pattern
32+
33+
- Treat the main repo checkout as the canonical repo for pulling, inspection, and creating worktrees.
34+
- Create one Git worktree per active agent, task, or PR-sized workstream.
35+
- Give each worktree a descriptive folder name and a matching branch name.
36+
- Start every agent task by naming the exact absolute worktree path it owns.
37+
- The assigned worktree path is the boundary. The chat is not the boundary.
38+
39+
### Agent assignment template
40+
41+
Start each parallel-agent task with:
42+
43+
```text
44+
Repository worktree:
45+
/ABSOLUTE/PATH/TO/PROJECT-WORKTREE
46+
47+
Branch:
48+
codex/SHORT-TASK-NAME
49+
50+
Task:
51+
DESCRIBE THE EXACT WORK.
52+
```
53+
54+
### Rules
55+
56+
- Do not switch branches in the canonical repo while another agent may be working.
57+
- Do not edit sibling worktrees unless explicitly asked.
58+
- Before staging or committing, run `git status --short` and stage only files that belong to the current task.
59+
- If `main` or another branch changed underneath the worktree, pause before merging or rebasing unless the task explicitly says to finish the PR end to end.
60+
- After a branch is merged and the worktree is clean, remove the finished worktree with `git worktree remove /ABSOLUTE/PATH/TO/PROJECT-WORKTREE`.
61+
62+
### Quick checks
63+
64+
- If another chat suddenly changed branches, both chats were probably in the same working directory.
65+
- If `git worktree add` says a branch is already checked out, create a new branch name or remove the old clean worktree.
66+
- If cleanup fails, inspect `git status --short` and preserve uncommitted work.
67+
2768
## Guard Rails
2869

2970
- **Never modify the core `thoughts` table structure.** Adding columns is fine; altering or dropping existing ones is not.

0 commit comments

Comments
 (0)