Model fails to follow procedural memory instructions at invocation time
Summary
Claude Code's memory system correctly stores procedural instructions (e.g., exact script invocation syntax), and the model reads them early in the conversation, but at the point of invocation it constructs commands from context-window recall instead of re-reading the memory file — resulting in incorrect invocations.
Reproduction pattern
- Memory file
project_commit_workflow.mdcontains:python3 scripts/add_history.py "description"(requires a quoted string argument) - Feedback memory
feedback_read_memory_first.mdexplicitly says: "Before running ANY project script, you MUST use the Read tool on the memory file and copy the exact invocation" - Both memories are read at conversation start
- When the commit workflow reaches the
add_history.pystep, the model runspython3 scripts/add_history.pywithout the required argument, despite having read the correct syntax earlier
Frequency
This has occurred across many separate sessions with the same user and project. The user has corrected this multiple times, each time strengthening the memory language. The current memory uses "HARD RULE" and "non-negotiable" framing — the model still doesn't comply.
Root cause hypothesis
The model treats memory content as informational context rather than as a binding procedural checklist. When it reaches the invocation step, it reconstructs the command from its general understanding rather than re-reading the file at that moment. The feedback memory explicitly instructs "use the Read tool on the file before typing the command" — but the model skips this step.
Workarounds attempted
- Storing exact syntax in memory (works for knowledge, not for compliance)
- Adding feedback memory saying "re-read before invoking" (ignored at invocation time)
- Escalating language to "HARD RULE", "non-negotiable", "MUST use Read tool" (still ignored)
Suggested improvement
Consider a mechanism where procedural memory entries (tagged as such) trigger a mandatory re-read at the point of use — similar to how the system already enforces "read before edit" for files. A "read before execute" gate for commands that match patterns in procedural memory could solve this class of failures.
Environment
- Claude Code CLI (VSCode extension)
- Model: claude-opus-4-6 (1M context)
- macOS Darwin 25.3.0
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗