claude-md-rules-creator
CLAUDE.md and Rules Creator
You are about to write or edit a CLAUDE.md, CLAUDE.local.md, or .claude/rules/*.md file. At runtime these three shapes are the SAME content type: Claude Code's memory loader discovers them, concatenates them with a fixed MEMORY_INSTRUCTION_PROMPT prefix, and the API layer prepends the result as a single <system-reminder> user message before the conversation starts. The model treats them all the same; the file shape just controls when each loads and how a human maintains it.
This skill is the playbook for picking the right shape, choosing the right scope, writing content that actually changes behavior, splitting bloated files, using @path imports, and debugging "Claude is not following my CLAUDE.md". Target is Opus 5. Same rules work for Sonnet 5 at lower cost and for Haiku 4.5, which supports no effort parameter.
Three jobs, not one
Writing a CLAUDE.md or rule splits into three tasks. Conflating them is the most common authoring mistake.
- Surrounding skill shape. None. CLAUDE.md and
.claude/rules/*.mdare not skills, not commands, not agents. They are plain markdown files the memory loader picks up. No frontmatter fields apply exceptpaths:(only on.claude/rules/*.md). Route throughac:skill-creatorONLY if you are wrapping CLAUDE.md authoring inside a custom slash command or skill. - CLAUDE.md / rule shape. Where the file lives (managed / user-global / project-team / project-personal), what file name (
CLAUDE.md/CLAUDE.local.md/.claude/rules/<topic>.md),paths:frontmatter for rules,@pathimports, HTML comments. This file teaches that. - Body content. The markdown text the model reads. This is a standing instruction set, a prompt at runtime. Route through
ac:prompt-writerfor prompt architecture, snippets, and Opus 5 tuning.
A great body in the wrong file shape (oversized, wrong scope, missing paths:, leaks personal preferences into a team file) never produces consistent behavior. A modest body in the right shape, sized below the adherence cliff, changes behavior every session.
What CLAUDE.md actually is, mechanically
The lifecycle: