home/productivity/how-to-make-claude-code-follow-my-naming-conventions

How to Make Claude Code Follow my Naming Conventions

GPTClaudeDeepSeek··681 copies·updated 2026-07-14
how-to-make-claude-code-follow-my-naming-conventions.prompt
# From The Claude Code Playbook — claudecodeguides.com/playbook/

Getting Claude Code to consistently respect your naming conventions is essential for maintaining code quality across your projects. Whether you prefer camelCase, PascalCase, snake_case, or any other naming style, you can configure Claude Code to understand and apply your conventions automatically. This guide explores practical methods to ensure AI-generated code matches your project's naming standards from the first line written.

## Why Naming Conventions Matter

Naming conventions are the backbone of readable and maintainable code. When Claude Code generates code that doesn't match your project's established patterns, you spend valuable time refactoring and correcting inconsistencies. This becomes especially painful in larger teams where multiple developers interact with the same codebase.

The good news is that Claude Code is highly configurable. By providing clear, persistent instructions about your naming preferences, you can reduce manual corrections and maintain consistency throughout your project lifecycle.

## Using .claude.json for Global Naming Preferences

The most straightforward approach to enforce naming conventions is through the `.claude.json` configuration file. This file lives in your project root and provides Claude Code with persistent context about your preferences.

Create or update your `.claude.json` with specific naming instructions:

when to use it

Community prompt sourced from the open-source GitHub repo theluckystrike/claude-code-playbook (MIT). A "How to Make Claude Code Follow my Naming Conventions" style prompt — adapt the placeholders and specifics to your task. Imported as-is and not independently retested here, so check the output before relying on it.

tags

productivitycommunitydeveloper

source

theluckystrike/claude-code-playbook · MIT