Problem
Currently, rules/common/ and language-specific directories (e.g., rules/golang/, rules/python/) are both loaded into ~/.claude/rules/. Language-specific files state they "extend" common rules, but there is no defined behavior when they conflict.
Example
common/coding-style.md marks immutability as CRITICAL — "ALWAYS create new objects, NEVER mutate existing ones." However, this directly conflicts with idiomatic patterns in several languages:
- Go: Idiomatic Go mutates struct pointers (
func (s *Server) SetName(...))
- C/C++: Performance-sensitive code requires in-place mutation
- Python: Standard library APIs use in-place mutation (
list.sort(), dict.update())
- Rust: Ownership system already guarantees safety; enforcing immutability is redundant
When Claude loads both rule files, it receives contradictory instructions with no defined priority, leading to unpredictable behavior.
Suggestion
A few possible approaches (not mutually exclusive):
- Explicit priority rule: State in
rules/README.md that language-specific rules take precedence over common rules when they conflict (specific > general)
- Override markers in common: Tag rules in common that may be overridden by language-specific files (e.g., "This rule can be overridden by language-specific rules")
- Scope common rules more carefully: Ensure common rules only contain truly universal principles, and move language-sensitive guidance (like immutability) into language-specific files where the nuance can be expressed properly
References
rules/common/coding-style.md — Immutability section
rules/README.md — "Language directories extend the common rules"
Problem
Currently,
rules/common/and language-specific directories (e.g.,rules/golang/,rules/python/) are both loaded into~/.claude/rules/. Language-specific files state they "extend" common rules, but there is no defined behavior when they conflict.Example
common/coding-style.mdmarks immutability as CRITICAL — "ALWAYS create new objects, NEVER mutate existing ones." However, this directly conflicts with idiomatic patterns in several languages:func (s *Server) SetName(...))list.sort(),dict.update())When Claude loads both rule files, it receives contradictory instructions with no defined priority, leading to unpredictable behavior.
Suggestion
A few possible approaches (not mutually exclusive):
rules/README.mdthat language-specific rules take precedence over common rules when they conflict (specific > general)References
rules/common/coding-style.md— Immutability sectionrules/README.md— "Language directories extend the common rules"