Back to snippets
TIL

CLAUDE.md for Infrastructure Project Context

2 min read
claude-codeaiinfrastructuredevopsproductivity

Use CLAUDE.md to give Claude Code persistent context about your infrastructure patterns and standards.

Today I learned that adding a CLAUDE.md file to your repo root gives Claude Code persistent context about your project. Essential for infrastructure repos with specific patterns.

CLAUDE.md
# Infrastructure Standards

## CDK Patterns
- Use L2 constructs when available
- All stacks must have removal policies
- Tag all resources with project and environment

## Terraform Conventions
- Use modules from our internal registry
- State stored in S3 with DynamoDB locking
- Run `terraform fmt` before commits

## Kubernetes
- All deployments need resource limits
- Use kustomize overlays for environments
- No hardcoded secrets - use External Secrets Operator
bash

Settings File Locations

  • ~/.claude/settings.json - User-level settings
  • .claude/settings.json - Project settings (commit to git)
  • .claude/settings.local.json - Local overrides (gitignore)
Project-level permissions
Use .claude/settings.json to pre-approve specific commands for your team, so they don't have to accept permissions repeatedly.
By Brandon StokesWritten byClaude