Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
IT NachrichtenTelekom: Neuer Reise-eSIM-Dienst T-Travel startet weltweit(21.09.2026 um 11:45 Uhr)
IT NachrichtenSamsung Wallet: Neue Banken mit an Bord(21.09.2026 um 13:07 Uhr)
IT NachrichtenTelekom: Neuer Reise-eSIM-Dienst T-Travel startet weltweit(21.09.2026 um 11:45 Uhr)
IT NachrichtenSamsung Wallet: Neue Banken mit an Bord(21.09.2026 um 13:07 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

AI-Friendly README: Stop Claude & ChatGPT Hallucinations

You've spent hours crafting a beautiful README with badges, screenshots, and witty one-liners. It looks great on GitHub. But when you paste it into Claude or ChatGPT asking for help with your project, the AI still hallucinates imports and…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

You've spent hours crafting a beautiful README with badges, screenshots, and witty one-liners. It looks great on GitHub. But when you paste it into Claude or ChatGPT asking for help with your project, the AI still hallucinates imports and invents components that don't exist.



The problem isn't the AI. It's how you're structuring information for machines.



Here's how to write README files that both humans and AI assistants can actually use.






Why Your Current README Fails AI



Most READMEs are optimized for humans browsing GitHub. They include:




  • Marketing copy ("🚀 Blazingly fast!")

  • Visual elements (badges, screenshots, GIFs)

  • Narrative explanations

  • Installation for multiple platforms



AI assistants don't need any of this. They need structured, predictable data they can parse into working context.



When Claude sees "Blazingly fast React framework for building modern apps", it learns nothing about your actual architecture. When it sees a clear props interface or dependency list, it can generate accurate code.






The "Quick Context" Section: Your AI Cheat Sheet



The most important addition is a Quick Context block at the top of your README:




## Quick Context (for AI Assistants)

-
**Stack:** React 18, TypeScript 5.3, Tailwind CSS 3.4
- **Package Manager:** pnpm
- **Node Version:** 20+
- **Entry Point:** src/main.tsx
- **Component Pattern:** Functional components with hooks
- **State Management:** Zustand
- **Styling Approach:** Tailwind utility classes, no CSS modules






When you paste this into Claude and ask "add a dark mode toggle", it now knows:




  • Use React hooks (not class components)

  • Use Tailwind classes (not styled-components)

  • Use pnpm for any package suggestions

  • Target modern Node.js APIs



Without this section, AI will ask clarifying questions or guess wrong.






Architecture Diagram: ASCII Beats Images



AI can't see your fancy architecture diagram image. Use ASCII instead:




src/
├── components/ # Reusable UI components
│ ├── ui/ # Primitives (Button, Input, Card)
│ └── features/ # Feature-specific components
├── hooks/ # Custom React hooks
├── lib/ # Utility functions
├── stores/ # Zustand stores
└── types/ # TypeScript type definitions






This tells AI exactly where to put new files and where to look for existing ones.






Key Interfaces: The Contract AI Needs



Don't just describe your data models in prose. Show the TypeScript interfaces.



Bad approach (prose description):




Users have an id, email, and role which can be admin, user, or guest.




Good approach (actual interface):




interface User {
id: string;
email: string;
role: 'admin' | 'user' | 'guest';
createdAt: Date;
}

interface ApiResponse<T> {
data: T;
error: string | null;
status: number;
}






When AI sees the actual interface, it:




  • Uses correct property names (no user.username when it should be user.email)

  • Respects type constraints (won't suggest role: 'superadmin')

  • Handles optionals correctly






Component Patterns with Examples



Document your patterns with real code:




## Component Patterns

Components follow this structure:
- Props interface exported from same file
- Default exports for components
- Named exports for utilities
- Hooks co-located with components when single-use






Then show an example:




// src/components/ui/Button.tsx
export interface ButtonProps {
variant: 'primary' | 'secondary' | 'ghost';
size: 'sm' | 'md' | 'lg';
disabled?: boolean;
onClick?: () => void;
children: React.ReactNode;
}

export default function Button({ variant, size, ...props }: ButtonProps) {
// implementation
}









Import Aliases: Stop the Path Guessing Game



This small section prevents 50% of AI hallucinations:




## Import Aliases

| Alias | Path |
|-------|------|
| @/* | src/* |
| @/components/* | src/components/* |
| @/lib/* | src/lib/* |






Now when AI generates imports, it uses:




import { Button } from '@/components/ui/Button';






Instead of guessing:




import { Button } from '../../../components/ui/Button';
import { Button } from 'components/Button';
import { Button } from '@components/Button';









Dependencies Section



List critical dependencies AI should know about:




## Dependencies

| Package | Purpose |
|---------|---------|
| @tanstack/react-query | Data fetching (useQuery, useMutation) |
| zustand | State management (create, useStore) |
| zod | Schema validation |
| date-fns | Date manipulation (format, parseISO) |









Common Operations as Steps



Document workflows as numbered steps:




## Common Operations

### Adding a new component

1.
Create file in src/components/ui/ or src/components/features/
2. Export props interface
3. Use default export for component
4. Add to src/components/index.ts barrel file

### Adding a new API endpoint

1.
Define types in src/types/api.ts
2. Create hook in src/hooks/use[Resource].ts
3. Use react-query's useQuery or useMutation









Real-World Test: Before vs After



I tested both README styles with Claude on the same task: "Add a search filter to the user list component."






With Traditional README



Claude's response included:





  • useState for search state (correct, but lucky guess)

  • Import from './components/SearchInput' (wrong path)

  • CSS classes like search-input (I use Tailwind)


  • users.filter() on raw array (I use react-query)



Accuracy: 40% - needed significant corrections.






With AI-Optimized README



Claude's response included:





  • useState for local search state


  • import { Input } from '@/components/ui/Input' (correct alias)

  • Tailwind classes className="w-full px-4 py-2"

  • Integration with existing useUsers() hook using react-query



Accuracy: 90% - minor tweaks only.






The LLM_CONTEXT.md Alternative



For larger projects, create a dedicated LLM_CONTEXT.md file:




# LLM_CONTEXT.md

This file provides context for AI assistants.

## Project Metadata

-
Name: my-app
- Type: Next.js 14 App Router application
- Primary Language: TypeScript

## Anti-Patterns to Avoid

-
Don't use CSS modules (we use Tailwind)
- Don't use class components (functional only)
- Don't use default exports for utilities (named only)






The "Anti-Patterns" section is powerful. It tells AI what NOT to do, preventing common mistakes.






Checklist: Is Your README AI-Ready?












































Check Item
Quick Context block with stack, patterns, and tooling
TypeScript interfaces for core data models
Import aliases documented
ASCII folder structure instead of images
Dependency list with primary use cases
Component patterns with code examples
Common operations as numbered steps
Anti-patterns section (what NOT to do)





Tools That Help



If manual README updates feel tedious, consider:





  • LogicStamp Context - Auto-generates structured context from React/TypeScript projects


  • TypeDoc - Generates documentation from TypeScript comments


  • documentation.js - JSDoc to markdown






Conclusion



The best README serves two audiences:





  1. Humans who want to understand and use your project


  2. AI assistants who need structured context to help you code



By adding a Quick Context section, showing actual interfaces, and documenting your patterns explicitly, you transform your README from marketing material into a working AI prompt.



Your README is now your best AI prompt. Make it count.






What sections do you include in your READMEs for AI context? Share your templates in the comments!






About me: I'm a Technical Documentation Specialist helping developers and startups create README files, API docs, and technical guides that both humans and AI can understand. Check out my services or connect on LinkedIn.

Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten AI-Friendly README: Stop Claude & ChatGPT Hallucinations

Thematisch verwandte Begriffe: AIFriendly, README, Stop, Claude · 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 ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-94040 | A flaw has been found in vas3k TaxHacker up to 0.8.5. Affected by this v…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick