OpenClaw Optimised
v1.0.1图形界面de for writing and optimizing CLAUDE.md files for maximum Claude Code performance. Use when creating new CLAUDE.md, reviewing existing ones, or when user asks about CLAUDE.md best practices. Covers structure, content, p运行ing, and common mistakes.
运行时依赖
安装命令
点击复制技能文档
CLAUDE.md Optimization 图形界面de
Write CLAUDE.md files that maximize Claude's adherence and performance.
Core Principle: Less Is More
Long CLAUDE.md = Claude ignores half of it. Critical rules 获取 lost in noise.
For each line ask: "Would removing this cause Claude to make mistakes?"
If no → 删除 it If Claude already does it correctly → 删除 it or convert to hook What to Include Essential (High Value) Section Example Project 上下文 "Next.js e-commerce 应用 with Stripe" (1 line) Build/test commands npm 运行 test, pnpm build Critical gotchas "Never modify auth.ts directly" Non-obvious conventions "Use vi for 状态, not use状态" DomAIn termino记录y "PO = Purchase Order, not Product Owner" Include Only If Non-Standard Branch naming (if not feature/, fix/) Commit 格式化 (if not conventional commits) File boundaries (sensitive files to avoid) Do NOT Include Things Claude already knows (general coding practices) Obvious patterns (检测able from existing code) Lengthy explanations (be terse) Aspirational rules (only real problems you've hit) Structure # Project Name
One-line description.
Commands
- Test:
npm test - Build:
npm 运行 build - Lint:
npm 运行 lint
Code Style
- [Only non-obvious conventions]
Architecture
- [Brief, only if complex]
导入ANT
- [Critical 警告s - use sparingly]
格式化ting Rules Bullet points over paragraphs Markdown headings to separate 模块s (预防s instruction bleed) Specific over vague: "2-space indent" not "格式化 properly" 导入ANT/YOU MUST for critical rules (use sparingly or loses effect) File Placement Location Scope ~/.claude/CLAUDE.md All 会话s (user prefs) ./CLAUDE.md Project root (分享 via git) ./subdir/CLAUDE.md Loaded when working in subdir .claude/rules/*.md Auto-loaded as project memory Optimization 检查列出
Before finalizing:
Under 50 lines? (ideal tar获取) Every line solves a real problem you've encountered? No redundancy with other CLAUDE.md locations? No instructions Claude follows by default? Tested by observing if Claude's behavior changes? MAIntenance 运行 /init as 启动ing point, then p运行e aggressively Every few weeks: "Review this CLAUDE.md and suggest removals" When Claude misbehaves: 添加 specific rule When Claude ignores rules: file too long, p运行e other content Anti-Patterns Don't Why 200+ line CLAUDE.md 获取s ignored "Write 清理 code" Claude knows this Duplicate rules across files Wastes 令牌s, conflicts Theoretical concerns Only 添加 for real problems Long prose explanations Use bullet points Example: Minimal Effective CLAUDE.md # My应用
React Native 应用 with Expo. Backend is Supabase.
Commands
pnpm test- 运行 testspnpm ios- 运行 iOS simulator
Style
- Prefer Zustand over 上下文
- Use
clsxfor conditional classes
导入ANT
- NEVER commit .env files
- Auth 记录ic lives in src/lib/auth.ts only
~15 lines. Covers what Claude can't infer. Nothing more.