# Neon co-lead This file says when a Claude Code lead runs Gemini 4 Neon as its co-lead, what the co-lead owns and how the lead checks its work. The pstack block in `AGENTS.md` points here. The `sync-pstack` skill renders this file from its shared source in `udecode/dotai`, so change it there. - **Neon co-lead.** In Claude Code, a run that follows a pstack playbook, other than one under "fast", starts one Neon co-lead and keeps it for the whole run (owner's word, 2026-11-25). The co-lead is one agy conversation on the models sheet's `co-lead` line, at that line's effort. The lead starts it with `node .agents/pstack/cross.mjs --to agy --colead --effort --stream /colead-.jsonl --prompt-file `. `` is the root of the session's own worktree. The helper writes the stream file as agy works, so the lead can follow a step's progress there. It prints the `conversation:` id on stderr as soon as agy starts, and the lead writes that id to `colead.txt` in the run directory. With the run's next decision-log batch, the lead logs a `colead` row whose decision is the co-lead's model and effort, such as `agy:gemini-4-neon @xhigh`, and whose evidence names `conversation `. The plan page shows that row beside the lead. `levels.mjs` judges it against the models sheet's `co-lead` line. Each later step adds `--conversation `, so the co-lead keeps the run's history the way the lead does. After a compaction the lead reads the id back from that file. Each call is one step and runs in the background. One step runs at a time, so an evidence lane the run needs beside a running step goes to an `opus` subagent, as the Extraction rule says. The helper stops a call only at 55 minutes, even one that prints nothing for a long time, such as a browser run queued behind other worktrees. A step that cannot finish in that time is split into several calls. - **What the co-lead owns.** Research and evidence lanes, explore rounds, architecture and API design sketches, perf and hillclimb iterations, a bug's repro and its failing test, code that is not UI, and the proof of behavior that drives a browser, a simulator or an emulator, such as a repro or an end-to-end test, a UI change's included. The two shapes that the Panel review rule has the lead sketch for `architect` are the co-lead's step, and the lead still picks one. A drive through a signed-in site stays with the lead in Claude in Chrome, because the co-lead's browser has no sign-ins. For code that is not UI, the co-lead takes the place of the code delegate in pstack's Feature step 4, so that code needs no delegate worktree. The co-lead writes only in the lead's worktree, the run directory and a detached worktree it adds for a base control, such as the `Introduced-by` check. It runs `node .agents/pstack/setup.mjs` in that worktree first, as the Git rule says, and removes it with `git worktree remove --force` once the control is done. - **Briefs.** Each brief names the step, the run directory and each project skill the step's work loads, such as `verify` for a repro and its proof or `plate-plugins` for a plugin, and tells the co-lead to read each one's `.claude/skills//SKILL.md` in full before it works. The first brief also tells it to read `AGENTS.md` in full for the project's rules on code, tests and proof. The helper's own brief tells the co-lead which duties stay the lead's: plans, reviews, the writing passes, landing, messages and the stop for missing pstack skills. An agy call returns only once every background task the co-lead started has ended, and a dev server never ends. So the helper's brief also has the co-lead poll each server it starts instead of waiting for its task, and kill every task and remove every probe or control file before its final message. It leaves a booted emulator or simulator running, because other runs share it. When a call ends, the helper stops every process that carries the call's `PSTACK_SEAT` variable. So a project helper that boots a device every worktree shares starts it with the environment that `cross.mjs`'s `envOutlivingSeat` returns, which lacks that variable. - **What the lead keeps.** The lead talks to the owner. It keeps plans and plan pages, UI code and anything visual, the writing passes, landing and the final call on a design. A code delegate on the playbook's models-sheet line writes the UI code and its unit and component specs in the delegate's own worktree, as pstack's Feature step 4 says. The lead reviews that delegate's diff and applies it to its own worktree only between co-lead steps. Anything visual includes the hand drive of a change a person sees and its demo clip, which the lead or its `clip` helper records on a dev server the lead starts itself. The lead also writes every piece of prose, such as replies, docs, commit messages and team messages. While a co-lead step runs, the lead edits no file in that worktree. - **Checks.** Before the lead uses a step's answer, it reads the evidence files the step wrote as well as the answer, and puts back each finding the answer dropped. It reviews the step's diff with `git diff` and reruns the proof the step claims, or the narrowest check that proves it. It checks a ranking of options for a cheaper path the co-lead left out. When it finds one, the next step's brief gives that path and its evidence, and the co-lead takes it or says why not. When the lead and the co-lead still disagree on a design after that step, the design counts as contested, so it runs an arena as the Panel review rule says, and the lead never overrules the co-lead alone. A disagreement on a fact, such as a bug's cause, is no design question, so the run settles it with the check that tells the two readings apart. A pick that the co-lead makes and these checks leave standing is the run's pick, and the lead keeps going on it without asking the owner (owner's word, 2026-11-26). - **Fresh reviews.** A panel seat, an arena runner, a judge and a second reader never run in the co-lead's conversation, and the co-lead never reviews its own work. A Neon seat on a panel is a fresh `cross.mjs` run, as the Panel review rule says. An independent reviewer that a playbook step asks for is a fresh run too, never the lead's review of the co-lead's diff. While a panel round runs, no co-lead step writes a file its seats read. - **Guards.** `cross.mjs --colead` runs agy with `--dangerously-skip-permissions` and without its sandbox, because the co-lead runs dev servers, browsers and emulators. The helper refuses a folder that is not a worktree's root and refuses a main checkout. It gives git a pre-push hook that refuses every push, gives `gh` an empty config and drops the GitHub tokens from the co-lead's environment, so a plain `git push` or `gh` command fails. A call that changes the main checkout's `git status` or its diff exits 1 and prints its answer after the warning. agy's edits never pass the Claude Code hook that refuses an edit past the step budget, so the helper counts the worktree's change as that hook does. When the change builds a plan step, the brief gives the co-lead the count and the budget. A call that leaves the step past the budget exits 1 and prints its answer after the count. The lead then splits the step before it reviews the diff. A write there to a file git ignores, such as one in the run directory, does not count. These guards stop accidents, not an adversary. A co-lead that reads a web page can still run any command, so the lead treats each step's commands and diff as untrusted until it has reviewed them. - **Fallback.** When a call fails, such as on a usage limit, the lead runs it once more. When that fails too, the rest of the run's co-lead work goes to one `Agent` subagent on the model and effort the sheet line names after `or`. Unlike a code delegate, it starts without `isolation`, so it works in the lead's worktree. Each later step reaches it through `SendMessage`, so it keeps the run's history. The lead logs another `colead` row that names the subagent's model and effort, such as `opus @high`. The hand-back says the run fell back. - **Friction.** Until the owner ends the co-lead trial, a lead reports co-lead friction instead of working around it (owner's word, 2026-11-26). Friction is anything in agy, `cross.mjs` or this file that stops, slows or misleads a co-lead step. Examples are a call that hangs or loses its answer, a guard that misses and a brief that leaves out what the step needs. A usage limit is no friction, because the Fallback bullet handles it. The lead first takes the newest shared helpers and rules, because the fix may already have landed. It rebases onto the fetched base branch, or, while the worktree holds uncommitted work, runs `git checkout origin/ -- .agents/pstack`. Then it reruns the step from the worktree as the failed call left it, once it has reviewed that call's diff as the Checks bullet says. Reading a lost answer back from the step's stream file is one of those checks, not a workaround, and the report below still goes. When the friction stays, the lead sends a report to the session titled `📌 pstack` with the runtime's cross-session message tool. The report names the friction, the step, its stream and error files, what the lead tried and what the run holds. That session fixes the shared source and messages back once the fix lands. The lead then takes the newest helpers again and reruns the step. Until that message, the lead holds every step that needs the co-lead and works on other ready work, as the Autopilot rule says for an external gate. With no other ready work left, it ends its turn, and that session's message starts its next one. It never records the friction as a limit. It never moves the step to the Fallback bullet's subagent and never fixes the shared source itself, because one session owns these fixes while the trial runs. When no session with that title is listed, the lead fixes the friction itself, as the Improve the workflow mid-task rule says. Friction in a Neon panel seat or another agy run is reported the same way, while its round goes on as the Panel review rule says.