Skip to content
Get AI Business OS

Closing the Day

PRIMA Project ManagementCommand: /night

/night closes a working session. It works out which projects you touched, shows you the changes it proposes to your register and waits for your approval. It then records what you did and where you stopped, and commits and pushes the workspace. Tomorrow’s /day briefing reads what /night writes.

  1. Type /night at the end of your session, once the work you want recorded is finished.
  2. Read the review Claude presents, which lists every project update and any new project it proposes.
  3. Answer Approve, Revise or Skip, as described in the next section of this page.
  4. Read the final report, which gives the commit, the files changed, the projects updated and any validation warnings.

To tell Claude what you worked on, add it after the command, for example /night worked on P012 and P014. Claude uses your words directly.

Claude matches each piece of work from the session to a project by name or topic. It matches only against projects that are in progress, paused or overdue, so archived projects are not considered. It uses the conversation and the last six hours of git history as its sources, and it ignores trivial edits such as typo fixes. Work that fits no existing project becomes a proposal for a new one.

**Review:** Session state updates
**Projects updated:**
- 🟢 P012 Spring Workshop — Active — lastAction: drafted session plan, stoppedAt: next, write handouts
**New projects proposed:**
- Client Onboarding Pack — welcome documents for new clients. Suggested path: [path]
**Status changes:**
- No status changes
**Options:** Approve / Revise / Skip state update
Your answer What happens
Approve Claude writes every update and creates any new project with the next number
Revise You give corrections, and Claude presents the review again
Skip Claude makes no change to your register and goes on to the commit

Before it writes anything, Claude runs Scripts/backup-state.sh to back up your register, and then it makes these changes to .claude/state/state.json.

  • Session history: a new entry at the top with the date, time, a summary under 150 characters and the IDs of the projects worked. The history holds the current calendar month, and Scripts/archive-history.sh moves every entry from an earlier month into the archive file for that month in .claude/state/history/.
  • For each project touched: lastWorked becomes today, stoppedAt says where work stopped and what comes next, lastAction records the last thing finished, and a session entry goes at the top of the project’s own history.
  • Recent work, pending items and priorities: Claude updates these lists where the session changed them.
  • New projects you approved: each gets the next ID, today’s date as its created and last worked date, status in-progress and priority medium.

Claude then runs Scripts/validate-state.sh. If validation fails, Claude restores the backup and reports the error. If it passes with warnings, the final report lists every warning in full, and a clean run shows Validator: no warnings.

Claude checks the session for anything to keep for future sessions, such as a fix for an error likely to recur or a change in how you prefer to work. Most sessions have nothing, and Claude moves on without a word. When it finds something, it proposes one line and asks whether to add it to the main CLAUDE.md or the project’s CLAUDE.md.

Before any push, Claude compares workspace.githubRepo in your register with the remote named origin. If they differ, Claude stops the push and shows the mismatch. See Syncing Across Machines for this check.

The context checkpoint rule writes one more checkpoint just before /night runs. If the session ends before /night finishes, /resume can still recover the work. See Resuming a Session.