Documentation

How Nightshift works

Understand the durable contract, one-item loop, gates, decisions, recovery, and morning handoff.

Answers: how Nightshift works · Updated

SHORT ANSWER

Nightshift moves the working contract out of chat and onto disk. The agent reads one approved item, implements it, runs its gates, commits it locally, ticks it, and continues until the list is complete or the owner stops the shift.

01

The durable loop

Every item follows the same visible cycle. The punch list remains authoritative across compaction, restart, or a recovered session.

  • Read the current item and gates.
  • Build the complete outcome.
  • Run the required verification.
  • Create one local conventional commit.
  • Tick the item and continue.
02

Questions become decisions

An unattended run cannot wait for a sleeping owner. When a choice is genuinely yours, Nightshift selects a reversible default, records the reasoning and rollback in the parking lot, and keeps working. Known later work belongs on the drafting table instead.

  • Parking lot: owner decisions and defaults chosen.
  • Drafting table: known work staged for later.
  • Snag log: findings and their disposition.
  • Shift log: progress, recovery, and handoff events.
03

Recovery without a second worker

One shift binds one session identity and one process lease. A watchman starts a replacement only when host evidence shows the active process is gone and the recorded identity can be resumed or safely handed off.

  • The punch list survives even when conversation history does not.
  • The process lease prevents the older process from continuing observable tool work.
  • Other normal tabs and conversations remain free to work.
TRY IT

Start with a bounded prompt

This prompt names the outcome and preserves Nightshift’s review boundary. Paste it into the supported coding host from the project you want to change.

Explain how Nightshift would keep this project's objective, progress, decisions, and verification durable before I start a shift.
BOUNDARIES

What this workflow does not claim

  • A checked box is self-reported; the gate does not independently prove implementation quality.
  • Recovery preserves the work contract but cannot repair a host's conversation history or UI.
SOURCES

Evidence and sources

These links support the released behavior, public outcomes, or problem language described on this page.

Versioned workflow contractThe shipped one-item loop, decision boundary, gates, recovery, and clock-out behavior.Open evidence ↗How Nightshift worksHost differences, process leases, state files, workspace layouts, guarantees, and limits.Open evidence ↗Merged Codex hardening PRAn 11-item Nightshift run in Codex that shipped in v0.9.2.Open evidence ↗
RELATED QUESTIONS

Continue from the question you have

how coding-agent work survives context compactionRead the answer →how Nightshift recovers an interrupted sessionRead the answer →how Nightshift stops early completionRead the answer →
FAQ

Frequently asked questions

Is Nightshift just a long prompt?

No. The contract, decisions, progress, and recovery state live in project files, while hooks enforce the host boundaries the owner enabled.

Does the clock-out gate prove the work is correct?

No. It enforces completion of the declared list. Item definitions, project checks, and human review establish quality.