Claude Code ignores its own memory files when executing commands

Resolved 💬 4 comments Opened Apr 2, 2026 by ravn Closed Apr 2, 2026

Problem

Claude Code has a persistent memory system where it stores reference information (e.g., build commands, flags, tool configuration). However, it repeatedly fails to consult these memories when executing the relevant commands, even when the memory was written by itself in a prior session.

Specific example

A memory file (reference_mame_build.md) explicitly states:

NEVER run make SUBTARGET=regnecentralen without OSD=sdl USE_SDL=1

Despite this, Claude Code ran make SUBTARGET=regnecentralen -j$(sysctl -n hw.ncpu) without the SDL2 flags, causing a build failure. This happened multiple times in the same session — the memory was loaded into context but not applied when generating the build command.

Expected behavior

When generating a command that matches a stored reference memory, Claude Code should check and apply the stored information before executing.

Impact

Build failures waste minutes of wall-clock time (MAME builds take several minutes). The user had to correct the same mistake repeatedly despite having explicitly asked Claude Code to save the information for future reference.

Environment

  • Claude Code CLI
  • Model: Claude Opus 4.6 (1M context)
  • Memory system: file-based (~/.claude/projects/.../memory/)

View original on GitHub ↗

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