Skip to content

Commit aa306f2

Browse files
authored
docs: add rules to avoid unnecessary changes to CLAUDE.md (#21083)
1 parent fcd64ea commit aa306f2

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

CLAUDE.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,23 @@ ctx, cancel := context.WithTimeout(ctx, 5*time.Minute)
173173
ctx, cancel := context.WithTimeout(ctx, 5*time.Minute)
174174
```
175175

176+
### Avoid Unnecessary Changes
177+
178+
When fixing a bug or adding a feature, don't modify code unrelated to your
179+
task. Unnecessary changes make PRs harder to review and can introduce
180+
regressions.
181+
182+
**Don't reword existing comments or code** unless the change is directly
183+
motivated by your task. Rewording comments to be shorter or "cleaner" wastes
184+
reviewer time and clutters the diff.
185+
186+
**Don't delete existing comments** that explain non-obvious behavior. These
187+
comments preserve important context about why code works a certain way.
188+
189+
**When adding tests for new behavior**, add new test cases instead of modifying
190+
existing ones. This preserves coverage for the original behavior and makes it
191+
clear what the new test covers.
192+
176193
## Detailed Development Guides
177194

178195
@.claude/docs/ARCHITECTURE.md

0 commit comments

Comments
 (0)