[BUG] Custom Commands Not Overriding System Defaults - Instructions Ignored

Resolved 💬 2 comments Opened Jul 25, 2025 by OmniZenRaj Closed Jul 25, 2025

Environment

  • Platform (select one):
  • [ ] Anthropic API
  • [ ] AWS Bedrock
  • [ ] Google Vertex AI
  • [x] Other: Claude Code CLI
  • Claude CLI version: 1.0.60 (Claude Code)
  • Operating System: macOS (Darwin 24.5.0)
  • Terminal: iTerm2

Bug Description

Claude Code fails to properly prioritize user-defined custom commands over built-in system defaults. When custom slash commands contain instructions that explicitly contradict Claude Code's default behavior, Claude continues to follow the system defaults instead of respecting the custom command instructions.

Steps to Reproduce

  1. Create a custom command file .claude/commands/commit.md with explicit instruction: ** IMPORTANT Never add Claude attributes to the commit messages
  2. Include detailed rule in the command: NEVER add attribution like "Generated with Claude" or similar
  3. Execute the custom command /commit to create a git commit
  4. Observe that Claude still adds attribution lines despite explicit prohibition in custom command
  5. Note that the same issue persists even when adding similar instructions to global CLAUDE.md and project CLAUDE.md

Expected Behavior

Custom slash commands should have the highest priority in Claude's instruction hierarchy. When a custom command explicitly contradicts a system default behavior, the custom command instructions should completely override the system defaults.

Actual Behavior

Claude ignores the custom command instructions and follows the built-in system default behavior. Attribution lines like "🤖 Generated with [Claude Code]" and "Co-Authored-By: Claude" are added to commit messages despite explicit instructions not to do so in the custom command.

Additional Context

Impact on Functionality:

  • Breaks user workflows and preferences
  • Undermines the entire custom command system
  • Creates frustration when explicit instructions are ignored
  • Suggests fundamental flaw in instruction processing hierarchy

Technical Evidence:

  • Custom command file: .claude/commands/commit.md
  • Contains line 6: ** IMPORTANT Never add Claude attributes to the commit messages
  • Contains explicit rule: NEVER add attribution like "Generated with Claude" or similar
  • System still adds: 🤖 Generated with [Claude Code](https://claude.ai/code) and Co-Authored-By: Claude <noreply@anthropic.com>

User Attempts to Resolve:

  • Created custom /commit command with explicit instructions
  • Added similar instructions to global CLAUDE.md
  • Added similar instructions to project CLAUDE.md
  • All approaches failed - system defaults still take precedence

Root Cause Analysis:
The issue appears to be in Claude's instruction processing hierarchy where:

  1. Claude Code system instructions are treated as immutable
  2. Custom commands are treated as additive rather than overriding
  3. No clear precedence system exists for conflicting instructions
  4. Custom commands should have highest priority but currently don't

Expected Instruction Hierarchy:

  1. Custom slash commands (highest priority)
  2. Project CLAUDE.md
  3. Global CLAUDE.md
  4. System defaults (lowest priority)

This represents a fundamental design flaw where the custom command system cannot override built-in behaviors, making it significantly less useful than intended.

View original on GitHub ↗

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