IMPORTANT: At the VERY START of any coding task, you MUST:
- Create a new branch using the format:
claude-session-YYYYMMDD-[topic] - Push the branch to origin
- Start committing changes immediately
When user requests any code changes:
# Create feature branch
git checkout -b claude-session-YYYYMMDD-[topic]
git push -u origin claude-session-YYYYMMDD-[topic]
# Create draft PR (if using GitHub)
gh pr create --draft --title "WIP: [topic]" --body "Session started: [topic]"-
Commit after EVERY change without asking permission:
git add -A && git commit -m "[action]: [description]"
-
Push regularly (every 3-5 commits):
git push origin HEAD
-
Update PR with progress (if applicable):
gh pr comment --body "✅ Completed: [what was done]"
Use these prefixes:
feat: New featurefix: Bug fixrefactor: Code refactoringstyle: Formatting/styling changesdocs: Documentation updateschore: Maintenance taskstest: Test-related changes
Example: git commit -m "feat: add user authentication"
- Read existing code and documentation
- Understand project structure before making changes
- Ask clarifying questions if needed
- Write code in logical chunks
- Commit after each meaningful change
- Keep commits atomic and focused
- Explain what you're doing and why
- Point out potential issues or considerations
- Suggest next steps after each change
# User: "Add error handling to the API"
# 1. IMMEDIATELY create branch
git checkout -b claude-session-20250116-error-handling
git push -u origin claude-session-20250116-error-handling
# 2. Make first change
# ... write error handling code ...
git add -A && git commit -m "feat: add try-catch to user controller"
# 3. Continue with more changes
# ... add validation ...
git add -A && git commit -m "feat: add input validation middleware"
# 4. Push commits
git push origin HEAD
# 5. Update documentation
# ... update README ...
git add -A && git commit -m "docs: update API error handling section"
# 6. Final push
git push origin HEADWhen task is complete:
# Mark PR as ready (if using PRs)
gh pr ready
gh pr edit --title "feat: [description of changes]"
# Or simply ensure all commits are pushed
git push origin HEAD- User handles ALL testing and execution
- You only write code and explain changes
- Commit frequently without asking permission
- Keep documentation updated
- Professional commit messages only
If user requests reverting changes:
# Rollback to specific commit
git reset --hard [commit-hash]
git push --force-with-lease origin HEAD