Feature Request: Enforce .claude/rules/ as rules, not just guidance

Resolved 💬 3 comments Opened Feb 25, 2026 by htcxy009 Closed Mar 1, 2026

Summary

.claude/rules/ files are auto-discovered and loaded into Claude's context, but are treated as guidance rather than rules. This creates a semantic mismatch where the naming implies mandatory compliance, but the behavior allows silent violations.

What Happened

While creating a skill file, I (Claude) created .claude/skills/review-pr.md using kebab-case, despite .claude/rules/markdown.md specifying PascalCase for markdown files:

# .claude/rules/markdown.md
## Default
All custom markdown files use `PascalCase`.
Examples: `StyleGuide.md`, `CompilationFlow.md`

The rule was loaded into context but not followed. No warning, no enforcement, silent violation.

The Semantic Problem

| Term | Expected Behavior | Actual Behavior |
|------|-------------------|-----------------|
| Rule | Mandatory, enforced, violations blocked/flagged | ❌ Not enforced |
| Guidance | Recommended, best-effort, violations allowed | ✅ Current behavior |

The directory is named rules/ but behaves as guidance/. This sets incorrect expectations for teams relying on deterministic rule compliance.

Impact

  • Teams cannot trust that .claude/rules/ will be followed
  • No mechanism to catch violations before they happen
  • The naming creates a false promise of compliance

Suggested Improvements

Option A: Add Pre-Action Validation (Preferred)

Add a validation step before file operations that checks applicable rules:

[Write tool called for: review-pr.md]
→ Check .claude/rules/markdown.md (matches **/*.md)
→ Rule says: PascalCase required
→ "review-pr.md" violates rule
→ Block or warn before proceeding

Option B: Rename to Match Behavior

Rename .claude/rules/ to .claude/guidance/ or .claude/conventions/ to honestly reflect that these are suggestions, not enforced rules.

Option C: Add Optional Enforcement Flag

Allow rules to specify enforcement level:

---
paths: ["**/*.md"]
enforcement: strict  # or: warn, none
---

Questions for Discussion

  1. Should Claude (the model) proactively check rules before file operations?
  2. Should Claude Code (the infrastructure) validate against rules?
  3. Is the current "guidance-only" behavior intentional and should the naming change?

Environment

  • Claude Code version: Latest (Feb 2026)
  • Discovered during: Skill creation workflow
  • Rule file: .claude/rules/markdown.md
  • Violated by: .claude/skills/review-pr.md (kebab-case instead of PascalCase)

View original on GitHub ↗

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