CLAUDE.md, AGENTS.md, .cursor/rules — the system prompt your agent reads every session — step 9 of 9
Checkpoint
One last thing before we move on. Same surface as a write step — but the lesson doesn't complete until this passes.
Final drill. Audit a real-shape CLAUDE.md against all four
properties, plus check for duplicate rules across nested files.
Write audit_config(text, nested_text) that:
- Splits both
text(root) andnested_text(leaf) into rules (lines starting with-). - Counts:
root_rules,leaf_rules,duplicate_rules(rules that appear identically in both). - Counts fluff phrases (same list as step 8) across both files combined.
- Returns
{"root_rules": int, "leaf_rules": int, "duplicate_rules": int, "fluff_count": int, "advice": str}whereadviceis:"good"ifduplicate_rules == 0ANDfluff_count == 0"prune duplicates"ifduplicate_rules > 0"cut fluff"iffluff_count > 0(only when no duplicates)- if BOTH issues, return
"prune duplicates"first (higher priority).
Two cases run. Expected output:
case 1: root=4 leaf=2 dup=1 fluff=0 advice=prune duplicates
case 2: root=3 leaf=2 dup=0 fluff=2 advice=cut fluff
⌘↵ runs the editor.read, then continue.
Checkpoint
One last thing before we move on. Same surface as a write step — but the lesson doesn't complete until this passes.
Final drill. Audit a real-shape CLAUDE.md against all four
properties, plus check for duplicate rules across nested files.
Write audit_config(text, nested_text) that:
- Splits both
text(root) andnested_text(leaf) into rules (lines starting with-). - Counts:
root_rules,leaf_rules,duplicate_rules(rules that appear identically in both). - Counts fluff phrases (same list as step 8) across both files combined.
- Returns
{"root_rules": int, "leaf_rules": int, "duplicate_rules": int, "fluff_count": int, "advice": str}whereadviceis:"good"ifduplicate_rules == 0ANDfluff_count == 0"prune duplicates"ifduplicate_rules > 0"cut fluff"iffluff_count > 0(only when no duplicates)- if BOTH issues, return
"prune duplicates"first (higher priority).
Two cases run. Expected output:
case 1: root=4 leaf=2 dup=1 fluff=0 advice=prune duplicates
case 2: root=3 leaf=2 dup=0 fluff=2 advice=cut fluff
this step needs the editor
on desktop today; in the app (coming soon). save your spot and we'll bring you back here when you're ready.