[BUG] Custom Commands Not Overriding System Defaults - Instructions Ignored
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
- Create a custom command file
.claude/commands/commit.mdwith explicit instruction:** IMPORTANT Never add Claude attributes to the commit messages - Include detailed rule in the command:
NEVER add attribution like "Generated with Claude" or similar - Execute the custom command
/committo create a git commit - Observe that Claude still adds attribution lines despite explicit prohibition in custom command
- 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)andCo-Authored-By: Claude <noreply@anthropic.com>
User Attempts to Resolve:
- Created custom
/commitcommand 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:
- Claude Code system instructions are treated as immutable
- Custom commands are treated as additive rather than overriding
- No clear precedence system exists for conflicting instructions
- Custom commands should have highest priority but currently don't
Expected Instruction Hierarchy:
- Custom slash commands (highest priority)
- Project CLAUDE.md
- Global CLAUDE.md
- 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.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗