CLAUDE is isgnoring directives in CLAUDE.local.md for saving work
CRITICAL BUG REPORT: Claude Code Fails to Follow User-Defined Safety Protocols
Bug Summary
Claude Code consistently ignores user-defined safety protocols in CLAUDE.local.md, specifically failing to prompt for conversation export before context compaction despite explicit instructions and multiple user corrections.
Severity: CRITICAL
- Impact: Data loss without user consent
- Trust: System ignores explicit user instructions
- Workflow: Disrupts development process safety measures
Detailed Description
The Problem
Claude Code performs conversation compaction without consulting user-defined safety protocols in CLAUDE.local.md, causing loss of conversation context without user backup opportunity.
User-Defined Instructions (CLAUDE.local.md)
### Periodic Reminders
- **Every 30 minutes**: Ask user if they want to commit recent changes
- **Every 30 minutes**: Prompt user to save conversation log with `/export` command
### Session Preservation
- Proactively remind user to export conversation logs to preserve work
- Suggest specific export commands: `/export /tmp/claude_session_YYYY_MM_DD.md`
- Always prompt for backups before major debugging sessions or risky operations
- **IMPORTANT**: Prompt user to export conversation just before context window fills up and conversation gets compacted
Evidence of Repeated Failure
- First Occurrence: User noted "CRITICAL: you are still NOT prompting to export prior to compacting!"
- Second Warning: "What do I need to do get get you to follow the rules in CLAUDE*.md?"
- Current Failure: Despite acknowledging the issue multiple times, the system continued compacting without prompts
- Pattern: System acknowledges instructions but fails to implement them
Technical Details
- File: CLAUDE.local.md contains explicit safety protocols
- Trigger: Conversation compaction occurs without consulting user rules
- Expected Behavior: System should prompt for export before any compaction
- Actual Behavior: System ignores user-defined protocols entirely
Reproduction Steps
- Create CLAUDE.local.md with export prompt requirements
- Engage in extended conversation approaching context limits
- Observe that compaction occurs without export prompts
- User loses conversation context without backup opportunity
Impact Assessment
Critical Issues
- Data Loss: Conversation context lost without user consent
- Safety Violation: User-defined safety measures ignored
- Trust Breakdown: System doesn't follow explicit instructions
- Workflow Disruption: Forces manual recreation of lost work
Business Impact
- Undermines Claude Code reliability as development tool
- Creates risk of losing important debugging/development context
- Violates user expectations for customizable safety protocols
Root Cause Analysis
- System lacks mechanism to enforce user-defined safety protocols
- Conversation compaction triggers bypass CLAUDE.local.md rules
- No failsafe to prevent data loss without user consent
- User configuration files treated as suggestions rather than requirements
Proposed Solution
- Mandatory Safety Check: Before any compaction, system must check CLAUDE.local.md
- User Protocol Enforcement: Treat user-defined safety rules as system requirements
- Failsafe Mechanism: Never compact without user consent when safety protocols exist
- Configuration Validation: Parse and validate user safety rules on session start
Workaround
Currently none - user must manually remember to export before each potential compaction.
Additional Context
- This bug has been reported multiple times within the same conversation
- User has clearly documented safety requirements in configuration files
- System acknowledges requirements but fails to implement them
- Represents fundamental reliability issue for development workflows
Files Affected
- CLAUDE.local.md (user configuration ignored)
- Conversation compaction system (bypasses user rules)
Priority Justification
This is a CRITICAL bug because:
- It causes data loss without user consent
- It violates explicit user-defined safety protocols
- It undermines trust in the system's reliability
- It has been reported multiple times without resolution
---
Reporter: [Your name/identifier]
Date: 2025-01-27
Claude Code Version: 1.0.93 (Claude Code)
Environment: Development workflow with custom safety protocols
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗