Orchestrate repo agents from the platform with only their repo's rules #52

Open
opened 2026-10-24 07:14:20 +00:00 by araemer · 0 comments
Owner

Problem

The platform skills start repo agents (repo architects, planners, implementers, reviewers) with the Agent tool. That tool has no working-directory setting, so every sub-agent runs in recipe-platform and gets the platform's CLAUDE.md, not the sibling repo's.

CLAUDE.md ("Sub-agent spawning pattern") and /plan-feature (Steps 4 and 5) require a sub-agent "rooted" in the sibling, because only the automatic load guarantees that the sibling's conventions are in view. Today this is approximated by telling each agent to read its repo's CLAUDE.md first. That depends on the agent following the instruction, and the platform's rules stay in its context too.

Found during /plan-feature for spec 004, at Step 4.

Goal

Repo agents started from the platform load only their repo's rules, as they would in a session opened in that repo. This keeps the context small and avoids mixing contradictory rules (e.g. the git rules for main and stage).

Options to research

  • A named agent definition per repo (like Bjarne and Ivar in docs/team.md), so the user can also talk to a repo architect directly. Architects often ask questions, so that matters. To find out: can such an agent be rooted in its repo, and how does its CLAUDE.md load?
  • Whether Claude Code supports a working directory for sub-agents (agent frontmatter, Agent tool settings), and how CLAUDE.md loads for directories outside the session's directory (--add-dir and related settings). This setup is reported to work in another project with the same sibling layout.
  • Headless sessions started inside the repo (claude -p with the sibling as its directory), started by the skills. This roots the agent reliably, but its permissions must be set up front and its progress is less visible.
  • Starting the platform session in the parent directory, so the siblings become subdirectories.

Scope of the change

plan-feature, implement-feature, review-feature, possibly the shared recipe-workflow plugin skills, CLAUDE.md ("Sub-agent spawning pattern") and docs/team.md. Each changed skill or agent needs its ADR.

🤖 Generated with Claude Code

## Problem The platform skills start repo agents (repo architects, planners, implementers, reviewers) with the `Agent` tool. That tool has no working-directory setting, so every sub-agent runs in `recipe-platform` and gets the platform's `CLAUDE.md`, not the sibling repo's. `CLAUDE.md` ("Sub-agent spawning pattern") and `/plan-feature` (Steps 4 and 5) require a sub-agent "rooted" in the sibling, because only the automatic load guarantees that the sibling's conventions are in view. Today this is approximated by telling each agent to read its repo's `CLAUDE.md` first. That depends on the agent following the instruction, and the platform's rules stay in its context too. Found during `/plan-feature` for spec 004, at Step 4. ## Goal Repo agents started from the platform load **only** their repo's rules, as they would in a session opened in that repo. This keeps the context small and avoids mixing contradictory rules (e.g. the git rules for `main` and `stage`). ## Options to research - **A named agent definition per repo** (like Bjarne and Ivar in `docs/team.md`), so the user can also talk to a repo architect directly. Architects often ask questions, so that matters. To find out: can such an agent be rooted in its repo, and how does its `CLAUDE.md` load? - **Whether Claude Code supports a working directory for sub-agents** (agent frontmatter, `Agent` tool settings), and how `CLAUDE.md` loads for directories outside the session's directory (`--add-dir` and related settings). This setup is reported to work in another project with the same sibling layout. - **Headless sessions started inside the repo** (`claude -p` with the sibling as its directory), started by the skills. This roots the agent reliably, but its permissions must be set up front and its progress is less visible. - **Starting the platform session in the parent directory,** so the siblings become subdirectories. ## Scope of the change `plan-feature`, `implement-feature`, `review-feature`, possibly the shared `recipe-workflow` plugin skills, `CLAUDE.md` ("Sub-agent spawning pattern") and `docs/team.md`. Each changed skill or agent needs its ADR. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
araemer/recipe-platform#52
No description provided.