Checkpoint
Save current work in progress to remote. This creates a commit and pushes but does NOT create a PR.
Workflow
- •Verify branch state - Must be on a feature branch, not main
- •Analyze changes - Review what will be committed
- •Stage all changes - Add all modified and untracked files
- •Generate commit message - Create informative message from changes
- •Commit and push - Save to remote
Step 1: Verify Branch State
bash
BASE_BRANCH=$(../../scripts/get-base-branch.sh) CURRENT_BRANCH=$(git branch --show-current) if [[ "$CURRENT_BRANCH" == "$BASE_BRANCH" ]]; then echo "ERROR: Cannot checkpoint on default branch ($BASE_BRANCH)" echo "Create a feature branch first with: git checkout -b <branch-name>" exit 1 fi
Step 2: Check for Changes
bash
if [ -z "$(git status --porcelain)" ]; then echo "No changes to checkpoint. Working directory is clean." exit 0 fi git status git diff --stat
Step 3: Stage All Changes
bash
git add -A
Step 4: Generate Commit Message
If the user provided a message via $ARGUMENTS, use it as the commit message prefix.
Otherwise, analyze the staged changes to generate an appropriate message:
- •Look at modified files to understand the scope
- •Create a concise summary of changes
- •Follow conventional commit format when appropriate
Step 5: Commit and Push
bash
git commit -m "$(cat <<'EOF' <commit message here> Co-Authored-By: Claude <noreply@anthropic.com> EOF )" git push -u origin HEAD
Output
Confirm the checkpoint was successful:
code
Checkpoint saved to <branch-name> Commit: <short-hash> <message>