D106 · Every session runs the guards, a solo session takes one role and spawns the others, and an independent reviewer reads each change
Proposed · 2026-11-20 · zuki, in the AI-first audit session of 2026-11-20 · Answers #707; it binds when this page's pull request is merged · Applies to every Claude session (D28), team sessions (D77) and teammate models (D105)
Decision: The guards that hold a team session (D77) hold every Claude session in this repository. .claude/settings.json loads them, so solo sessions on zuki's Mac and cloud sessions get them too. A solo session takes one role, from its first message or /start <role>, and writes only to that role's paths. For work in another role's paths it spawns that role's agent (opleet-doc, opleet-be or opleet-fe) as a subagent, or zuki starts a session in that role. Before any session opens a pull request, a read-only agent, opleet-review, reviews the change with a fresh context. A team runs it at /team-close, and a solo session at /end-session.
Why: The AI-first audit of 2026-11-20 found the guards in force only in team sessions, through .claude/team.settings.json. Most sessions are solo or in the cloud, and there the deny list, the read guard and the role paths were prose alone. A solo session also had to read its way in from a long list, and every repeated step (a decision, a rule page, a runbook step, ending a session) was prose to follow by hand. No session had a reviewer that didn't write the change: at close, the lead audited its own team's work. zuki chose all three on the day, and judged the reviewer worth its cost per slice.
Not taken: letting a solo session switch roles mid-session. That would make the role paths advisory. Also not taken: one agent per session with every role's paths. That would lose the lanes that the Role: trailer and CI already enforce.
Consequences:
- Guards everywhere.
.claude/settings.jsonloadsguard-bash.mjs,guard-read.mjsandrole-paths.mjsand carries the team's deny list. Every tracked file has an owner in.claude/team/roles.json, so no session is locked out of one: the docs site's own files, tools/docs, the root files and.agents/are the CTO's. Writes outside the repository go only to scratch folders and Claude Code's plans and memory, never its settings. The team launcher still adds its own settings, the context nudge and the task gate.gh api -X GETwith fields is a read, and the guard allows it, so the cloud's code search works. - The session's role.
.claude/hooks/session-role.mjsrecords the role named in the first message ("BE: …") or by/start <role>in.team/session-roles/. A session that names none is a CTO session, as starting a session says, and/startmay still set a role until one has been named. A named role never changes, and/clearstarts a new session that names its role again. Only the main session and the role agents write in the repository; any other subagent writes to scratch folders alone. The record is a lane marker, not a credential: theRole:trailer check in Lefthook and CI still decides what a commit may touch. - Role agents as subagents.
opleet-doc,opleet-beandopleet-femay be spawned by a solo session. They report in their final message instead of a mailbox and run their own checks. They read git and gh only, and the main session commits each role's files under that role'sRole:trailer. Their models follow D105. - The reviewer.
.claude/agents/opleet-review.mdhas Read, Grep, Glob and Bash, and no role, so the role-paths hook refuses it a write. It defaults to Sonnet, and Opus when the change touches RLS, security-definer functions, triggers or migrations that change status, money or numbers. A blocking finding is fixed and reviewed again. A should finding is fixed or opened as an issue. The verdict and the findings go in the pull request body or the digest. zuki still reviews and merges every pull request (D28). - Skills.
/startand/end-sessionframe a solo session.new-decision,rule-pageandrunbook-stepturn the steps of how-we-work.md, rules.md and runbook-steps.md into procedures. They point to those pages, which stay the rules. .gitignoreignores every.env*file except templates. The next-devtools MCP server is pinned to an exact version, and its two config files,.mcp.jsonand.pi/, join the CTO's root tooling paths.