CLAUDE is isgnoring directives in CLAUDE.local.md for saving work

Resolved 💬 5 comments Opened Aug 27, 2025 by CodeYozh Closed Jan 4, 2026

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

  1. First Occurrence: User noted "CRITICAL: you are still NOT prompting to export prior to compacting!"
  2. Second Warning: "What do I need to do get get you to follow the rules in CLAUDE*.md?"
  3. Current Failure: Despite acknowledging the issue multiple times, the system continued compacting without prompts
  4. 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

  1. Create CLAUDE.local.md with export prompt requirements
  2. Engage in extended conversation approaching context limits
  3. Observe that compaction occurs without export prompts
  4. 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

  1. Mandatory Safety Check: Before any compaction, system must check CLAUDE.local.md
  2. User Protocol Enforcement: Treat user-defined safety rules as system requirements
  3. Failsafe Mechanism: Never compact without user consent when safety protocols exist
  4. 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:

  1. It causes data loss without user consent
  2. It violates explicit user-defined safety protocols
  3. It undermines trust in the system's reliability
  4. 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

View original on GitHub ↗

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