Skip to content
How it learnsFrom coding sessions, reviews, Slack and docs.Only what fitsEach session gets the few rules its task needs.Pull request reviewEvery PR checked against your team’s rules.Keep it trueA gate, conflicts, disputes and stale rules, handled.HandoffsCarry the work to another session or a teammate.SecurityWhat it sends, what it changes and how to leave.
Engineering teamsOne agent or several: what one person learns, every session uses.PR review onlyInstall the GitHub App. Nothing on anyone’s machine.Teams that mix agentsClaude Code, Cursor, Codex and Copilot, the same rules.On your ownYour corrections follow you across repos, machines and agents.Book a call30 minutes with Roei, if you want a hand. Never required.
DocsPricingSign in
Connect your agents →
For teamsOn your ownPR review onlyHow it learnsOnly what fitsPull request reviewKeep it trueSecurityDocsPricingSign inConnect your agents →
Home/Answers

Answers

Ignores its rule file

  • HTML comments in CLAUDE.md
  • "Read AGENTS.md" does not import
  • Antigravity ignores AGENTS.md
  • Windsurf ignores rules

Rule file too long

  • AGENTS.md too long for Codex
  • Antigravity rule size limit
  • Copilot instructions length
  • Cursor rules too long

Rules drift from the code

  • CLAUDE.md and AGENTS.md drift
  • Directory trees in rule files

Share rules across repos and agents

  • Share CLAUDE.md across repos
  • Share AGENTS.md in Codex
  • Copilot org instructions
  • Gemini CLI and AGENTS.md
  • Share Windsurf rules

Memory between sessions

  • Gemini CLI memory

Answers

Claude Code strips HTML comments from CLAUDE.md, so a rule inside one never loads

Published November 18, 2026

Claude Code removes block-level HTML comments (<!-- ... -->) from every CLAUDE.md before the text reaches Claude, so a rule written inside one is never in context. Anthropic documents it as a feature: comments are notes for the people maintaining the file, and they cost no tokens. It turns into a bug when someone comments out a rule to "park" it, or wraps real instructions in a comment block to keep a rendered README tidy.

For Claude Code. Vendor facts are from the pages linked below, read on November 18, 2026.

How to find and fix it

  • Search the file for <!--. Anything between it and --> outside a code block is invisible to Claude.
  • Move every instruction you want followed out of the comment, as plain text or a list item.
  • Keep comments only for notes to people: why a rule exists, who to ask, when to delete it.
  • A comment inside a fenced code block is kept, so an example of HTML in a code block still reaches Claude.
  • Run /context in a session and read the CLAUDE.md entry under Memory files to see what actually loaded.
<!-- Claude never sees this line -->
- Run pnpm test before every commit.   <- Claude sees this one

The numbers

MeasureValueSource
Public CLAUDE.md files that contain HTML comments5.5% (weighted, of 1,932 sampled)Harbor study, 18 Oct 2026
Public CLAUDE.md files on GitHub, forks excluded839,680Harbor study, 18 Oct 2026
Comments inside code blocksKept; only block-level comments are strippedClaude Code memory docs

Study figures are weighted estimates from 1,935 CLAUDE.md and 1,970 AGENTS.md files sampled from public GitHub repositories on 18 October 2026, with GitHub's own counts for the totals. Every figure is in the study's CSV, and the method is in the study.

What the docs say

  • Claude Code: How Claude remembers your project: Block-level HTML comments in CLAUDE.md files are stripped before the content is injected into Claude’s context. Comments inside code blocks are preserved, and a CLAUDE.md opened with the Read tool still shows them.

Where Harbor fits

Harbor connects Claude Code, Codex, Cursor and GitHub Copilot (the CLI and VS Code agent mode; the cloud agent is not supported yet) through hooks and an MCP server. At setup it offers the repo’s committed CLAUDE.md to Review, and keeps each rule as its own entry with the sentence it came from, so there is no comment block for a rule to hide in. Each rule shows how often it was served and how often an answer cited it. A citation is evidence a rule was used, not proof it was obeyed.

Read next

  • Why Claude ignores CLAUDE.md, every cause
  • The study of 3,905 CLAUDE.md and AGENTS.md files
  • Check your CLAUDE.md for free
  • "Read AGENTS.md" in CLAUDE.md does not load it: put @AGENTS.md on its own line
  • Antigravity CLI skips AGENTS.md in subfolders and drops rule files without a valid trigger
  • Windsurf is now Devin Desktop: .devin/rules wins, and only one global_rules.md loads
  • CLAUDE.md and AGENTS.md drift apart in 7% of repos that copy one into the other: import instead
  • Every answer, by agent and problem

Questions

Does Claude Code read HTML comments in CLAUDE.md?

No. Block-level HTML comments are stripped before the content is injected into Claude’s context. Comments inside fenced code blocks are kept, and if Claude opens the file with the Read tool it sees the comments as plain text.

Can I use HTML comments to disable a rule in CLAUDE.md temporarily?

Yes, that works, and it is the safe use: the rule stops loading. Just know that a comment is not a draft Claude sees, and delete the parked rule if it is still there next month.

How common are HTML comments in CLAUDE.md files?

In our 18 October 2026 sample of public GitHub repositories, 5.5 percent of CLAUDE.md files (weighted) contained HTML comments. The study did not check whether each comment held a rule or a note.

Do other agents strip HTML comments from AGENTS.md?

Anthropic documents the stripping for Claude Code’s CLAUDE.md files. We have not found the same statement in the Codex, Cursor or Copilot docs, so test it in each agent before you rely on a comment being hidden or seen.

Your team’s rules, in every agent, checked on every PR.

Harbor is shared memory for your team’s Claude Code, Cursor, Codex and Copilot. Free for you and one teammate. No card. No end date.

Start free →

Product

  • How it learns
  • Only what fits
  • Pull request review
  • Keep it true
  • Handoffs
  • The result
  • Security
  • For coding agents
  • Pricing

Developers

  • Docs
  • Quickstart
  • Install
  • CLI
  • MCP server
  • Served and cited
  • Rule-file checker
  • Blog

Guides

  • Why Claude ignores CLAUDE.md
  • AGENTS.md vs CLAUDE.md
  • Share Claude Code memory with a team
  • Why Codex ignores AGENTS.md
  • Why Cursor ignores rules
  • Copilot instructions vs AGENTS.md
  • Shared memory across agents
  • Copilot Memory and Dreaming

Compare

  • All comparisons
  • vs Mem0
  • vs Zep
  • vs Unblocked
  • vs ByteRover
  • vs Cognee
  • vs Hindsight
  • vs OpenViking
  • vs Supermemory
  • vs Glen
  • vs MemPalace
  • vs Sentra
  • vs Trail-code

Company

  • Questions
  • Contact
  • X
  • LinkedIn
  • Privacy Policy
  • Terms of Service
  • Data Processing Agreement
  • Refund Policy
© 2026 HarborConnect your agents