CLAUDE.md frontmatter is stripped before showing to model
Resolved 💬 3 comments Opened Dec 3, 2025 by bukzor Closed Dec 3, 2025
Summary
CLAUDE.md YAML frontmatter is parsed and stripped before being injected into the model's context. Unrecognized fields are silently discarded.
Current behavior
Given this CLAUDE.md:
---
depends:
- skills/subtask
---
# Skills Directory
The model only sees:
# Skills Directory
The frontmatter is parsed (function yF in the codebase), but only paths: is consumed (for the unreleased .claude/rules/ feature). Everything else is thrown away.
Expected behavior
Unrecognized frontmatter fields should be passed through to the model's context, not stripped. This would allow:
- Users to define custom directives the model can interpret
- Forward compatibility—new conventions can emerge without Claude Code updates
- The model to act on metadata like
depends:,setup:, etc.
Workaround
Adding an empty frontmatter block prevents stripping:
---
---
depends:
- skills/subtask
---
This is ugly but functional.
Suggested fix
In the context injection path, either:
- Pass through the raw file content (don't strip frontmatter)
- Or re-serialize recognized + unrecognized frontmatter fields back into the content
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗