Skip to main content

Git workflow: safe setup

Use Claude within the existing engineering process, not as a replacement for Git controls, code review, testing, or human approval.

Start from a safe repository state​

Before starting Claude Code:

git status
git branch --show-current
git pull

Confirm that:

  • The correct repository is open
  • The current branch is known
  • Existing uncommitted changes are understood
  • Project-specific instructions are available
  • Required build and test commands are known
Protect existing work

Do not ask Claude to discard, overwrite, reset, or clean repository changes unless the affected files and consequences have been reviewed.

Create a focused feature branch​

git switch -c feature/short-description

Use a branch name that communicates the intended change.

Examples:

feature/add-token-estimator
fix/underwriting-validation
refactor/marketplace-card-data
docs/claude-learning-guide

Initialise project guidance​

Inside a Claude Code session, run:

/init

This creates a starter CLAUDE.md file for project-level guidance.

Review the generated file before keeping it. Include only stable information such as:

  • Project architecture
  • Important directories
  • Coding conventions
  • Testing commands
  • Build commands
  • Security requirements
  • Files that must not be modified
  • Definition of done
Keep CLAUDE.md concise

Store durable project instructions in CLAUDE.md. Avoid adding temporary task details, large documentation blocks, or information that quickly becomes outdated.

Use plan mode before large changes​

Inside Claude Code:

/plan

Then provide the requested outcome:

Analyse the requested change and prepare a scoped implementation plan.

Include:
1. Existing behavior
2. Proposed behavior
3. Files likely to change
4. Validation and error handling
5. Security considerations
6. Tests to add or update
7. Commands required for verification

Do not modify files yet.

Review and correct the plan before implementation.

Continue with Git workflow: delivery.