[BUG] CLAUDE.md instructions to not create files with "claude" in name are ignored by auto-memory feature

Resolved 💬 3 comments Opened Feb 6, 2026 by vijayvat Closed Mar 6, 2026

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?

Description:

User instruction in ~/.claude/CLAUDE.md:

  • Never create any files or directories with "claude" or "anthropic" in the name

Observed behavior:
Claude Code created a .claude/ directory inside the project repo (/c/build/.claude) despite the explicit instruction.

Root cause:
The auto-memory system prompt defines a memory directory path containing .claude. This conflicts with user instructions but proceeds anyway.

What Should Happen?

Expected behavior:
User instructions in CLAUDE.md should override system features like auto-memory. The auto-memory feature should respect user rules about file/directory naming.

Environment:

Windows 11
Claude Code CLI (VSCode extension)
Model: claude-opus-4-5-20251101

Error Messages/Logs

Steps to Reproduce

Create ~/.claude/CLAUDE.md with content:

Rules

  • Never create any files or directories with "claude" or "anthropic" in the name

Open a project directory in Claude Code

Have a conversation where Claude attempts to use the auto-memory feature (e.g., Claude offers to "remember" something or writes to memory)

Check project directory:

git status
Observe .claude/ directory created in project repo despite explicit instruction

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

Claude Code CLI (VSCode extension) Model: claude-opus-4-5-20251101

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

VS Code integrated terminal

Additional Information

_No response_

View original on GitHub ↗

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