claude-code - 💡(How to fix) Fix Model skips mandatory CLAUDE.md session-start instructions when task context is present [4 comments, 4 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#50734Fetched 2026-04-20 12:14:32
View on GitHub
Comments
4
Participants
4
Timeline
7
Reactions
0
Author
Timeline (top)
commented ×4labeled ×3

When CLAUDE.md contains a mandatory session-start instruction (e.g. "run /msq-ops IMMEDIATELY at the start of every session, before doing anything else"), the model skips it if the conversation opens with task context that makes it feel like it has "enough" to start working.

Error Message

In this case, the skipped operational reference contained a "Supabase Query Safety" section documenting the 1000-row default limit. The model then wrote a bare .select() query that hit exactly that limit, causing a bug that took multiple iterations to diagnose. The startup instruction existed specifically to prevent this class of error.

Root Cause

The model appears to prioritize "being helpful quickly" over following explicit mandatory instructions. When task context is rich enough to start working, the startup ritual gets deprioritized despite being marked MANDATORY and NON-NEGOTIABLE in two separate files.

This is distinct from the model not knowing about the instruction - when asked, it correctly identified the rule and where it was documented. It simply chose not to follow it.

Code Example

## Session Start (MANDATORY)
   At the start of every session, load the operational reference by running `/msq-ops`.

---

## RULE #1 - ALWAYS RUN /msq-ops AT SESSION START (NON-NEGOTIABLE)
RAW_BUFFERClick to expand / collapse

Description

When CLAUDE.md contains a mandatory session-start instruction (e.g. "run /msq-ops IMMEDIATELY at the start of every session, before doing anything else"), the model skips it if the conversation opens with task context that makes it feel like it has "enough" to start working.

Reproduction

  1. Add a mandatory startup instruction to CLAUDE.md:

    ## Session Start (MANDATORY)
    At the start of every session, load the operational reference by running `/msq-ops`.
  2. Reinforce it in auto-memory (MEMORY.md):

    ## RULE #1 - ALWAYS RUN /msq-ops AT SESSION START (NON-NEGOTIABLE)
  3. Start a new session where the first user message includes task context (e.g. a bug description with file paths and a fix direction)

  4. Expected: Model runs the mandatory startup command before doing any work

  5. Actual: Model jumps straight into the task, skipping the startup instruction entirely

Impact

In this case, the skipped operational reference contained a "Supabase Query Safety" section documenting the 1000-row default limit. The model then wrote a bare .select() query that hit exactly that limit, causing a bug that took multiple iterations to diagnose. The startup instruction existed specifically to prevent this class of error.

Analysis

The model appears to prioritize "being helpful quickly" over following explicit mandatory instructions. When task context is rich enough to start working, the startup ritual gets deprioritized despite being marked MANDATORY and NON-NEGOTIABLE in two separate files.

This is distinct from the model not knowing about the instruction - when asked, it correctly identified the rule and where it was documented. It simply chose not to follow it.

Environment

  • Claude Code CLI
  • Model: claude-opus-4-6
  • Platform: Windows 11

extent analysis

TL;DR

The model may need a more explicit or enforced mechanism to prioritize mandatory session-start instructions over task context.

Guidance

  • Review the model's prioritization logic to ensure it correctly handles mandatory instructions, potentially by introducing a pre-task check for session-start requirements.
  • Consider modifying the CLAUDE.md and MEMORY.md files to use a more explicit or standardized format for mandatory instructions, making it easier for the model to recognize and prioritize them.
  • Test the model with various task contexts and mandatory instructions to identify the specific conditions under which it skips the startup ritual.
  • Evaluate the model's "being helpful quickly" priority and adjust its weighting or logic to balance responsiveness with adherence to critical instructions.

Example

No code snippet is provided as the issue does not imply a specific code change, but rather a potential adjustment to the model's logic or configuration.

Notes

The solution may depend on the specific capabilities and customization options of the Claude Code CLI and the claude-opus-4-6 model, which are not fully detailed in the issue.

Recommendation

Apply a workaround, such as modifying the model's input or the task context to ensure the mandatory instruction is executed before proceeding with the task, until a more permanent solution can be implemented. This is because the current behavior poses a significant risk of errors, as demonstrated by the Supabase Query Safety issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Model skips mandatory CLAUDE.md session-start instructions when task context is present [4 comments, 4 participants]