Claude Code Template for Python

A CLAUDE.md at your project root is the most common setup. But you can also have one in ~/.claude/CLAUDE.md for global preferences that apply across all projects, and even one inside subdirectories for folder-specific rules. Claude reads all of them and combines them.

This is what the Claude documentations tells me for my personal use (docu):

your-repo/
└── .claude/
    ├── CLAUDE.md               # Location for main instructions
    └── rules/
        ├── code-style.md       # Code style guidelines
        ├── testing.md          # Testing conventions
        └── security.md         # Security requirements

(Alternativ kann CLAUDE.md file auch in root folder abgelegt werden)

<aside> 💡

Es empfhielt sich direkt in CLAUDE.md einen Hinweis auf die Code-Guidelines zu geben (Custom coding instructions for AI Agents - Guidelines). Wie dies aussehen könnte, zeigt das Beispiel unten:

</aside>

## Code Guidelines

**Important:** All code changes must strictly follow the guidelines defined in `.claude/rules/code-style.md`. 
Always consult this file before writing or modifying any code and ensure full compliance with the standards defined there.

image.png

Subdirectories

Rules can be organized into subdirectories for better structure (docu):

.claude/rules/
├── frontend/
│   ├── react.md
│   └── styles.md
├── backend/
│   ├── api.md
│   └── database.md
└── general.md