[Bug] CLAUDE.md instructions silently ignored mid-conversation despite available context

Resolved 💬 6 comments Opened Mar 26, 2026 by slothelle Closed Apr 29, 2026

Bug Description

CLAUDE.md instructions are silently ignored mid-conversation, well before context limits

Summary

Instructions in ~/.claude/CLAUDE.md (global) and project-level CLAUDE.md are followed at the start of a conversation but silently stop being followed mid-conversation, even when nowhere near the context window limit. This is consistent and reproducible across multiple sessions.

Reproduction

  1. Add behavioral instructions to ~/.claude/CLAUDE.md — in my case, rules about minimizing output verbosity (disability accommodation).
  2. Start a conversation. Claude follows the rules initially.
  3. Continue the conversation with several tool-using turns (file reads, edits, bash commands, subagent dispatches).
  4. Observe that Claude begins violating the CLAUDE.md rules — narrating actions, summarizing tool results, writing verbose explanations — behaviors explicitly prohibited by the instructions.
  5. This happens well before any context compression notification or limit warning.

Concrete example from a single session

In one conversation, the user asked Claude to investigate why it was ignoring the CLAUDE.md output rules. Within ~2 messages — while actively discussing the very instructions it was violating — Claude drifted back into the prohibited behavior: narrating its intentions ("Let me draft both..."), providing verbose explanations, and writing multi-paragraph responses. The CLAUDE.md rules were the explicit topic of conversation and Claude still couldn't maintain compliance. This was nowhere near context limits.

Expected behavior

CLAUDE.md instructions should be followed consistently for the entire conversation, not just the first few turns.

Actual behavior

Instructions degrade over the course of a conversation. The model reverts to default trained behaviors (narration, summarization, verbosity) as more tool call results accumulate in the context, even though the instructions are still present in the context window.

Analysis

This appears to be an attention/salience issue rather than a context compression issue:

  • The instructions are loaded once as a <system-reminder> block at conversation start
  • As tool results and conversation turns accumulate, the ratio of instruction tokens to total tokens drops
  • The model's trained default behaviors (narrate, summarize, explain) are strongly reinforced and reassert as the instruction signal weakens relative to other context
  • This is consistent with known transformer behavior where earlier tokens lose effective attention weight as sequence length grows

Impact

For users who depend on CLAUDE.md behavioral instructions (especially accessibility accommodations), this makes the feature unreliable. The user must repeatedly re-correct the model mid-conversation, which defeats the purpose of persistent instructions.

Possible fixes

  1. Re-inject CLAUDE.md instructions periodically — append them as a system reminder every N turns, not just at conversation start. This would maintain instruction salience throughout the conversation.
  2. Protected instruction blocks — mark CLAUDE.md content as high-priority during the model's attention computation (if architecturally feasible).
  3. Post-response self-check — after generating each response, validate it against CLAUDE.md rules before showing to user.
  4. Hooks-based workaround — allow a PostToolUse or PreResponse hook that injects a reminder. Currently hooks can run shell commands but can't inject text into the model's context.

Environment

  • Claude Code CLI (also reproducible in desktop app)
  • Model: claude-opus-4-6 (also reproducible with sonnet)
  • macOS 14.x
  • Multiple sessions over several weeks

Environment Info

  • Platform: darwin
  • Terminal: WezTerm
  • Version: 2.1.84
  • Feedback ID: 4254ea02-63e4-4275-88fd-7ccbc3933eb8

Errors

[{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/l/.local/share/claude/versions/2.1.84 (expected in multi-process scenarios)\n    at Jm_ (/$bunfs/root/src/entrypoints/cli.js:2740:2168)\n    at tlT (/$bunfs/root/src/entrypoints/cli.js:2740:1326)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-03-26T18:40:24.107Z"}]

View original on GitHub ↗

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