Reading a file appears to reload CLAUDE.md + all .claude/rules/*.md files, even ones whose glob doesn't match

Open 💬 0 comments Opened Jul 9, 2026 by rahullotusai

Observed behavior: During a long session in a git worktree, a single Read tool call on one file (a markdown plan doc under docs/superpowers/plans/, unrelated to any repo-configured glob) was immediately followed in the transcript by the harness re-injecting the project's root CLAUDE.md plus all eight .claude/rules/*.md files as <system-reminder> content — including rule files whose declared globs: frontmatter clearly does not match the file that was read (e.g. .claude/rules/queue-filter-ui.md scoped to src/components/**/*Filters.tsx etc., .claude/rules/journey-rendering.md scoped to journey-rendering source trees, .claude/rules/auth-and-deploy-infra.md scoped to .env.local/vercel.json/etc.).

Transcript excerpt (assistant turn, tool result immediately followed by full context reload before any further reasoning):

● Confirmed. Fixing C1 first — the wrong edited_qty assertion.

  Read 1 file (ctrl+o to expand)
  ⎿  Loaded CLAUDE.md
  ⎿  Loaded .claude/rules/queue-filter-ui.md
  ⎿  Loaded .claude/rules/auth-roles.md
  ⎿  Loaded .claude/rules/context-management.md
  ⎿  Loaded .claude/rules/journey-rendering.md
  ⎿  Loaded .claude/rules/case-lifecycle-ui.md
  ⎿  Loaded .claude/rules/auth-and-deploy-infra.md
  ⎿  Loaded .claude/rules/signup-flow.md
  ⎿  Loaded .claude/rules/global-filter-bar.md

● Now fixing C1 — with reserved_qty=35, TGT-700's alloc is 20, not 15, so edited_qty should be 30, not 25.

Expected behavior: .claude/rules/*.md files are documented (in this project's own context-management convention, and consistent with how Claude Code's rule-loading is generally understood to work) as thin, glob-scoped triggers that should only load when a file matching their globs: pattern is opened/edited. A Read on an unrelated markdown plan document should not cause all eight rule files project-wide to reload regardless of glob match, and CLAUDE.md itself shouldn't need to reload mid-session when it was already loaded at session start.

Impact: This appears to happen repeatedly across a long session (git worktree work, multiple file reads), each time injecting several thousand tokens of content that's already present earlier in the same conversation and/or not relevant to the specific file being read. Over a long session this adds up to meaningfully wasted context/cost with no apparent benefit, and risks pushing relevant context out of the effective window sooner than necessary.

Environment: Claude Code CLI, working inside a git worktree (git worktree add-created directory, not the main checkout) inside a larger monorepo-style project with a root CLAUDE.md and multiple .claude/rules/*.md glob-scoped rule files. Unclear whether the worktree context specifically is a factor (e.g. re-resolving CLAUDE.md/rules paths relative to a new working directory each time) or if this happens in a normal checkout too — flagging as reported since I don't have an isolated repro outside this session.

Happy to provide more transcript context if useful — this was surfaced mid-session while doing unrelated implementation-plan-review work in a private repo, so I've only included the directly relevant excerpt above.

View original on GitHub ↗