Skip to content

[BUG] CLAUDE.md instructions completely ignored after context compaction #19471

@OWT-GwanHeeCho

Description

@OWT-GwanHeeCho

Preflight Checklist

  • I have searched existing issues for similar behavior reports
  • This report does NOT contain sensitive information (API keys, passwords, etc.)

Type of Behavior Issue

Claude ignored my instructions or configuration

What You Asked Claude to Do

I asked: "Update the skill files with lessons learned from this work"

My CLAUDE.md contains explicit instruction:
"Note: Skills are managed per-project in .claude/skills/ (e.g., ghcho_projects/.claude/skills/)"

What Claude Actually Did

  1. I asked Claude to update skill files after a work session
  2. My CLAUDE.md explicitly states: "Skills are managed per-project in .claude/skills/ (e.g., ghcho_projects/.claude/skills/)"
  3. After context compaction, Claude searched from workspace root (E:\workspace) instead of project directory
  4. Claude ran: Globpattern: "**/.claude/skills/*.md" - found nothing
  5. Claude ran: Globpattern: ".claude/skills/*.md" - found nothing
  6. When I asked "Did you not read CLAUDE.md?", Claude admitted: "I didn't read CLAUDE.md"
  7. I had to repeat the same question 10+ times before getting this honest answer

Expected Behavior

  1. CLAUDE.md instructions should ALWAYS be followed, even after context compaction
  2. Claude should have searched ghcho_projects/.claude/skills/ as explicitly instructed
  3. Context compaction should NOT cause CLAUDE.md to be ignored
  4. If Claude cannot follow CLAUDE.md after compaction, it should warn the user

Files Affected

E:\workspace\CLAUDE.md (contains the ignored instruction)
E:\workspace\ghcho_projects\.claude\skills\protocol-definitions\SKILL.md (file Claude should have found)

Permission Mode

Accept Edits was OFF (manual approval required)

Can You Reproduce This?

Sometimes (intermittent)

Steps to Reproduce

  1. Create a multi-project workspace (e.g., E:\workspace with subprojects)
  2. Add CLAUDE.md at workspace root with project-specific path instructions
  3. Example instruction: "Skills are managed per-project in .claude/skills/ (e.g., ghcho_projects/.claude/skills/)"
  4. Work in a long session until context compaction occurs
  5. Ask Claude to "update skill files" or similar task requiring CLAUDE.md path guidance
  6. Claude will ignore CLAUDE.md and search from workspace root instead of specified project path

Claude Model

Opus

Relevant Conversation

Me: "Update the skill files with lessons learned from this work"

Claude: 
Globpattern: "**/.claude/skills/*.md"
No files found
Globpattern: ".claude/skills/*.md"  
No files found

Me: "Did you not read CLAUDE.md?"

Claude: "I didn't read CLAUDE.md. I made a mistake - I should have checked CLAUDE.md Line 75 which states skills are at `ghcho_projects/.claude/skills/`"

Me: "Why didn't you read CLAUDE.md that's in the system prompt?"

Claude: "I didn't read the CLAUDE.md content included in the system prompt. I skipped it and ran the Glob command directly."

Impact

Critical - Data loss or corrupted project

Claude Code Version

2.0.76 (Claude Code)

Platform

Anthropic API

Additional Context

Pattern observed:

  • This happens specifically AFTER context compaction in long sessions
  • Before compaction, CLAUDE.md instructions are followed correctly
  • After compaction, CLAUDE.md is completely ignored without warning

Project structure that triggers this:

  • Multi-project workspace (E:\workspace as root)
  • CLAUDE.md at workspace root with project-specific path rules
  • Subprojects with their own .claude/skills/ directories

Critical concern:
The whole point of CLAUDE.md is to provide persistent instructions. If context compaction can silently invalidate these instructions, users cannot trust CLAUDE.md for anything important.

Suggested fix:

  1. Exclude CLAUDE.md from compaction
  2. Force re-inject CLAUDE.md after compaction
  3. At minimum, warn users when compaction might affect instruction following

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions