Esc

Three run-paths

You have three ways to engage the cotton team, ordered by context-preservation:

A — cotton-orchestrate skill (default)
Invoke the cotton-orchestrate skill or say "orchestrator mode." This chat stays the conductor and keeps its full conversation memory while delegating heavy work to subagents. The root orchestrator runs inside the current thread. Best for most tasks.
B — Spawn cotton-orchestrator subagent
Use the Agent tool to launch cotton-orchestrator as an independent subagent with its own context window. Useful when you want full isolation or parallel team branches.
C — Headless cotton-goal
cotton-goal "<condition>" — goal mode. The team loops until the goal condition is provably true, then emits COTTON DONE: <condition> — <proof>. Requires COTTON GATE: PASS before it can close.

Subagents vs Agent Teams

Two delegation modes exist depending on whether work is sequential or genuinely parallel:

The cotton-orchestrator is the ONLY agent allowed to call TeamCreate. Bosses and workers communicate via SendMessage, not by creating new teams.

The build flow

Every task follows the same ordered pipeline — scouts first, experts next, builders after, then the quality gate last:

01
Recon

Scouts gather context — web, filesystem, docs — as JSON facts.

02
Plan

Experts produce a rigorous plan: invariants, trade-offs, ordered steps. Never code.

03
Build

Bosses delegate to workers. Workers type. Leaf agents do not delegate.

04
Verify

cotton-boss-tester directs test writers → runner → auditor.

05
Audit

cotton-agent-auditor sweeps diff + logs for bugs and security issues.

06
Gate

cotton-boss-tester issues the verdict. Open Critical/High findings block sign-off.

The verify → audit gate

Nothing is done until cotton-boss-tester says so. It is always the last step in any flow. The order is fixed: write tests → run tests → audit → verdict.

Verdict lines to recognize in agent output:

TEST_RESULT: PASS (42 passed)
TEST_RESULT: FAIL (3 failed, 1 error)
AUDIT_RESULT: CLEAN
AUDIT_RESULT: ISSUES (1 critical, 2 high)
COTTON GATE: PASS — tests green, audit clean
COTTON GATE: FAIL — <blocker description>

On COTTON GATE: FAIL, the tester routes the blocking findings back to the owning boss via SendMessage. The loop continues until the gate is green.

Root status lines

In goal mode, the root orchestrator emits one status line per turn and a closing line when done:

COTTON STATUS: DONE — <evidence of goal met>
COTTON STATUS: NOT DONE — <what remains>
COTTON DONE: <condition> — <proof>

Goal mode

Goal mode is a deterministic loop: the team keeps running until a condition is provably satisfied. It is guarded by a Stop hook (~/.claude/hooks/cotton-goal-gate.py) that reads .claude/goal.json and blocks the conversation from ending until COTTON GATE: PASS has been issued.

Manage goals via the CLI:

cotton-goal "<condition string>"   # start
cotton-goal check                    # is goal met?
cotton-goal status                   # current goal
cotton-goal clear                    # remove goal

Key rules