Night Shift — rotating-brains overnight improvement loop

Status:draft — awaiting Jack's design sign-off
Date:2026-07-24
Type:research + design
Project:claude-jacked

1. Verdict

Build both. A new companion skill (working name night-shift) that runs the rotating-brains overnight improvement loop, plus five surgical upgrades folded into recursive-10-10-product-hardening. They occupy different seams:

recursive-10-10-product-hardeningnight-shift (new)
Question"Does what exists actually work?""Is what exists what a best-in-class product would be?"
DirectionConvergent: spec from code, close the gap, verifyDivergent then convergent: each brain discovers gaps beyond the spec, proposes, builds, proves
Reference pointThe code's own claimsBest-in-class per lens, researched fresh each run
Ends whenEvery behavior row VerifiedNever (standing patrol) or when the improvement queue is dry and all brains report no new findings

night-shift piggybacks rather than duplicates: it consumes coverage-matrix scores, invokes recursive-10-10 semantics for verification, and reuses /bhag's two-gate auto-merge safety model verbatim.

2. What was surveyed

SourceWhat it isBest idea
Ralph Playbook (Huntley / Farr)The canonical dumb outer loop: while :; do cat PROMPT.md | claude; doneFresh context per iteration + a persistent plan file on disk as the only shared state; "backpressure" (tests, lints, LLM-as-judge with binary pass/fail) rejects bad work; the plan is disposable.
Anthropic harness-design post (Mar 2026)Planner / generator / evaluator harness for multi-hour buildsAgents grading their own work skew positive. A separate, deliberately skeptical evaluator that drives the app in a browser before scoring is the load-bearing component. Sprint contracts: generator and evaluator agree what "done" means before code is written.
gstack (Garry Tan)Persona review pipeline: CEO, Design, Eng, DX brains over one planPersonas as 18 named cognitive patterns with routing ("when you challenge scope, apply focus-as-subtraction"), not checklists. Dual independent voices per lens with a consensus table where a missing voice never counts as agreement. A three-tier decision taxonomy: Mechanical (auto), Taste (auto + logged recommendation), User-Challenge (never auto-decided).
Gas Town + Beads (Yegge)20 to 30 agent town with standing patrol rolesHook + molecule persistence: one per-role pointer to "current step" in a pre-materialized step chain on disk makes crashes and context exhaustion non-events. Patrols with exponential backoff. One serialization role (Refinery) lands changes one at a time against fresh main.
Compound Engineering (Every / Klaassen)Plan, Work, Review, Compound loop; 26-agent pluginThe Compound phase: every cycle ends by asking "would the system catch this automatically next time?" with an escalation ladder (note, then CLAUDE.md rule, then a new dedicated reviewer agent). Filename-encoded queues: NNN-ready-p1-slug.md, greppable and crash-resumable. Named persona reviewers fanned out in parallel and merged into one P1/P2/P3 list.
BMAD MethodNamed-persona agile team (Analyst, PM, Architect, PO, Dev, QA)Strict role boundaries with file-based artifact handoffs; confirmation that the persona-team pattern scales to 48k stars of adoption. Too ceremonial to copy wholesale.
Subagent collections (VoltAgent et al.)Commodity persona reviewer librariesEstablishes the table-stakes lens roster (code-reviewer, security-reviewer, architect-reviewer, product-manager). Nothing to steal beyond the roster names; they are checklists, which gstack's technique beats.
Greptile PR-corpus study (May 2026)Millions of PRs; agent vs human qualityOvernight-agent PRs are ~28% of merges and no worse than human overall, but each agent has a failure fingerprint. Claude: IDOR / missing tenant check 1.75x human, stale docs 1.69x, off-by-one 1.64x, XSS 1.57x, auth bypass 1.50x. The security lens should over-weight exactly these.
"Team of Rivals" (arXiv 2601.14351)Multi-agent organizational-intelligence studyCascaded critique with orthogonally specialized inner critics caught 87.8% of errors; an outer-loop output critic caught a further 14.6%. Lens diversity beats lens redundancy, measurably.

Also checked and deliberately not copied: claude-flow / ruflo (enterprise swarm theater), Spec-Kit / OpenSpec / GSD (phase-gate spec tooling; the vibe-to-spec interview is /blindspot's job already).

3. The cautionary evidence

4. The steal list

ConcernMechanicFrom
Loop shapeDumb outer loop, fresh context per iteration, one unit of work per iteration, durable state only on diskRalph
Crash resilienceHook file (current-step pointer) + pre-materialized step chain; filename-encoded queue NNN-{status}-{prio}-{lens}-{slug}.mdGas Town, Every
Persona definitionCognitive patterns + routing paragraph, not checklists; banned-phrase anti-sycophancy list; anti-convergence rule ("different design teams, not the same team at three coffee levels")gstack
Lens diversityOrthogonal specialization across brains; a finding that two brains produce independently is a high-confidence signal, near-duplicates within one brain are paddingTeam of Rivals, gstack autoplan
Quality gateGenerator/evaluator separation; skeptical browser-driving evaluator; sprint contract negotiated before code; hard per-criterion thresholdsAnthropic
Subjective gatesLLM-as-judge backpressure with binary pass/fail for aesthetics, tone, UX feelRalph playbook
Merge safetySerialize landings one at a time against fresh main; evidence gates only; reuse /bhag two-gate production guardGas Town (Refinery, done right), existing jacked doctrine
Autonomy decisionsMechanical auto / Taste auto-with-logged-decision-brief / User-Challenge queued to a morning report, never auto-decidedgstack (de-blocked for overnight)
Self-improvementCompound phase each iteration: "would the system catch this automatically next time?"; escalation ladder note → rule → dedicated reviewer; learnings written with frontmatter so they are findableEvery
HonestyAnti-compression clause: "no issues found" must state what was examined in 1-2 sentences; artifacts must exist on diskgstack autoplan
Idle economicsPatrol with exponential backoff: standing mode sleeps longer each empty pass, wakes on repo mutationGas Town
Security focusSecurity brain over-weights Claude's own measured failure fingerprint: tenancy/IDOR, auth bypass, XSS, off-by-one, stale docsGreptile

5. Proposal A: the night-shift skill

flowchart TB
  A[Wake: read HOOK.md + queue] --> B{Queue has ready items?}
  B -- no --> C[Rotate to next brain in roster]
  C --> D[Brain: best-in-class research via firecrawl
+ product walk
+ findings with citations] D --> E[Findings → queue items
NNN-ready-pN-lens-slug.md
dedup vs ALL prior findings] E --> B B -- yes --> F[Pick highest-priority ready item] F --> G[Negotiate done-contract
generator ↔ evaluator] G --> H[Generator implements
on branch, tests green] H --> I[Skeptical evaluator:
browser-drive + judge vs contract] I -- fail --> H I -- pass --> J[Land: PR → checks appear AND pass
→ merge serialized vs fresh main] J --> K[Compound: write back learnings
note → rule → new reviewer] K --> L[Update HOOK.md + morning report] L --> B
wake → (queue empty? rotate brain: research best-in-class → findings → queue) → pick item → done-contract → implement → skeptical evaluator (loop until pass) → evidence-gated land → compound learnings → update hook → repeat

5.1 The two alternating phases

Patrol phase (divergent). When the queue has no ready items, the next brain in the roster takes the wheel for one full iteration. It (a) researches best-in-class for its lens in this product category via firecrawl, citing sources and scoping every statistic to its dataset; (b) walks the actual product (browser for UI brains, code for engineering brains, both for most); (c) emits findings as queue items with a decision-brief each: what, why, evidence, effort, the brain's recommendation, and its lens signature. Dedup runs against ALL prior findings (accepted, rejected, and open), so judge-rejected ideas do not resurrect every night.

Build phase (convergent). While ready items exist, iterations consume the queue: pick highest priority, negotiate a done-contract between generator and evaluator (Anthropic's sprint contract), implement on a branch with tests, then the skeptical evaluator browser-drives and judges against the contract. Pass lands through the evidence gate; fail loops with feedback, subject to the stuck-only backstop (3 consecutive no-progress attempts → mark blocked, move on).

5.2 The brain roster (default; per-repo overridable)

BrainLensDefined by
First-time userOnboarding, discoverability, empty states, "can I even figure this out"Each brain is a persona file: 5-8 cognitive patterns with routing, a banned-phrase list, 2-3 worked BAD/GOOD examples, and its research targets (who is best-in-class for THIS lens). Guidance, not algorithms, per jacked skill doctrine.
Power user (per real user type)Workflow friction, click counts, keyboard paths, bulk operations, table stakes vs competitors
DesignerVisual quality, motion, dark mode, anti-slop; judgment runs on the Fable lane
Developer / DXAPI ergonomics, error messages, docs currency, setup friction
SecurityOWASP + STRIDE, over-weighting Claude's measured fingerprint (tenancy/IDOR 1.75x, auth 1.5x, XSS 1.57x); runs on the Fable lane per chain-of-command
ComplianceDomain-appropriate: HIPAA/PHI for healthcare repos, PCI for billing, licensing/provenance elsewhere
SRE / reliabilityFailure paths, silent failures, observability, data integrity
Product CEOScope, positioning, "what would make this best-in-class", kill-list of features nobody needs
Support / docsError-message quality, help content, "what generates tickets"

5.3 State substrate (all on disk, in-repo, git-ignored scratch where noted)

.night-shift/
  HOOK.md                 # current-step pointer: brain index, active item, phase
  roster.md               # brain roster for this repo (generated on first run, editable)
  queue/                  # NNN-{ready|building|blocked|landed|rejected}-{p1|p2|p3}-{lens}-{slug}.md
  findings-ledger.md      # every finding ever, with disposition; the dedup reference
  learnings/              # compound-phase output, YAML frontmatter, escalation status
  morning-report.html     # user-challenge decisions queued + the night's ledger (regenerated each run)
  scratch/                # ephemeral bookkeeping, git-ignored, squashed to a digest at run end

5.4 Non-negotiables carried over from house doctrine

6. Proposal B: upgrades to recursive-10-10-product-hardening

#UpgradeSource
1Harden the Step 5 self-check into a true generator/evaluator split: the evaluator is a fresh-context agent that never sees the fixer's conversation, is prompted skeptical, and browser-drives before grading. The fixer never sets its own row to Verified.Anthropic
2Anti-compression clause in evidence rules: a clean pass on any area must state in 1-2 sentences what was examined; fewer than that is compression, not verification.gstack
3LLM-as-judge binary backpressure as an explicit test method for subjective rows (aesthetics, tone, UX feel) in the Step 1 test strategy and Step 5 loop.Ralph
4Restore point before first mutation: verbatim copy of the canonical workbook (and any plan file) with a pointer comment, so a bad run is one copy away from recovery.gstack
5Failure-fingerprint weighting: the test/fix loop explicitly over-tests tenancy/IDOR, auth paths, XSS, off-by-one boundaries, and doc staleness, because that is where Claude-authored changes statistically fail.Greptile

7. Open design choices (Jack's call)

ChoiceOptionsRecommendation
Namenight-shift / brain-trust / patrolnight-shift: says overnight + standing roles in two words
Where it shipsjacked core skill (jacked/data/skills/) vs skill-pack vs local-onlyjacked core, same as recursive-10-10; it is a flagship
Loop driverSkill-internal iteration (like /bhag) vs external loop.sh Ralph-style vs /loop dynamic modeSkill-internal with the hook file making any external driver (cron, /loop, plain rerun) trivially resumable — best of both
Relationship to /bhagReplace / absorb / coexistCoexist: /bhag drives the coverage matrix; night-shift is lens-driven discovery + compound learning. Revisit merging after night-shift proves out.

8. Build plan


Generated with the jacked HTML artifact template.