docs(agents): dispatched work names its worktree; the main checkout is production #105

Merged
alee merged 1 commits from docs/agents-worktree-rule into main 2026-09-29 02:52:46 +00:00
Owner

Adds a short "Worktrees: where dispatched work happens" section near the top of AGENTS.md. opencode loads that file into every session, including dispatched workers.

Why: worker sessions open in the main checkout (/home/alee/Sources/6krrt) by default, and that checkout is production: the live router restarts from its config.yaml. On 2026-09-28, after an opencode restart, Atlas dispatched workers whose prompts named no worktree, and one rewrote the main checkout's live config.yaml. It was caught and reverted before any restart. The existing "work in a worktree" line sits under Git hygiene and never addressed dispatch.

Rules added:

  • Workers: cd into the named worktree; confirm git rev-parse --show-toplevel before the first edit; if no worktree is named, stop and ask; never touch the main checkout unless the task says so.
  • Orchestrators:
    • Start every task() prompt with WORKTREE: <path>….
    • Always pass a category/subagent_type. A call with neither creates no worker but still reports "completed".
    • Never dispatch to oh-my-claudecode:* agents, which are pinned to unreachable Anthropic models.
    • Run one worker per worktree.
    • Confirm the commit exists before ticking a todo.

Verified live: after the section went into the working copy, Atlas's next dispatch opened with the WORKTREE: line.

Docs only; no code or tests touched.

🤖 Generated with Claude Code

https://claude.ai/code/session_01N9biTbFC63yDfYfUsZmhgd

Adds a short **"Worktrees: where dispatched work happens"** section near the top of `AGENTS.md`. opencode loads that file into every session, including dispatched workers. **Why:** worker sessions open in the main checkout (`/home/alee/Sources/6krrt`) by default, and that checkout is production: the live router restarts from its `config.yaml`. On 2026-09-28, after an opencode restart, Atlas dispatched workers whose prompts named no worktree, and one rewrote the main checkout's live `config.yaml`. It was caught and reverted before any restart. The existing "work in a worktree" line sits under Git hygiene and never addressed dispatch. **Rules added:** - **Workers:** `cd` into the named worktree; confirm `git rev-parse --show-toplevel` before the first edit; if no worktree is named, stop and ask; never touch the main checkout unless the task says so. - **Orchestrators:** - Start every `task()` prompt with `WORKTREE: <path>…`. - Always pass a `category`/`subagent_type`. A call with neither creates no worker but still reports "completed". - Never dispatch to `oh-my-claudecode:*` agents, which are pinned to unreachable Anthropic models. - Run one worker per worktree. - Confirm the commit exists before ticking a todo. Verified live: after the section went into the working copy, Atlas's next dispatch opened with the `WORKTREE:` line. Docs only; no code or tests touched. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01N9biTbFC63yDfYfUsZmhgd
alee added 1 commit 2026-09-29 02:51:00 +00:00
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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N9biTbFC63yDfYfUsZmhgd
alee merged commit 4a0da317c1 into main 2026-09-29 02:52:46 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: alee/6krrt#105