Need AI Training/Help?CloudYeti.io/meet
MarkdownMe
Agent instruction guide

CLAUDE.md vs .claude/rules vs Skills — Which File Owns What

Route each instruction to the right file: always-loaded CLAUDE.md, path-scoped .claude/rules/, or on-demand skills. One question decides it.

Direct answer

One question routes every instruction: when does this need to be in context? Always, for every task — CLAUDE.md, which loads in full at the start of every session. Only when Claude touches certain files — a rule in .claude/rules/ with a paths frontmatter field, which loads when Claude reads a matching file. Only when a specific task comes up — a skill, which loads when you invoke it or when Claude judges it relevant. Moving procedures out of CLAUDE.md into rules and skills is the main way to shrink an oversized file without losing the content.

Open CLAUDE.md Reviewer

When to use this

  • Your CLAUDE.md is over 200 lines and you need to split it, not delete it.
  • You have testing rules that only matter when Claude edits test files.
  • You have a release or review procedure sitting in CLAUDE.md that runs once a month.

Steps

  1. Paste your CLAUDE.md into the reviewer and note which sections are procedures rather than facts.
  2. Keep in CLAUDE.md: commands, conventions, layout, and always-true rules.
  3. Move file-type guidance into .claude/rules/<topic>.md with a paths field, such as paths: ['src/api/**/*.ts'].
  4. Move multi-step procedures into skills, which load only when relevant.
  5. Run /context in a session and confirm the split file set still loads what you expect.

Example review focus

CLAUDE.md excerpt
# CLAUDE.md

## Testing
- Test files use Vitest and live beside the source file.
- Mock network calls with msw, never real fetch.

## Release
1. Bump the version in package.json.
2. Run npm run build.
3. Tag the commit.
4. Push the tag.
5. Verify the GitHub Action went green.
6. Announce in #releases.

## Commands
- npm run dev
- npm run test
What to fix
Keep the Commands section in CLAUDE.md. Move Testing into .claude/rules/testing.md with paths: ['**/*.test.ts'] so it loads only when Claude opens a test file. Move Release into a skill: it is a six-step procedure that runs once per release and does not belong in every session's context.

Common mistakes

  • Do not use rules without a paths field to save context; those load at launch just like CLAUDE.md.
  • Do not use @path imports as a size fix; imports are organization only, and the content still loads at launch.
  • Do not duplicate a rule in both CLAUDE.md and .claude/rules/; duplicates become contradictions when one is edited.
  • Do not expect a path-scoped rule to survive /compact; it reloads the next time Claude reads a matching file.

FAQ

What is the difference between a rule and a skill?
A rule is a convention Claude should know whenever it touches matching files, and it loads automatically on a path match. A skill is a procedure Claude runs occasionally, and it loads only when invoked or judged relevant.
How do I scope a rule to specific files?
Add YAML frontmatter with a paths field listing glob patterns, such as src/api/**/*.ts or src/**/*.{ts,tsx}. A rule with no paths field applies to everything and loads at launch.
Where do rules live?
Project rules go in .claude/rules/ as one markdown file per topic, discovered recursively so you can nest them in subdirectories. Personal rules for every project go in ~/.claude/rules/ and load before project rules.
Does splitting my CLAUDE.md actually save context?
Only if you split into path-scoped rules or skills. Those load on demand. Splitting into @path imports does not save anything, because imported files are expanded into context at launch.

Related CLAUDE.md guides

Desk gear for long writing sessions

A few things that help if you write docs, tickets, and specs on a laptop all day.

Amazon affiliate links. We earn a commission on qualifying purchases at no extra cost to you.