Analyzes and optimizes CLAUDE.md files following Anthropic's official best practices...
Analyze, audit, and optimize CLAUDE.md files based on Anthropic's official best practices for effective Claude Code configuration.
This is a medium-freedom task. Follow the structured workflow but adapt recommendations based on the specific project's needs, tech stack, and team conventions.
Copy this checklist and track your progress:
Optimization Progress:
- [ ] Step 1: Analyze current CLAUDE.md state
- [ ] Step 2: Audit against best practices checklist
- [ ] Step 3: Identify and prioritize issues
- [ ] Step 4: Generate recommendations
- [ ] Step 5: Apply or present changes
Read the existing CLAUDE.md (if present) and assess:
Compare against the checklist in references/best-practices.md.
Score each category:
Prioritize changes by impact:
High Priority:
Medium Priority:
Low Priority:
Either:
CLAUDE.md is loaded into context every time. Total limit: 40k tokens (CLAUDE.md + all @referenced files combined).
# BAD: Verbose explanation
## Testing Guidelines
When running tests in this project, you should use the npm test command.
This will execute all test files and provide output. Make sure tests pass.
# GOOD: Concise and actionable
## Testing
npm test # Run all tests
npm run test:coverage # With coverage report
Include YOUR project's actual patterns, not theoretical best practices.
# BAD: Generic advice
Follow clean code principles and write maintainable code.
# GOOD: Project-specific guidance
Use `logger` from @/utils, never console.log (tree-shaken in production).
Query keys must use queryKeys factory from @/lib/queryKeys.
For large documentation, split into separate files and reference them:
# In CLAUDE.md
See @.claude/rules/testing.md for testing standards.
See @docs/ARCHITECTURE.md for system design.
# NOT: 500 lines of testing docs inline
Show the commands your team uses:
## Development
npm run dev # Start dev server (localhost:3000)
npm test # Run tests in watch mode
npm run build # Production build
For must-follow instructions, use emphasis markers:
IMPORTANT: Never commit directly to main.
YOU MUST run tests before pushing.
ALWAYS use logger utility, never console.log.
When optimizing, provide:
## CLAUDE.md Optimization Report
**Summary:** Good foundation but overly verbose. Contains generic advice that adds token cost without value.
**Score:** 6/10
- Structure: 8/10 (well-organized sections)
- Conciseness: 4/10 (too verbose, 2000+ lines)
- Specificity: 5/10 (mix of specific and generic)
- Security: 9/10 (no sensitive data found)
**Critical Issues:**
1. File exceeds 500 lines - should use modular rules files
2. Contains generic "best practices" not specific to project
**Recommendations:**
1. [HIGH] Move detailed rules to .claude/rules/*.md files
2. [HIGH] Remove generic coding advice Claude already knows
3. [MED] Add missing quick-start commands section
4. [LOW] Consolidate duplicate information in docs/