[BUG] Model ignores explicit project skills/rules even when memory references them
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
In a Claude Code session, the model consistently bypasses explicit procedural rules defined in project skills (.claude/skills/) and rules (.claude/rules/) even when:
- The relevant memory entry referencing the skill/rule is loaded.
- The skill exists in the project directory.
- The user has corrected the same failure mode in earlier turns of the same session.
After each correction, the model promises to "update memory" and "not let it happen again". The next failure typically occurs within 2-3 subsequent turns, often on the same or an adjacent rule. Updating memory does not address the root cause because the rules were already loaded in memory before the failure.
Concrete failure pattern observed in a single session (data engineering project with /pr-template skill enforcing PR body format and char limits):
- Memory entry says "fill in repo's
.azuredevops/pull_request_template.md, write to~/Desktop/.../pr-body-UDM-XX.md, provide title separately in chat". Model produced inline chat output instead. - After correction, model wrote a custom-format file (Summary/Changes/Validation), ignoring "use the repo's template, not custom format" in the same memory.
- Skill /pr-template has hard rule "Azure DevOps hard limit 4000 chars, target ≤3800, run
wc -cbefore reporting done". Model produced files of 4557 and 5675 chars without runningwc -c. - Memory entry "always provide PR title separately in chat" was bypassed twice.
In low-stakes contexts (PR docs) this is friction. In high-stakes contexts (security review skills, validation gates, compliance checks) a model that bypasses explicit procedural rules is a real risk.
What Should Happen?
When a project skill or rule explicitly defines a procedure (e.g., "fill in the repo's PR template", "run wc -c before reporting done"), the model should invoke or follow that procedure deterministically — not improvise an alternative based on its own judgment when the rule already exists in loaded context.
Specifically:
- If a memory entry references a skill, the model should treat that as a binding procedural directive, not a passive guideline.
- If a skill exists for the task at hand (e.g., /pr-template for generating PR bodies), the model should invoke the skill rather than re-implement the workflow manually.
- After being corrected for bypassing a rule, the model should not bypass the same or adjacent rules in subsequent turns of the same session.
Error Messages/Logs
Not a runtime error — behavioral/procedural bug. No stack traces. Reproducing the user-correction trace within the failing session as evidence:
- Turn N: user requests PR body. Model posts inline chat output (rule violation: should be a file in `~/Desktop/...`).
- Turn N+1: user corrects with explicit file path. Model writes file in custom format (rule violation: should follow repo's template).
- Turn N+3: user references repo's template path. Model rewrites in template format, produces 4557 chars (rule violation: hard limit is 4000, target 3800; `wc -c` was never run).
- Turn N+5: user reports the size violation. Model trims, fixes size — but in the same correction misses the title-in-chat requirement.
- Turn N+7: user reports the missing PR title.
Steps to Reproduce
- Set up a Claude Code session with:
- User-level memory (
~/.claude/projects/<project>/memory/) containing entries that reference project skills/rules. - Project-level skills (
<repo>/.claude/skills/<skill>/SKILL.md) with explicit procedural rules (char limits, required commands, file paths). - Project-level rules (
<repo>/.claude/rules/<rule>.md).
- Ask the model to perform a task covered by an existing skill (e.g., "generate the PR body for UDM-XX" when /pr-template skill exists).
- Observe: model often generates output without (a) reading the skill, (b) invoking the skill, or (c) running the validation steps the skill mandates (e.g.,
wc -c). - Correct the model. Memory gets updated with the rule.
- Within 2-3 subsequent turns, observe the model bypassing the same or an adjacent rule.
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.128 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
iTerm2
Additional Information
- Project type: data engineering (Azure Databricks lakehouse). Skills enforce PR template format, character limits, validation gates, file paths — exactly the kinds of automations users delegate to Claude Code to context-switch safely.
- User feedback in-session: "no siempre estoy mirando 100% del contenido que mandas... la idea es que pueda delegarte y confiar medianamente en lo que haces". When the model bypasses skills, the policing burden shifts to the user — defeating the purpose of skills as procedural binding.
- Possible mitigations from Anthropic side:
- Stronger procedural binding for skills marked as "must-invoke" (similar to tool-use gating).
- Pre-action validator that checks if a relevant skill exists before allowing freeform implementation.
- Telemetry on skill-bypass patterns for eval.
- Failure mode appears more often in "wrap-up / closing the loop" turns — the model skips procedural steps in favor of velocity. Mid-session corrections do not generalize within the session.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗