Your agent works the night shift. You keep the rulings.
A harness for long-horizon Claude Code work. One map per project with the objective and the
distance to it, a loop that kills ideas with cheap tests instead of certifying them, hooks that
catch the sessions where discipline usually goes first, and four kinds of decision that stay
yours.
Claude Code is very good for an hour. The problems start at hour nine, on day three, at 11pm
when something is broken and you have no patience left: context is lost, claims stop carrying
evidence, "done" starts meaning "I ran out of ideas", and a plan applied to 30% of its sites
reads as finished. Nightshift is the scaffolding for that part — state lives in files, not in
the conversation, so the next session re-anchors from disk and continues.
It runs on itself. Every convention here is enforced on this repository by the gates in
tests/.
Version 2 changed the spine, on evidence. Version 1.0 ran on a goal contract decomposed into
phases, a verifier grading every phase and a docket for every decision. Measured on one project
over six weeks, that produced four registry edits per code edit, half of all final messages
handing a decision back to the user, and 445k words of record: conformance, not distance
covered. Version 2 keeps the hooks, the agents and the workflows, and replaces the spine with
one map and the distance to the objective. The reasoning is at the top of
ORCHESTRATION.md; the old spine is tag v1.0.0.
What you get
| | |
|---|
| Work that outlives the session | one map per project, HANDOFF.md: objective, current value, gap, levers, fog | a crash costs one iteration, not the thread |
| Ideas killed cheaply | every lever gets the cheapest test that can kill it; the dead are recorded with the number | the night is spent on what survived, and nobody re-proposes what died |
| A loop that runs unattended | re-anchor → biggest gap → kill tests → redraw the map → schedule the next | it keeps itself alive across sessions, and stops when the gap will not move |
| Rigor where an error costs something | done report, full suite, adversarial-reviewer, loop-verifier | at the boundary (PR, release, paper, deploy), never per iteration |
| Deterministic multi-agent orchestration | 5 workflows, drawn one by one in docs/WORKFLOWS.md | scripts with real control flow, not a prompt asking for parallelism |
| Rails you never invoke | 7 hooks, fired by events | discipline that survives the hour when you have none |
| The surface | 7 skills · 4 agents · 8 commands — named under Surface | small on purpose: descriptions compete for the model's attention |
The protocol is ORCHESTRATION.md — the map, the loop, the boundary — and
docs/COOKBOOK.md has ten end-to-end workloads. Plus an installer with
drift detection, a 114-case hook regression suite, a status line, git guards, and systemd units
for scheduled runs.
The single idea: make the good path the default path, so that using it at 11pm requires no
willpower.
Why this is not a skill collection
Four things a set of prompts cannot do, all of them mechanical: