General-purpose coding policy for Baruch's AI agents
95
91%
Does it follow best practices?
Impact
96%
1.31xAverage score across 10 eval scenarios
Advisory
Suggest reviewing before use
git checkout mid-task overwrites files another is reading mid-editGrep, Read, Glob, non-mutating Bash like git status) on the shared checkout is fine; isolation becomes mandatory the moment the task crosses into mutating tools (Edit, Write, side-effecting Bash, branch creation)git worktree add — distinct from the base checkout you cloned into, on its own branch, sharing the same .git object store. This is narrower than the generic "any git checkout" sense the word sometimes carriesisolation: "worktree" parameter is the canonical mechanism for spawned subagents — it provisions a fresh additional worktree on its own branch and cleans up on exit if the agent made no changesgit worktree add -b <task-branch> ../<repo>-<task> to create an isolated checkout on a new branch (or git worktree add ../<repo>-<task> <existing-branch> to attach to one that already exists), then cd into it before any mutating operation.git object store — branch creation is cheap and disk usage stays small. The cost of isolation is trivial against the cost of a corrupted concurrent editgit worktree listgit worktree remove <path> so the metadata under .git/worktrees/ is cleaned up too — never rm -rf the directory directly, which strands the metadata and makes the path unreusablegit worktree list shows entries from finished tasks, the workflow that creates worktrees is missing its cleanup step — fix the workflow, not just the symptomskills/release/SKILL.md Step 7, the post-merge order is mandatory: cd back to the base checkout → fast-forward base main → git worktree remove <worktree-path> → git branch -d <branch>. The teardown must precede the branch delete because git branch -d refuses to delete a branch that's still checked out in any worktree — reversing the order leaves a stranded branch