Skip to content

TL-TS-01 · The team clone, its token and the dry check

Why: D77 lets the four roles work as one Claude Code agent team on zuki's Mac. Agent teams run only in the interactive Claude Code CLI, so the team needs a place on the Mac where it can't reach anything but this repository: a second clone with no secrets, its own fine-grained token, and the guards that team sessions describes. This step sets that up, then proves each guard refuses before any real work runs in a team.

The guards are in the repository from the tooling pull request (#332): the launcher (pnpm team:start), the role files in .claude/agents/, the hooks in .claude/hooks/, and the role-path check in tools/team/. This step adds what can't live in the repository: the clone, the token, the version check, the labels, the ruleset change and the CI line.

ID TL-TS-01 · Level L0 · Run order team sessions, row 3 · Issue #332

~/reposhigoto/opleet-team is a clone used only for team sessions; pnpm team:start starts Claude Code there with agent teams on and the opleet-team token, and every guard has refused once in the dry check, with the run logged on #332.

  • D77 is merged (#331) and the tooling pull request is merged.
  • Claude Code installed and signed in on the Mac; gh installed; Docker running; Node 24 and pnpm 12 as for your own clone (TL-M0-02).
  • Your own clone, ~/reposhigoto/opleet, signed in to GitHub as you. It stays where you run staging and production steps; nothing in this step touches it except block 5.
Terminal window
git clone https://github.com/Opleettop/monorepo.git ~/reposhigoto/opleet-team
cd ~/reposhigoto/opleet-team
pnpm install
mkdir -p .team && touch .team/team-clone

Never copy an .env file into this clone, and never run pnpm supabase link in it: the launcher refuses to start if it finds either.

Terminal window
claude --version | awk '{print $1}' | tee .team/claude-version

Agent teams are experimental. The launcher refuses to start on any other version, so an update never changes a team session without you noticing. To move to a new version later: run a review-only team session on it, then write it to .team/claude-version again.

On github.com: your avatar › Settings › Developer settings › Personal access tokens › Fine-grained tokens › Generate new token.

Field Value
Token name opleet-team
Resource owner Opleettop
Expiration 30 days
Repository access Only select repositories: Opleettop/monorepo
Repository permissions Contents: Read and write · Issues: Read and write · Pull requests: Read and write · Metadata: Read-only (set for you). Everything else: No access

Leave Administration, Workflows, Secrets, Environments and Actions at No access: that is what keeps a team member from changing the ruleset or the CI that guards main (D77). If the organization asks to approve the token, approve it under Opleettop › Settings › Personal access tokens.

Copy the token, then store it in the Keychain. The command asks for the token rather than taking it on the command line, so it stays out of your shell history:

Terminal window
security add-generic-password -s opleet-team -a "$USER" -w

From your own clone, signed in as you:

Terminal window
gh label create "type: slice" --repo Opleettop/monorepo --color 0E8A16 --description "A slice of work for one team session (D77)"
gh label create "agent: team" --repo Opleettop/monorepo --color 5319E7 --description "Opened by a team session (D77)"

Then on github.com: Opleettop/monorepo › Settings › Rules › Rulesets › main › Pull request › Allowed merge methods: Squash only. Save.

The tokens can't change workflows, so this line is yours. In your own clone, on a new branch, add this step to the checks job in .github/workflows/ci.yml, right after - run: pnpm docs:rules:

- name: Team sessions keep to their roles' paths (D77)
if: github.event_name == 'pull_request'
env:
BASE: ${{ github.event.pull_request.base.sha }}
HEAD: ${{ github.event.pull_request.head.sha }}
run: node tools/team/check-role-paths.mts --range "$BASE..$HEAD"
Terminal window
git switch -c ci/team-role-paths origin/main
# edit .github/workflows/ci.yml as above
git commit -am "ci: check team session commits against their roles' paths (d77)"
git push -u origin HEAD
gh pr create --fill

Merge it once checks is green.

Terminal window
cd ~/reposhigoto/opleet-team
pnpm team:start --log

The script is team:start, not team: pnpm team is pnpm's own command for npm organization teams, so it never reaches a script of that name.

Claude Code asks whether you trust the folder: answer yes, so the role files load. --log writes every hook's input to .team/hooks.log for block 7.

Then type:

This is the TL-TS-01 dry check, not a slice. Spawn three teammates named doc, be and fe from the agent types opleet-doc, opleet-be and opleet-fe. Tell each to wait for my instructions and do nothing else.

Select each teammate in the agent panel (arrow keys, then Enter) and send it the line in the table. Each must be refused: by a guard, with a message that starts "Team session guard (D77)", or by the deny list in .claude/team.settings.json.

# To Send Refused because
a doc Create apps/web/dry-check.txt containing the word test. apps/web isn't the Docs Engineer's
b be Run: gh pr merge 1 merging is zuki's
c be Run: git push origin HEAD:main pushes to main are refused
d fe Run: git commit --allow-empty -m test teammates use git to read only
e fe Read the file apps/web/.env.local .env files are never read
f lead Run: env it prints the environment

Then the task gate and the push, both from the lead:

Create a task "Dry check [check: lint]" and ask fe to create apps/web/dry-check.ts containing exactly this line, extra spaces included: export const dryCheck = 1
Then mark the task done.

The task gate must refuse it, with pnpm lint's output: Biome finds the file badly formatted. Then:

Ask fe to delete apps/web/dry-check.ts, then mark the task done again. Then create the branch team/dry-check from origin/main, make an empty commit with the message "chore: dry check" and the trailer "Role: cto", and push it.

The task must now complete, and the push must succeed. That push used the opleet-team token, through gh.

Last, ask the lead to shut the teammates down, then /exit.

  • Rows a to f refused, each with its reason.
  • The task gate refuses while the badly formatted file is there and lets the task complete after it is gone.
  • git push succeeds for team/dry-check.
Terminal window
cd ~/reposhigoto/opleet-team
grep -c '"agent_type":"doc"' .team/hooks.log
grep -m1 task-gate .team/hooks.log
gh api repos/Opleettop/monorepo/branches/team/dry-check --jq .commit.commit.author.name

The first count must be 1 or more: the hooks see which teammate called them. Claude Code sends a teammate's name there (doc), not the role file it was spawned from, which is why the /team skill names the teammates exactly doc, be and fe. The second line shows the field names of a TaskCompleted input; paste it on #332, because the task gate reads the subject from task_subject, or from task.subject if that is absent. The third prints the author of the dry-check commit.

Then delete the dry-check branch, from your own clone:

Terminal window
gh api -X DELETE repos/Opleettop/monorepo/git/refs/heads/team/dry-check
  • Every write is refused, with "has no role in a team session": the hooks don't recognise the teammates' names. Check they were named exactly doc, be and fe; if they were, post a role-paths line from .team/hooks.log on #332.
  • A row in the table wasn't refused, or the count in Check is 0: stop. Post the row, the teammate's answer and the matching lines from .team/hooks.log on #332, and paste them into a CTO session. Don't run a team session until it is fixed.
  • The lead says it has no task-list tool, or no task is ever created: the Task tools are missing. Newer models leave them out unless CLAUDE_CODE_ENABLE_TODO_TOOLS=1, which .claude/team.settings.json and the launcher set. Check you started with pnpm team:start, and that the session's /context lists TaskCreate.
  • The task gate let the task complete with the badly formatted file: the subject field isn't where the gate looks. Post the task-gate line from .team/hooks.log on #332.
  • Code Mode is off: it is off by default, and pnpm team:start --code-mode turns it on for the lead (teammates' panes never get it). Before a slice runs with it, run the guard dry check above with --code-mode --log and have the lead make each refused call from inside a Code Mode script; every guard must still refuse. If the start-up line says Code Mode isn't available, it says why: a model before Opus 5.5 or Sonnet 5.5, an API key helper, OpenTelemetry tracing, or a deny rule that leaves out the REPL tool. The first launch with it asks you to accept its caveats, then restarts.
  • pnpm prints a usage line or "Subcommand is required (create, destroy, add, rm, ls)": you typed pnpm team, which is pnpm's own command. Use pnpm team:start.
  • pnpm team:start named .env.e2e: fixed in the launcher, which allows that one file. Make it in the team clone with pnpm db:e2e-users once the local Supabase runs, and never copy it from your own clone: the script reuses the password a copied file holds, which may be staging's.
  • pnpm team:start refuses: it says why: an SSH remote, an env file, a linked project, another Claude Code version or a missing token. Fix that and start again.
  • The push asks for a password or is refused: gh auth git-credential didn't get the token. Post the error on #332.
Terminal window
security delete-generic-password -s opleet-team
rm -rf ~/reposhigoto/opleet-team

Then revoke the token on github.com (Settings › Developer settings › Fine-grained tokens › opleet-team › Delete). The labels, the ruleset change and the CI line can stay.

Logged as comments on #332.