QuestionQ80

Claude Code Configuration & Workflows

The infrastructure-as-code repository contains Terraform modules (/terraform/), Kubernetes manifests (/kubernetes/), and CI/CD pipeline scripts (/pipelines/). Each needs distinct conventions, yet the single root CLAUDE.md has grown beyond 500 lines. When developers work on Kubernetes files, Terraform-specific rules are unnecessarily loaded into context and consume tokens.

What is the best way to reorganize this so that only relevant guidance loads when editing particular file types?

Explanation

Claude Code supports Markdown rules in .claude/rules/ with paths YAML frontmatter, which scopes each rule to matching files. This keeps Terraform-, Kubernetes-, and pipeline-specific instructions out of context unless Claude is working with the applicable paths. @ imports improve organization but are expanded and loaded at startup, so they do not reduce unrelated context.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!