Skip to content

docs: rewrite the CLAUDE.md comment rule with explicit exceptions - #36301

Merged
mateo-berri merged 5 commits into
litellm_internal_stagingfrom
litellm_claude_md_comment_exceptions
Aug 8, 2026
Merged

docs: rewrite the CLAUDE.md comment rule with explicit exceptions#36301
mateo-berri merged 5 commits into
litellm_internal_stagingfrom
litellm_claude_md_comment_exceptions

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

TLDR

Problem this solves:

  • Blanket no-comments rule read as banning needed ones
  • Agents skipped blame entries, suppressions, and TODOs
  • Rule never said why comments are discouraged

How it solves it:

  • Lists the three cases where comments are allowed
  • Names AI slop as the thing being kept out
  • Explains the rule as a DRY and tech debt concern

User Flow

Docs-only change to the agent guidelines, so there's no end user flow

Relevant issues

Linear ticket

Pre-Submission checklist

  • I have added meaningful tests
  • My PR passes all CI/CD checks (e.g., lint, format, unit tests)
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • I have received a Greptile Confidence Score of at least 4/5 before requesting a maintainer review (Greptile reviews automatically once the PR is opened; only comment @greptileai to re-request a review after pushing changes)

Tests aren't applicable here: the only change is prose in CLAUDE.md

Delays in PR merge?

If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).

Screenshots / Proof of Fix

Prose-only edit to CLAUDE.md, nothing to run or capture

Type

📖 Documentation

Changes

CLAUDE.md now opens with the comment rule spelled out as a short list of allowed cases: concise explanations of genuinely complex business logic, comments tools read and act on (.git-blame-ignore-revs entries, lint or type checker suppressions like # mutable-ok for truly unavoidable violations), and TODO or FIXME markers that carry a strong, concise reason or link a follow-up issue. It closes with the reasoning, that the rule exists to keep out the excessive and verbose comments AI writes, and that comments duplicate logic in a second place and make code harder to change, so clear code beats explaining unclear code

Final Attestation

  • The tests check the right things, including the edge cases, and regressions in the respective real-world customer use-cases are not possible after this PR

Link to Devin session: https://app.devin.ai/sessions/9e264d2b82534afcb7be4d562cfca696
Requested by: @mateo-berri

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@mateo-berri mateo-berri self-assigned this Aug 8, 2026
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@greptile-apps

greptile-apps Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR rewrites the repository’s agent guidance on code comments, replacing the blanket prohibition with explicit exceptions and rationale

  • Permits concise comments for genuinely complex business logic
  • Permits machine-significant comments used by tooling
  • Permits TODO and FIXME markers when backed by a strong reason or follow-up issue

Confidence Score: 5/5

The PR appears safe to merge

No blocking failure remains

Important Files Changed

Filename Overview
CLAUDE.md Clarifies the comment policy and documents narrowly described exceptions without introducing an eligible follow-up defect

Reviews (5): Last reviewed commit: "chore: mention AI slop reason" | Re-trigger Greptile

Comment thread CLAUDE.md Outdated
Comment thread CLAUDE.md Outdated
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

@greptileai

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

@greptileai

@devin-ai-integration devin-ai-integration Bot changed the title docs: allow functional comments as an exception in CLAUDE.md docs: scope the CLAUDE.md comment rule to AI slop comments Aug 8, 2026
@devin-ai-integration devin-ai-integration Bot changed the title docs: scope the CLAUDE.md comment rule to AI slop comments docs: rewrite the CLAUDE.md comment rule with explicit exceptions Aug 8, 2026
@mateo-berri

Copy link
Copy Markdown
Contributor

@greptileai

@BerriAI BerriAI deleted a comment from devin-ai-integration Bot Aug 8, 2026

@mateo-berri mateo-berri left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

@greptileai

@mateo-berri
mateo-berri enabled auto-merge August 8, 2026 21:32
@codecov

codecov Bot commented Aug 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@mateo-berri
mateo-berri disabled auto-merge August 8, 2026 23:54
@mateo-berri
mateo-berri merged commit b205bf9 into litellm_internal_staging Aug 8, 2026
77 checks passed
@mateo-berri
mateo-berri deleted the litellm_claude_md_comment_exceptions branch August 8, 2026 23:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant