🔧 AI Nachrichten ChatGPT showing blank screen [Fix](05.09.2026 um 19:55 Uhr)
⚠️ Malware / Trojaner / VirenSofort deinstallieren: Diese 19 Browser-Erweiterungen sind mit Malware verseucht(06.09.2026 um 08:00 Uhr)
🕵️ SicherheitslückenCVE-2026-85665 | usebruno Bruno up to 3.4.2 path traversal(06.09.2026 um 22:59 Uhr)
🕵️ SicherheitslückenCVE-2026-76925 | Flatpak Symlink toctou (Nessus ID 342817)(06.09.2026 um 22:59 Uhr)
🔧 AI Nachrichten ChatGPT showing blank screen [Fix](05.09.2026 um 19:55 Uhr)
⚠️ Malware / Trojaner / VirenSofort deinstallieren: Diese 19 Browser-Erweiterungen sind mit Malware verseucht(06.09.2026 um 08:00 Uhr)
🕵️ SicherheitslückenCVE-2026-85665 | usebruno Bruno up to 3.4.2 path traversal(06.09.2026 um 22:59 Uhr)
🕵️ SicherheitslückenCVE-2026-76925 | Flatpak Symlink toctou (Nessus ID 342817)(06.09.2026 um 22:59 Uhr)

🔧 Programmierung 🕛 kürzlich 4 Min Lesezeit
0

5 CLAUDE.md Patterns That Make AI Actually Follow Your Rules

↗ Quelle (dev.to)
🗣️ Stimme:
📑 Inhaltsübersicht

Have you ever set up a CLAUDE.md file, dropped in 200 lines of rules, and then watched the AI completely ignore half of them anyway?



You are not alone. The irony of writing instructions for AI coding assistants is that the same productivity trap applies to you: more rules ≠ better results.



Here are five patterns that actually work, learned from managing production CLAUDE.md setups across a dozen project starters.









1. The 800-token rule



The biggest CLAUDE.md mistake is treating it like documentation. It is not documentation. It is a system prompt prefix — and system prompts have a working memory budget.



A rough heuristic: keep your primary CLAUDE.md under 800 tokens (~600 words). Beyond that, context compression pushes older rules out when long files are open.



What to cut:




  • Rationale paragraphs ("we do this because...")

  • Historical context ("we used to use X but now...")

  • Anything that is obvious from the codebase itself



The rule goes in CLAUDE.md. The rationale goes in a comment in the relevant file, or nowhere.









2. Use glob-scoped rules, not one giant file



Claude Code supports scoped CLAUDE.md files — rules in src/api/CLAUDE.md apply only when files under src/api/ are open. Use this.



A frontend rule about "never use inline styles" has no business loading when the AI is working in your Express routes. A backend rule about "always use parameterized queries" does not need to be in context when fixing a CSS animation.



Practical layout:




CODE
CLAUDE.md              # project-wide: stack, deploy process, critical invariants
src/api/CLAUDE.md # API-specific: auth patterns, error formats, rate limiting
src/web/CLAUDE.md # Frontend-specific: component conventions, state patterns
scripts/CLAUDE.md # Automation: env var handling, idempotency requirements






Each file stays under 300 tokens. Total loaded at any time: ~600 tokens. Still under budget.









3. One concern per rule



Compound rules fail silently. When you write:




"Functions should be small, pure, and well-named, with explicit return types and no side effects unless they are in service files."




...the AI picks the parts it agrees with and ignores the rest. This is not a model quality problem — it is a parsing problem. Compound sentences create ambiguity about which clause is the constraint and which is the suggestion.



Split every compound rule into atomic statements:




CODE
## Functions
- Max 30 lines. Extract helpers if exceeded.
- Explicit return types on all exported functions.
- No side effects except in `*Service.ts` and `*Repository.ts` files.






Three lines, three enforceable constraints, zero ambiguity.









4. Negative rules outperform positive rules



"Use Zod for all schema validation" is a positive rule. It tells the AI what to do, but not how strongly you mean it.



"Never use any types. Never use untyped JSON.parse() without a Zod schema." — these are negative rules. They draw a hard line.



In practice, AI assistants weight prohibitions more heavily than recommendations. This is because prohibitions reduce the valid solution space (easier to enforce) while recommendations just add a preference (easier to deprioritize under other pressures).



Reframe your positive rules as negative rules where you can:
























Positive Negative
Use environment variables for all config Never hardcode URLs or credentials
Write tests for all public functions Never ship a new exported function without a test file
Use the existing logger Never call console.log directly in production code


The negative framing also makes violations easy to grep for.









5. Pair CLAUDE.md with a production-configured starter



The best CLAUDE.md is one that describes a codebase that already follows its own rules. When the starter project has ESLint configured, TypeScript strict mode on, and the folder structure already in place — the CLAUDE.md rules are reinforced by the code itself.



This is why project starters are worth spending time on. If your starter has any types everywhere and no linting, your CLAUDE.md rule against any is fighting the existing codebase instead of aligning with it.



We built the for more.

Vollständiger Original-Bericht
Ausführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
↗ Original-Artikel auf dev.to lesen
Wie bewertest du diesen Beitrag?
1 Klick Feedback
Teilen mit Netzwerk & Team:

Community-Analysen & Experten-Meinungen 0

Verfasse deine eigene Analyse, teile Workarounds oder diskutiere diesen Vorfall im Blog.
Noch keine Community-Analyse verfasst. Markiere einen Textabschnitt oder klicke oben auf Eigene Analyse verfassen“!
Community Pulse: Relevanz-Einschätzung
1 Klick Experten-Votum
🔴 Akute Relevanz 47%
🟡 In Evaluierung 25%
🟢 Keine Auswirkung 17%
Spannende Innovation 11%
Verwandte Story-Cluster & Quellen (Vektor-KI)
Port 8095 Engine
2 Quellen
Jetzt patchen! Angreifer attackieren JFrog Artifactory und machen sich zu Admins
1 Quelle
OpenAI’s new Astra model is finally here – why safety experts are worried
1 Quelle
WhatsApp-Schwachstelle: Zugriff auf Fotos bei gesperrtem Android-Handy
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten 5 CLAUDE.md Patterns That Make AI Actually Follow Your Rules

Thematisch verwandte Begriffe: CLAUDEmd, Patterns, That, Make · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...