[BUG] Claude Code does not consistently follow CLAUDE.md formatting instructions when creating new files

Resolved 💬 2 comments Opened Jul 8, 2025 by blalor Closed Jul 9, 2025

Environment

  • Platform (select one):
  • [X] Anthropic API
  • [ ] AWS Bedrock
  • [ ] Google Vertex AI
  • [ ] Other: <!-- specify -->
  • Claude CLI version: 1.0.40 (Claude Code)
  • Operating System: macOS 15.5
  • Terminal: Wezterm

Bug Description

Claude Code has access to user's CLAUDE.md file with specific formatting rules (like YAML 4-space indentation) but doesn't consistently apply them when creating new files.

Steps to Reproduce

  1. Add specific formatting rules to CLAUDE.md
  2. Request creation of new file matching those rules
  3. Observe that default formatting is used instead of CLAUDE.md rules

Expected BehaviorBefore creating any new file, Claude Code should:

  1. Check if CLAUDE.md contains relevant formatting rules
  2. Apply those rules to the new file
  3. Explicitly confirm rule application in output

Actual Behavior

New file was created using 2 spaces for indentation, not 4.

Additional Context

claude-code-diagnostic.log

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗