From 46220c81f5fc59bb82fa86c2f172d3f6b3a77556 Mon Sep 17 00:00:00 2001 From: adlee-was-taken Date: Mon, 28 Sep 2026 22:50:57 -0400 Subject: [PATCH] docs(agents): dispatched work names its worktree; the main checkout is production Worker sessions open in /home/alee/Sources/6krrt by default, so a task() prompt that names no worktree edits production files. On 2026-09-28 a worker rewrote the main checkout's live config.yaml that way. The existing "work in a worktree" line sat under Git hygiene and never addressed dispatch. The new section near the top gives workers a checkable rule (cd into the named worktree, verify rev-parse --show-toplevel, stop and ask if none is named) and orchestrators theirs: start every task() prompt with a WORKTREE: line, always give a category, never use oh-my-claudecode:* agents, one worker per worktree, confirm the commit before ticking a todo. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01N9biTbFC63yDfYfUsZmhgd --- AGENTS.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/AGENTS.md b/AGENTS.md index da14711..23c531c 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -16,6 +16,43 @@ This file is the quick-reference for an agent starting work: where things live, what's safe to touch, and the conventions that aren't obvious from the code. +## Worktrees: where dispatched work happens (read before editing anything) + +**`/home/alee/Sources/6krrt` is the main checkout, and it is production.** The +live router restarts from its `config/config.yaml`, and the live `router.db` and +`config/config.local.yaml` live there. Its uncommitted files are the owner's. + +Your session opens in that directory by default, even when your task belongs to +a worktree. So a task that names no worktree edits production files. That +happened on 2026-09-28: a worker rewrote the main checkout's live +`config.yaml`. + +**If you are a worker:** +- Your task names a worktree under `/home/alee/Sources/6krrt-worktrees/`. + `cd` there first, and read and edit only paths under it. +- Check where you are before your first edit: + `git -C rev-parse --show-toplevel` must print the worktree, not + `/home/alee/Sources/6krrt`. +- If your task names no worktree, stop and ask the orchestrator. Do not default + to the main checkout. +- Never edit, commit, stash, reset or check out anything in the main checkout + unless your task explicitly says "main checkout". + +**If you dispatch work (Atlas, any orchestrator):** +- Begin every `task()` prompt with this line: + `WORKTREE: . cd there first; never edit under /home/alee/Sources/6krrt/.` + Include it even for a small or read-only task. +- Give every `task()` a `category` or `subagent_type`. A call with neither + creates no worker, yet still reports "completed". +- Never dispatch to `oh-my-claudecode:*` agents. They are pinned to Anthropic + models this opencode cannot reach, and return "completed" with zero work. +- Run one worker at a time per worktree, unless the plan says the files are + disjoint. +- Before ticking a todo, confirm its commit exists: + `git -C log --oneline`. + +The Git hygiene section below says why the main checkout is shared. + ## Stack snapshot | Dimension | Value | -- 2.49.1