A Claude Code harness that earns its autonomy.
Deep research, then interrogation — until the spec is extracted from your head onto the page. An orchestrator agent with a tight spec and a solid harness can be trusted to work while you sleep.
/discovery fires it off
One prompt. Discovery clarifies ambiguities, reviews adversarially, and spawns one ticket per scoped piece of work.
/refine each ticket separately
Refinement turns a scoped ticket into a buildable spec. Each ticket lands with shared scope, cited prior art, and pinned acceptance criteria — the things that prevent rework once code starts.
Earn the spec, pick the harness.
The same lifecycle, three different gate sequences.
Frontmatter declares complexity and criticality. Those two values decide which gates fire. Drag the slider — a ghost-train runs the new sequence so you can see exactly which phases the framework runs.
Research phase 02
- Stardew Valley: tight skill window, instant feedback.
- Animal CrossingSea of Thieves: fishing as social ritual.
- Dredge: dread, reward, depth as risk axis.
- Real-world nightline: hooks set at dusk, retrieved at dawn — a sleep-while-you-fish craft.
Specify phase 03
Plan phase 04/critical-review available before approval
If a spec earns it, this is what handoff looks like.
-
spec earnedlifecycle/{slug}/spec.mdall four phases locked. the orchestrator now has a tight enough spec to work without you.
-
/discovery — fan-outlifecycle-research/{topic}/*.mdspawns research branches in parallel — one rail per reference signal.
- → Stardew Valley · feedback-loop ref
- → Sea of Thieves · social-ritual ref
- → Dredge · depth-as-risk ref
- → real-world nightline · sleep-while-you-fish craft
-
backlog · 5 ticketsbacklog/NNN-*.mddiscovery converges into named, refinable tickets.
-
/refine — per ticketclarify · research · spec · plan · critical-revieweach ticket clears its own gates. five tickets → five tight specs.
- → tackle data model
- → cast/set screen
- → overnight resolver
- → dawn reveal anim
- → catch encyclopedia
-
/overnight — parallel railsovernight-state.json · MCP serverorchestrator runs the tickets in parallel.
read_spec → advance_phaseper ticket. branches and PRs created as they pass critical-review. -
/morning-review — convergelifecycle/morning-report.mdmerges PRs · closes lifecycles · drops a report you can skim with coffee.
Inside /overnight · the safety contract.
Knows when to stop.
Three independent counters watch the run. zero_progress trips when nothing has advanced in 5 rounds. time trips at 10 hours. failures trips when the same ticket keeps blowing up. Any one of them ends the run cleanly — saves state, writes the report, exits — instead of churning until your wallet or your repo notices.
Climbs when stuck — stops calmly when it can't.
Failed gates don't loop blindly. The first retry runs on the same model; the next escalates to opus; the third hands off to a separate brain agent that decides SKIP, DEFER, or continue.
When even the brain can't decide cleanly, the harness writes ./deferred/<ticket>.md with what it tried and what it needs from you — then carries on with the rest of the queue. Three rungs, a judge, one calm exit.
Stays in its lane.
Each ticket runs in its own git worktree on its own branch. The agent can’t reach main, can’t touch packed-refs, can’t read other repos, and has its tool list pinned ahead of time. The fence is enforced at the seatbelt layer, not asked-for politely — the agent literally cannot do the things outside it.
Schedules around conflicts. Heals what slips through.
Conflicts are mostly prevented before they happen. /overnight reads each ticket's file list and groups tickets into rounds so no two tickets in the same round touch the same file — and dependencies wait for their predecessors to finish. When a conflict still slips through, the harness uses a graded heal: trivial conflicts (whitespace, imports, non-overlapping hunks) take a fast-path stamp; real conflicts get exactly one bounded repair attempt, then defer. No infinite repair loops, no surprise force-pushes.
Survives interruption.
Every phase transition writes overnight-state.json atomically before continuing. Close your laptop mid-run, lose power, kill the process — on restart, interrupt.py reads the last checkpoint, reconciles any half-finished branch, and resumes from exactly where it left off. No double-merges, no orphaned worktrees, no lost work.
Tells you everything it did.
Five JSONL streams record everything during the run: phase transitions, agent spawns, retries, conflicts, and brain triage decisions. At dawn they’re collated into a single morning-report.md — what merged, what was skipped and why, what’s waiting for you. Every decision is auditable; nothing happens off the record.
Start with the skills. Add overnight when you want autonomy.
cortex-core
The interactive lifecycle — /discovery, /refine, /critical-review, /lifecycle — installed as a Claude Code plugin. Start here. Run /lifecycle on a real ticket to feel the gates with you in the loop.
install: /plugin install cortex-core@cortex-command
cortex-overnight
The autonomous half. Installing this plugin auto-bundles the cortex CLI (cortex overnight / cortex morning-review) and an MCP server (read_spec, advance_phase, list_lifecycles) so any MCP-speaking agent can read Cortex state. Skip it if you only want gated lifecycles in-session.
install: /plugin install cortex-overnight@cortex-command
first run: cortex init — registers Cortex's umbrella path with Claude Code's sandbox.
plugins keep the CLI and MCP server in sync — no separate install loop