D77 · Team sessions: the four roles discuss in one Claude Code team, and GitHub keeps the outcomes
Accepted · 2026-10-27 · zuki · Partly supersedes D28 (where discussion happens, and agents reaching the repository only through the Claude GitHub app) · Closes #330 · Partly superseded by D80 (a data-phase slice; the second pilot)
Decision: From M1 on, a slice of work runs as one team session: a Claude Code agent team in which the CTO session leads and the Docs, Backend and Frontend Engineers are teammates who talk to each other directly. What changes is where the discussion happens. The order of authority, the roles, rules before tests before code (D27), zuki's review and merge of every pull request (D28) and the automation ladder stay as they are. Team sessions is the protocol.
- The team. The lead is a CTO session that zuki starts with the team launcher; the teammates are
doc,beandfe, spawned from the role files in.claude/agents/. Each writes only to its role's paths, and a hook enforces it. zuki talks to the lead, or to any teammate from the agent panel. - Discussion stays in the session; outcomes go to GitHub. Questions between roles, Interface requests and change requests are mailbox messages, not issue comments. A slice leaves one slice issue, a decision PR when the session produced decisions, one slice PR (rules, tests and code, one commit per role) and a digest comment on the slice issue. Anything the session doesn't settle becomes an issue.
- Only zuki decides. A teammate's message is never zuki's approval. An option zuki chooses in a session binds only when its page merges, and the slice PR stays a draft until its decision PR merges.
- How the team reaches GitHub. A local team session uses
ghwith its own fine-grained token, never zuki's own login: Opleettop/monorepo only; Contents, Pull requests and Issues read and write; Metadata read; nothing else; 30 days. It lives in the macOS Keychain, and the launcher exports it for that session only. A runner in the cloud that isn't a Claude session gets a second token with the same scopes, as that runner's secret. Claude sessions in the cloud keep using the Claude GitHub app. - Merging stays zuki's. The tokens have no Administration or Workflows permission. A hook denies every team member merges, approvals, pushes to main, force pushes,
--no-verify,gh apicalls to admin endpoints and reads of secrets. The ruleset on main allows squash merges only, as D28 says. - Local checks are allowed. Agents may run
pnpm lint,pnpm typecheck,pnpm docs:rules,pnpm --filter docs buildand the local Supabase (pnpm supabase start,db reset,test db), against containers on zuki's Mac only. Nothing against staging, production or v1 runs from a team session; those steps stay L0, run by zuki from his own clone. Pushing a branch, opening a pull request or commenting is not a run on the ladder. - Single-role sessions stay. A cloud CTO, BE, FE or DOC session still does small work that needs one role, through issues as before.
Why: zuki, 2026-10-27: he wants the four roles to discuss directly in one session instead of through GitHub issues, so changes and decisions happen faster and issues and pull requests are more compact, while he still runs steps at L0. On #330 he chose the CTO as lead, gh locally and a fine-grained token in the cloud, local checks, and a decision PR plus one slice PR. The ruleset read that day has no bypass actors but requires no approvals and allows merge and rebase, so a token acting as zuki could merge: the guardrails above close that.
Consequences:
- New page: team sessions, the protocol. How we work, starting a session, the automation ladder and AGENTS.md change to match.
- The tooling is a CTO pull request that follows this one: the launcher, the role files, the hooks, the
/teamand/team-closeskills and a Lefthook check that a commit with aRole:trailer touches only that role's paths. The CI job that runs the same check is pushed by zuki, since the tokens can't change workflows. - zuki's steps: set the ruleset to squash only; make the team clone and the
opleet-teamtoken; run the dry check, in which each guard must refuse once; then two pilots, one review-only session and one small M1 slice, before M1 to M7 run this way. - Labels:
type: slicefor a slice issue andagent: teamfor a team session's pull requests. - Agent Teams is experimental. The launcher pins a Claude Code version, which zuki upgrades on purpose. If a session can't run as a team, the work falls back to single-role sessions and issues.
- Not decided here: a pi adapter and jev. Each needs its own decision, after a review-only pilot.