summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhathach <[email protected]>2026-07-07 17:56:51 +0700
committerhathach <[email protected]>2026-07-07 17:56:51 +0700
commit98099a569e7d9d528a1d5aaf3e3ed44014710ff3 (patch)
treecd99545b1353efcacbe48cfef04b65bf30cd1288
parent41b8ad203990da258e98531c6bf77102c7cc7c68 (diff)
docs(AGENTS): prefer git worktrees for branch/multi-step work
Direct agents to work in a git worktree rather than switching the shared primary checkout's branch. Concurrent sessions share that checkout, so a mid-flight branch switch disrupts the other sessions and can silently point a review, build, or commit at the wrong diff. CLAUDE.md is a symlink to AGENTS.md, so both pick this up. Co-Authored-By: Claude Opus 4.8 <[email protected]> Claude-Session: https://claude.ai/code/session_01HeF2gZ1M7GWkz6Av4BpKPg
-rw-r--r--AGENTS.md1
1 files changed, 1 insertions, 0 deletions
diff --git a/AGENTS.md b/AGENTS.md
index e7db86cb7..f69083697 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -12,6 +12,7 @@ Bias toward caution over speed. For trivial tasks, use judgment.
- **Simplicity** — no features, abstractions, flexibility, or error handling beyond what was asked. If 200 lines could be 50, rewrite.
- **Surgical changes** — touch only what the task requires; match existing style; don't refactor working code; mention unrelated dead code rather than deleting it. Remove only orphans *your* changes created.
- **Goal-driven** — turn tasks into verifiable goals ("write failing test, make it pass"). For multi-step work, state a brief `step → verify` plan.
+- **Worktrees** — default to a git worktree (`git worktree add`) for any branch or multi-step work; never switch the shared primary checkout's branch. Sessions run concurrently: switching the primary checkout mid-flight disrupts other sessions and can silently point a review, build, or commit at the wrong diff. Only trivial one-shot fixes may skip this.
## Ground Rules