Skip to content

Add "Reuse existing mechanisms" design principle to CLAUDE.md#530

Merged
jlamypoirier merged 4 commits into
mainfrom
jlp_reuse-existing-mechanisms
Jun 1, 2026
Merged

Add "Reuse existing mechanisms" design principle to CLAUDE.md#530
jlamypoirier merged 4 commits into
mainfrom
jlp_reuse-existing-mechanisms

Conversation

@jlamypoirier
Copy link
Copy Markdown
Collaborator

Claude Opus 4.8 note: authored on Joel's behalf.

Adds one Design principle to CLAUDE.md:

Reuse existing mechanisms before writing new ones. Before adding a helper, config shape, or one-off code path, check whether the framework already provides it — e.g. Config's update mechanism for nested edits, PretrainedFastLLMModelConfig for pretrained-model config, a config flag for opt-in logging. Compose or extend the canonical object rather than reimplementing it ad hoc.

Motivation: recurring friction where ad-hoc helpers/config shapes were written when a first-class framework mechanism already existed.

🤖 Generated with Claude Code

jlamypoirier and others added 4 commits May 19, 2026 14:52
Adds a Code Style rule: comments, docstrings, `desc=` strings, and error messages should describe what the thing does, not which model/algorithm/caller/feature uses it. References like "applied to GRPO/GSPO" rot when consumers change.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Both commands now begin their output with `## /review-<kind> @ <short-sha>`, which makes the output recognizable when pasted into another session for review triage.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Recurring friction across sessions: reaching for an ad-hoc helper or
config shape when the framework already provides a canonical mechanism
(Config update mechanism, PretrainedFastLLMModelConfig, config-flag
logging). Codify the reuse-first expectation alongside the existing
design principles.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jlamypoirier jlamypoirier merged commit b6eb470 into main Jun 1, 2026
1 of 2 checks passed
@jlamypoirier jlamypoirier deleted the jlp_reuse-existing-mechanisms branch June 1, 2026 22:16
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