Read before writing:
package.json/pyproject.toml/Cargo.toml→ stack, framework, key deps- Sample 3–5 test files → testing patterns, assertion style
git log --oneline -20→ commit conventions.optimusprime/decisions.md→ allDECIDED:lines- Top-level directory scan → project shape
Write CLAUDE.md with:
- What this project is (1 sentence)
- Tech stack: language, framework, key dependencies
- Conventions: naming patterns, file structure, import style
- Architectural decisions from
decisions.md(up to 5, ≤1 line each) - Testing approach: framework, what gets tested, where tests live
- Things Claude must never do in this repo
Staleness check: if existing CLAUDE.md predates the newest entry in decisions.md by >30 days, note: Note: existing CLAUDE.md was stale — regenerated.
Output: CLAUDE.md generated — X decisions incorporated