[DOCS] Memory docs do not explain how HTML comments in `CLAUDE.md` are treated during auto-injection

Resolved 💬 2 comments Opened Mar 10, 2026 by coygeek Closed Mar 28, 2026

Documentation Type

Missing documentation (feature not documented)

Documentation Location

https://code.claude.com/docs/en/memory

Section/Topic

CLAUDE.md authoring guidance and what content is injected into model context.

Current Documentation

The page explains that:

CLAUDE.md files are markdown files that give Claude persistent instructions ... Claude reads them at the start of every session.

and:

CLAUDE.md files are loaded into the context window at the start of every session.

There is no documentation describing how HTML comments in CLAUDE.md are handled.

What's Wrong or Missing?

Release v2.1.72 changed behavior so HTML comments in CLAUDE.md (<!-- ... -->) are hidden from Claude during auto-injection, while remaining visible when the file is read directly with the Read tool.

This is a meaningful authoring behavior change for teams using comment blocks for maintainer notes. Without docs, users cannot tell which comment content is excluded from runtime instructions.

Suggested Improvement

Add a note in the memory page under CLAUDE.md authoring/loading that explains:

  1. HTML comments in CLAUDE.md are not injected into Claude context.
  2. Comments remain visible in raw file reads.
  3. Recommended usage pattern (for example, use HTML comments for maintainer-only notes that should not guide model behavior).

Include a short before/after example showing one visible instruction line and one hidden HTML comment line.

Impact

Medium - Makes feature difficult to understand

Additional Context

Affected Pages:

| Page | Line(s) | Context |
|------|---------|---------|
| https://code.claude.com/docs/en/memory | 39-40, 66-67, 110-114 | Describes CLAUDE.md loading behavior but not HTML-comment exclusion during auto-injection |

Total scope: 1 page affected

Source: Release v2.1.72

  • Changed CLAUDE.md HTML comments (<!-- ... -->) to be hidden from Claude when auto-injected. Comments remain visible when read with the Read tool

View original on GitHub ↗

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