Skip to content
Get AI Business OS

/night

AI Business OS

/night is the end-of-session routine. Claude works out what you did during the session, matches the work to your projects, shows you a summary to approve, records it in your project register and then commits and pushes everything to your remote repository.

Run /night when you finish working for the day, or when you finish a block of work you want recorded and synced. If you only want to commit and push without updating project records, use /sync. If you want to record progress and carry on working, use /save.

  1. Type /night in the Claude Code panel and press Enter, adding a short note after the command if you want one.
  2. Read the session summary that Claude shows you, checking each project it plans to update.
  3. Choose Approve, Revise or Skip state update in reply to the summary.
  4. Check the commit details that Claude reports at the end.

You can add a note after the command, such as /night worked on the workshop agenda. Claude includes it in the session summary.

  1. Gathers activity. Claude reads the time, the git status and the commits from the last six hours, and pulls the open, paused and overdue projects from .claude/state/state.json. The conversation itself and the git log are the main sources for what you did.
  2. Matches work to projects. Claude compares the commits, the topics you discussed and the files you changed with your projects, and matches each piece of work by name or topic.
  3. Asks you to review. Claude shows the projects it plans to update, with a traffic light and the lastAction and stoppedAt values it inferred. It also lists any new projects it proposes and anything left unfinished.
  4. Writes the records. After you approve, Claude backs up state.json, writes the changes and validates the file.
  5. Commits and pushes. Claude stages every change, commits with a message that summarises the session and pushes to origin main.
Option What happens
Approve Claude writes the project updates, then commits and pushes
Revise You give corrections and Claude shows the summary again
Skip state update Claude commits and pushes without changing state.json

If Claude cannot tell where you stopped on a project, it asks you.

Field Where What Claude writes
sessionHistory Top of state.json A new entry with the date, time, a summary of under 150 characters and the IDs of the projects you worked on. The newest entry goes first and the list holds the current calendar month. Earlier months move to the monthly archive in .claude/state/history/
lastWorked Each project you worked on Today’s date
stoppedAt Each project you worked on Where the work stopped
lastAction Each project you worked on The last thing completed, in the past tense
sessionHistory Each project you worked on A new entry with the date, time and a summary of the work on that project

If you approve a new project in the summary, Claude registers it with the next project ID, today’s date as the created date, the status in-progress and the priority medium.

File or source Read or write
The conversation and git history Read
.claude/state/state.json Read, then written after your approval
.claude/state/backups/ Written, one backup file per day
Your local repository Every change is staged and committed
Your remote repository Written, through git push origin main
/night finished the agenda for the spring workshop
**Review:** Session summary
**Projects updated:**
- P012 Spring Workshop — Active — lastAction: Finished the workshop agenda, stoppedAt: Speaker briefing not started
**New projects proposed:**
- No new projects
**Left unfinished:**
- None
**Options:** Approve / Revise / Skip state update

After you approve, Claude reports the commit hash, the number of files changed, the projects it updated and every warning the validation script printed, in full. A clean run shows Validator: no warnings.