Skip to content

Conversation

@mafredri
Copy link
Member

This PR enhances the CLAUDE.md document with comprehensive guidelines for writing better code comments, specifically targeted at AI agents and LLM-generated code.

Changes

  • Proper sentence structure: Comments should end with punctuation
  • Explain why, not what: Focus on rationale rather than describing code
  • Line length and wrapping: 80-character width with natural wrapping

Example

The guidelines include before/after examples showing the difference between well-formatted, meaningful comments and poorly written ones.

Impact

These standards will help ensure AI-generated code includes professional, maintainable comments that align with project conventions.


🤖 This change was written by Claude Sonnet 4.5 Thinking using mux and reviewed by a human 🏂

Add comprehensive commenting standards to CLAUDE.md focusing on:
- Proper sentence structure with punctuation
- Explaining rationale rather than describing code
- 80-character line width with natural wrapping

These guidelines help AI agents write more professional and maintainable
comments that align with project standards.

---

🤖 This change was written by Claude Sonnet 4.5 Thinking using [mux](https://github.com/coder/mux) and reviewed by a human 🏂
@mafredri mafredri requested review from ThomasK33 and deansheather and removed request for deansheather November 26, 2025 14:15
@mafredri mafredri marked this pull request as ready for review November 26, 2025 14:15
Replace OAuth2/AsSystemRestricted example with a clearer timeout example
that better demonstrates the difference between why-focused vs what-focused
comments and proper formatting vs awkward one-sentence-per-line style.
@mafredri mafredri merged commit bcc74b2 into main Nov 26, 2025
29 checks passed
@mafredri mafredri deleted the update-claude-comments-guide branch November 26, 2025 16:46
@github-actions github-actions bot locked and limited conversation to collaborators Nov 26, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants