AGENTS.md Pattern for React Native: Claude Code Generates Better Project-Aware Code

A Reddit user, julia_ships, has been experimenting with an AGENTS.md file for React Native/Expo projects. The file acts as a structured document that tells AI coding agents like Claude Code and Cursor about project-specific conventions. The difference is significant — before using the file, Claude generated generic React Native code; after, it generates components using the project's exact theme tokens, hooks, and patterns.
What Goes Into the AGENTS.md File
The user includes the following sections in their AGENTS.md:
- Folder structure and file naming conventions — e.g., where components live, how files are named (PascalCase, kebab-case, etc.)
- Theme system and color tokens — exact token names and how to apply them
- Custom hooks and their usage patterns — how to import and use project-specific hooks
- Component patterns — functional components with typed props (TypeScript), structure, and export style
Results
With the AGENTS.md in place, Claude Code produces code that matches the project's conventions on the first try. For example, it uses the correct theme colors.primary instead of hardcoded '#6200ee', imports custom hooks like useAuth() instead of writing inline logic, and follows the established component pattern (functional, typed props, proper export).
Who It's For
React Native / Expo developers using Claude Code, Cursor, or similar AI coding agents who want to reduce manual code review and force the AI to respect project conventions.
📖 Read the full source: r/ClaudeAI
👀 See Also

Short system prompts improve Claude's adherence and reduce token waste
A developer discovered that replacing a 3,847-word system prompt with several tiny focused prompts (total ~200 words) eliminated Claude's drift and forgotten instructions.

Treating Agent Runs as Review Packets: A Practical Pattern for Claude Code & Codex
A developer shares how producing a structured folder per agent run (research, drafts, evals, approval packet, metrics, memory) makes failures visible and iterations faster.

OpenClaw Cost Optimization: From $200 to $1/Month

Routing Agent Subtasks to Cheaper Models Dropped Cost from $18 to $4 on Same Refactor
A developer cut agent run costs from $18 to $4 by routing routine subtasks (lint, rename, config edits) to cheap models like DeepSeek V4 Pro and Tencent Hunyuan Hy3, reserving Opus 4.7 for complex reasoning.