Closing the Day
/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.
Run the Session Close
Section titled “Run the Session Close”- Type
/nightat the end of your session, once the work you want recorded is finished. - Read the review Claude presents, which lists every project update and any new project it proposes.
- Answer Approve, Revise or Skip, as described in the next section of this page.
- 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.
The Review
Section titled “The Review”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 |
What Gets Written
Section titled “What Gets Written”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.shmoves every entry from an earlier month into the archive file for that month in.claude/state/history/. - For each project touched:
lastWorkedbecomes today,stoppedAtsays where work stopped and what comes next,lastActionrecords 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-progressand prioritymedium.
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.
Learnings
Section titled “Learnings”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.
Commit and Push
Section titled “Commit and Push”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.
Checkpoints Before the Close
Section titled “Checkpoints Before the Close”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.
Related Pages
Section titled “Related Pages”- The Daily Briefing reads the session history and
stoppedAtnotes that/nightwrites. - /save in AI Business OS records a mid-session save without closing the day.
- /night in AI Business OS describes the base version this command replaces.

