/night
/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.
When to Use It
Section titled “When to Use It”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.
How to Run It
Section titled “How to Run It”- Type
/nightin the Claude Code panel and press Enter, adding a short note after the command if you want one. - Read the session summary that Claude shows you, checking each project it plans to update.
- Choose Approve, Revise or Skip state update in reply to the summary.
- 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.
What It Does
Section titled “What It Does”- 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. - 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.
- Asks you to review. Claude shows the projects it plans to update, with a traffic light and the
lastActionandstoppedAtvalues it inferred. It also lists any new projects it proposes and anything left unfinished. - Writes the records. After you approve, Claude backs up
state.json, writes the changes and validates the file. - Commits and pushes. Claude stages every change, commits with a message that summarises the session and pushes to
origin main.
Your Review Options
Section titled “Your Review Options”| 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.
What It Records
Section titled “What It Records”| 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.
What It Reads and Writes
Section titled “What It Reads and Writes”| 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 |
Example
Section titled “Example”/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 updateAfter 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.

