Make Claude Code Match Team Conventions (2026)

A new pull request from Claude Code uses camelCase for file names when your team uses kebab-case. The functions use handle prefixes when your convention is on prefixes. Every Claude Code contribution needs manual style fixes before it can merge.

The Problem

Claude Code does not automatically detect or follow:

  • File naming conventions (kebab-case, camelCase, PascalCase)
  • Function naming patterns (handleClick vs onClick)
  • Directory organization rules
  • Git commit message formats
  • Comment styles (JSDoc vs inline)
  • Error handling patterns (throw vs return Result)

Root Cause

Teams develop conventions over months or years. These conventions live in tribal knowledge, PR review comments, and linter configs — not in a format Claude Code can read at session start. The model defaults to generic best practices that may conflict with your specific choices.

The Fix

The claude-code-my-workflow repo (963 stars) demonstrates how to encode team-specific workflows into Claude Code skills. It includes 28 skills and 14 agents built for an academic LaTeX/R workflow, showing how any team can codify their conventions.

Step 1: Document Naming Conventions

## Naming Conventions — MANDATORY
### Files
- Components: PascalCase.tsx (UserProfile.tsx)
- Hooks: camelCase starting with "use" (useAuth.ts)
- Utils: kebab-case.ts (date-helpers.ts)
- Tests: [filename].test.ts (co-located with source)
- Types: kebab-case.types.ts (user.types.ts)
### Code
- Variables: camelCase (userName, isActive)
- Constants: UPPER_SNAKE (MAX_RETRIES, API_BASE_URL)
- Types/Interfaces: PascalCase (UserProfile, ApiResponse)
- Enum values: PascalCase (Status.Active, Role.Admin)
- Private class members: prefix with underscore (_cache)
### Functions
- Event handlers: on + Event (onSubmit, onChange)
- Boolean returns: is/has/can prefix (isValid, hasPermission)
- Async functions: verb + Noun (fetchUser, createOrder)
- Factory functions: create + Noun (createLogger, createClient)

Step 2: Document Structural Patterns

## Code Structure Patterns
### React Components
1. Types/interfaces at top
2. Component function
3. Hooks first, then derived state, then handlers, then render
### API Routes
1. Input validation (Zod)
2. Authentication check
3. Authorization check
4. Business logic (via service layer)
5. Response formatting
### Error Handling
- Use Result<T, E> pattern (neverthrow library)
- NEVER use try/catch for control flow
- Log errors at the boundary, not at every level

CLAUDE.md Code to Add

## Convention Check
Before writing code, scan 2-3 existing files in the same directory to match:
- Import ordering (external → internal → relative)
- Spacing and formatting patterns
- Comment style and density
- Export patterns (named vs default)
If your output would look different from neighboring files, adjust to match.

Verification

  1. Ask Claude Code to create a new component
  2. Check: File name matches your convention?
  3. Check: Internal structure matches your pattern?
  4. Check: Would this pass your PR review without style comments?

Prevention

Combine CLAUDE.md with enforced linting. Add to your configuration:

{
  "hooks": {
    "post-tool-use": [{
      "tool": "write_file",
      "command": "npx eslint --fix $FILE && npx prettier --write $FILE"
    }]
  }
}

The claude-code-templates library includes convention templates for popular team setups that you can customize.

For more on team setup, see the team onboarding playbook. Review CLAUDE.md patterns in our CLAUDE.md best practices guide. Learn about hooks-based enforcement in the hooks guide.

See Also

Frequently Asked Questions

Does this error affect all operating systems?

This error can occur on macOS, Linux, and Windows (WSL). The exact error message may differ slightly between platforms, but the root cause and fix are the same. macOS users may see additional Gatekeeper or notarization prompts. Linux users should check that the relevant system packages are installed. Windows users should ensure they are running inside WSL2, not native Windows.

Will this error come back after updating Claude Code?

Updates can occasionally reintroduce this error if the update changes default configurations or dependency requirements. After updating Claude Code, verify your project still builds and runs correctly. If the error returns, reapply the fix and check the changelog for breaking changes.

Can this error cause data loss?

No, this error occurs before or during an operation and does not corrupt existing files. Claude Code’s edit operations are atomic — they either complete fully or not at all. However, if the error occurs during a multi-step operation, you may have partial changes that need to be reviewed with git diff before continuing.

How do I report this error to Anthropic if the fix does not work?

Open an issue at github.com/anthropics/claude-code with: (1) the full error message including stack trace, (2) your Node.js version (node --version), (3) your Claude Code version (claude --version), (4) your operating system and version, and (5) the command or operation that triggered the error.

This fix also applies if you see variations of this error:

  • Connection or process errors with similar root causes in the same subsystem
  • Timeout variants where the operation starts but does not complete
  • Permission variants where access is denied to the same resource
  • Configuration variants where the same setting is missing or malformed

If your specific error message differs slightly from the one shown above, the fix is likely the same. The key indicator is the operation that failed (shown in the stack trace) rather than the exact wording of the message.

Find the right skill → Browse 155+ skills in our Skill Finder.

Try it: Paste your error into our Error Diagnostic for an instant fix.