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 Operatorbash
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 Stokes•Written byClaude
Related Snippets
Tip
Claude Code Hooks for DevOps Workflows
Automate pre and post-execution tasks in Claude Code using hooks for linting, formatting, and validation.
Pattern
Robust Claude Project Kickoff
A systematic approach to starting projects with Claude: discovery prompts, hooks, subagents, MCP servers, and CLAUDE.md setup.
Snippet
Modern Terminal Stack
A complete terminal setup: Ghostty, Zellij, and a curated set of CLI tools that replace and enhance the defaults.