/context does not list path-scoped .claude/rules/*.md files after they load mid-session

Status Open
Maintainer reply None cached
Activity 0 comments · opened Sep 9, 2026

Title

/context does not list path-scoped .claude/rules/*.md files after they load mid-session

Body

Setup

A project has rule files under .claude/rules/*.md, each with YAML frontmatter declaring
a glob list, e.g.:

---
paths:
  - "src/equipment/**/*.py"
---

# Unit operations
...

Observed behavior

  1. Session starts. /context shows only the root CLAUDE.md under Memory files.
  2. Claude reads a file matching one of the globs (e.g. src/equipment/exchanger.py).
  3. Immediately after, the matching rule file's full content is correctly injected into

context as a <system-reminder> block attached to that tool result — formatted the
same way the root CLAUDE.md is presented at session start ("Contents of
<path>: ..."). The model can see and quote this content without issue.

  1. Running /context in the same session, after step 3, does not list the loaded

rule file anywhere (not under Memory files, not counted in the token total).

This was reproduced twice in one session with two different rule files
(.claude/rules/equipment.md after reading a src/equipment/** file, and
.claude/rules/thermo.md after reading a src/thermo/** file) — both injected into
context correctly, neither shown by a same-session /context afterward.

Expected behavior

Once a path-scoped rule file has been loaded into the active session's context,
/context should list it (e.g. under Memory files, or a distinct "Rules" grouping) and
include its size in the token total — the same way it accounts for the root/nested
CLAUDE.md files it discovers at session start.

Impact

/context is the tool users rely on to audit what's actually consuming context budget.
If dynamically-loaded rule files are invisible to it, the reported token total
undercounts actual context usage, and there's no way to verify from /context alone
that a path-scoped rule is (or isn't) currently loaded.

Environment

  • Claude Code running as a VSCode native extension.
  • No hooks configured in any settings scope (~/.claude/settings.json,

project .claude/settings.json, .claude/settings.local.json) — the rule-loading
behavior appears to be a built-in feature, not a user-configured hook.

View original on GitHub ↗