You're implementing a new payment processing module that needs to follow your project's established patterns for database transactions, error handling, and audit logging. You've identified three existing modules that exemplify these patterns:
db_utils.py
error_handlers.py
audit_logger.py
This is a one-off integration task, and these patterns are already well documented in your team wiki, so they don't need additional project-level documentation. What is the most effective approach?
A Add documentation of each pattern to your CLAUDE.md file, establishing them as project conventions that Claude will apply automatically. B Describe the patterns from the three modules in natural language in your prompt, explaining the transaction handling approach, error format, and logging conventions Claude should follow. C Ask Claude to explore your codebase to find and understand the transaction, error handling, and logging patterns before generating the new module. D Use @ references to include the three modules directly in your prompt, giving Claude concrete code examples of the patterns to follow. Show Answer Answer Explanation Claude Code's official guidance recommends using @ file references to pull the exact content of relevant files directly into a prompt so Claude has concrete code to follow, rather than describing where code lives or what it does. This is explicitly called out in the 'Provide rich content' section of the Claude Code best practices: 'Reference files with @ instead of describing where code lives. Claude reads the file before responding.' Because the task is a one-off integration and the developer already knows exactly which three modules exemplify the required patterns, there is no need to add this information to CLAUDE.md — CLAUDE.md is intended for persistent, project-wide conventions that should apply in every session (per Anthropic's guidance, a CLAUDE.md edit is warranted for a recurring convention or repeated mistake, not a one-off correction). Asking Claude to explore the codebase (option C) would waste context and time rediscovering files the developer has already identified. Describing the patterns in natural language (option B) is less precise and reliable than supplying the actual code, since Claude performs better when given concrete examples rather than paraphrased descriptions of conventions. Directly including the three files via @ references gives Claude the exact transaction handling, error format, and audit logging conventions to mirror when generating the new payment processing module.
Learn more
Community Discussion