Skip to content
Get AI Business OS

/sync

AI Business OS

/sync commits all the changes in your workspace and pushes them to your remote repository. Claude writes the commit message for you and does not ask you to approve it. Before it pushes, it checks that the remote is the repository recorded for this workspace.

Use /sync when you want your work saved to the remote repository without updating project records. Three common moments are listed below.

  • After /setup, to commit your personalised configuration.
  • Before you move to another computer, so the other machine can pull your latest work.
  • At any point during the day when you want a safe copy off your machine.

To record what you did against your projects as well, use /night, which updates your project records and then commits and pushes.

  1. Type /sync in the message box at the bottom of the Claude Code panel and press Enter.
  2. Check the confirmation that Claude shows when the push is complete.

/sync takes no arguments.

  1. Checks the workspace identity. Claude reads workspace.githubRepo from .claude/state/state.json and, if it holds a value, compares it with the address of your origin remote. If the two do not match, Claude stops and shows an error without committing or pushing anything.
  2. Stages the changes. Claude runs git status to see what has changed and then git add . to stage every change in the workspace.
  3. Commits. Claude reads the staged changes, writes a short message that describes them and commits with a Co-Authored-By: Claude line at the end of the message.
  4. Pushes and confirms. Claude runs git push and then reports the number of files changed, the commit hash and the remote branch it updated.

If you work with more than one workspace, for example your own and one you manage for a colleague, a push from the wrong folder could send one workspace’s files to the other’s repository. The identity check stops that. It uses the repository address you gave during /setup. If you answered none, the field is empty and the check is skipped.

File or source Read or write
.claude/state/state.json Read for workspace.githubRepo
Your local repository Every change is staged and committed
Your remote repository Written, through git push
/sync

Claude words the confirmation in its own way, but it always gives the number of files, the commit hash and the branch pushed.

Committed 4 files (a1b2c3d): Add speaker list and agenda for the spring workshop
Pushed to origin/main