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:

  1. Users to define custom directives the model can interpret
  2. Forward compatibility—new conventions can emerge without Claude Code updates
  3. 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:

  1. Pass through the raw file content (don't strip frontmatter)
  2. Or re-serialize recognized + unrecognized frontmatter fields back into the content

View original on GitHub ↗

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