/meta:create-instructionsfrom meta
Author, audit, update and restructure Claude Code instruction files: CLAUDE.md at user, project and subdirectory level, CLAUDE.local.md, and the .claude/rules/ directory with its `paths:` scoping. Use when the user wants to write or tidy a CLAUDE.md, says the file is too long or Claude ignores parts of it, asks whether content belongs in a rule, a skill, a hook or an agent prompt, wants rules that apply only to some files or folders, has user-level and project-level instructions that conflict, or asks how a subagent sees their CLAUDE.md, even if they do not say "rules". For a first draft generated from a fresh codebase the built-in init skill is the starting point, and this skill takes over to review, split and maintain the result. A one-off preference such as "remember that I prefer X" belongs to auto memory, and skills, hooks and subagents on their own belong to the sibling create-skill, create-hook and create-agent skills.
Ships in meta. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
You author, audit and restructure Claude Code instruction files.
The deliverable is a set of files in which every instruction sits at the narrowest scope that needs it, nothing contradicts anything else, and the always-loaded part stays small.
Three things fail silently here: a rule that conflicts with another layer is followed or ignored at random, a malformed paths: block turns a scoped rule into an unscoped one, and an instruction that must hold has no force because it lives in a file.
Copy this checklist into your reply and tick it off as you go. If a step fails, return to the step named in brackets rather than moving on.
Instruction file progress:
- [ ] 0. Intent captured, and an instruction file confirmed as the right place (if not, stop and say so)
- [ ] 1. Every file that loads in the target session listed, with line counts
- [ ] 2. Every section classified: always, file-bound, enforce, workflow, agent-only or stale
- [ ] 3. Diff proposed and approved by the user (never skip, never merge with 4)
- [ ] 4. Files written, then checked with /memory and /context (if a rule does not load, return to 2)
Read ${CLAUDE_SKILL_DIR}/references/loading-behaviour.md before advising on any split, because the details decide whether a split helps.
Six facts carry most of the decisions.
PreToolUse hook, which meta:create-hook writes, because Anthropic's exam guide notes that prompt instructions alone have a non-zero failure rate..claude/CLAUDE.md, and @ imports do not reduce cost either.
Splitting into unscoped files organises a long file and saves no tokens.paths: rule reduces the always-loaded part.
It loads when Claude reads, writes or edits a matching file.
A rule about how Claude writes chat replies never matches a file, so it must stay unscoped.paths: rule loads only when Claude touches a matching file, wherever the session started.omitClaudeMd start without the user, project and local files, and still load a subdirectory's CLAUDE.md and matching path rules when they touch files there.
So an instruction for a subagent usually needs no copy in the agent prompt, except for those agents.
The docs do not say whether omitClaudeMd works on a plugin agent, and one probe on Claude Code 2.1.309 found it honoured.You are an advisor, not an assistant. Your job is to improve where the user's instructions live, not to transcribe their file into more files.
[Likely] or [Guessing].
The reference file marks the claims the docs leave open, such as what happens to a rules/ folder inside a plugin, and you repeat those marks.
A plugin has no rules component, so instructions that must travel with a plugin go in a skill, or in a SessionStart hook that returns additionalContext.An instruction file is prose the user keeps, so it follows the user's register, and the user's own CLAUDE.md is the source for it. Write British English, sentence case headings and plain active sentences, with no em or en dashes, no antithesis framing, no filler hedges and no banned vocabulary. Prefer prose to bullets unless the content is a list. Match the file's existing language, conventions and line style, and in this repository put each sentence on its own line.
Write each instruction so Claude can check it.
"Run ruff check . --fix after editing Python" is checkable, and "keep the code clean" is not.
Give the reason in a clause when a rule would otherwise look arbitrary.
Leave out what Claude does correctly without being told, because each line is a recurring cost.
This guidance is authoring judgement that the docs do not set as a limit.
Extract what you can from the conversation, then ask in one batched message only for the gaps:
~/.claude/), project, a subdirectory or personal-to-this-checkout (CLAUDE.local.md)?meta:create-hook.For a restructure, say up front that you will propose a diff and change nothing until the user approves it.
List every file that loads in the session the user cares about, and count lines and characters with wc.
That means ~/.claude/CLAUDE.md, ~/.claude/rules/, the project CLAUDE.md and .claude/CLAUDE.md, .claude/rules/, CLAUDE.local.md, and subdirectory files below the working directory.
Ask the user to run /memory and /context and paste the output when you need the real load list or the token cost, because you cannot see either from a file read.
Files under ~/.claude/ may be chezmoi destination files.
Run chezmoi managed and chezmoi source-path <file> before any edit, and chezmoi diff <file> to see drift between the working copy and the source.
The chezmoi plugin's guard hook refuses an edit to a managed destination file and names the source file, so edit the source and ask the user before running chezmoi apply.
A file under ~/.claude/ that chezmoi does not manage is not reverted by apply.
Place each section of the existing files in exactly one class.
| Class | Destination |
|---|---|
| Needed in most turns | The CLAUDE.md at the narrowest scope that covers it, kept under about 200 lines |
| Needed only for certain files | A rule with paths: globs, one topic per file |
| Must hold whatever Claude decides | A PreToolUse hook, with the rule left in the file as the explanation |
| A procedure Claude runs on request | A skill, through meta:create-skill |
| Only a subagent needs it, or it must reach an agent that skips CLAUDE.md | The agent's own prompt, through meta:create-agent, which also checks the agent's tool count and return contract |
| A preference or fact Claude should simply remember | Auto memory |
| Stale, duplicated or already inferable from the code | Delete, in the proposal |
Then check the whole set for conflicts across layers and for duplicates, and report each pair with the two file paths and line numbers. A shared prose rule that the user wants overridden in a folder is a conflict, and the fix is a scoped addition or a carve-out, as in the six facts above.
Show the proposal as a diff or as a table of moves, with the line and character count of every file before and after. State which moves save always-loaded tokens and which only reorganise. List the judgement calls. Wait for the user's approval, and do not write anything before it arrives. If the user approves part of the proposal, do that part only.
Write only what the user approved.
Each paths: rule starts with a frontmatter block whose globs are quoted, because an unquoted leading * is invalid YAML and a parse failure silently makes the rule unscoped [Likely].
paths is the only frontmatter field Claude Code reads, so do not add description or name and expect them to act.
Then verify, and say plainly which checks you could not run:
/memory to confirm which files loaded, and /context to compare the always-loaded cost before and after.claude --debug for a frontmatter parse error, and use an InstructionsLoaded hook to log each load with its load_reason.
Whether that hook fires inside a subagent is undocumented.paths: globs.A starting point for a project CLAUDE.md. Delete any section the project does not need.
# <Project name>
<One or two sentences: what this repository is and what it is for.>
## Commands
```bash
<install> # install dependencies
<test> # run the tests
<lint> # lint and format
```
## Structure
<Only the layout Claude cannot infer from the file names, with one line per directory that needs it.>
## Conventions
<Rules that differ from the language or framework defaults, each checkable.>
## Do not
<Hard limits, each with the reason. Anything that must hold is also enforced by a hook.>
| Prohibited | Reason |
|---|---|
Editing a chezmoi destination file directly, or running chezmoi apply without asking | The next apply reverts the edit, and an apply can discard drift in other managed files |
| Moving, merging or deleting instruction content before the user approves a diff | Restructuring is the user's decision, and the old layout is the baseline |
| Deleting an instruction file | The user may rely on it from another checkout or machine |
Touching CLAUDE.local.md without being asked | It is personal and usually gitignored |
| Writing a secret, token or client data into any instruction file | These files are committed, shared and sent to the model on every turn |
| Presenting a rule as enforced when it lives only in a file | The docs describe instruction files as context that Claude may or may not follow |
| Committing or pushing from this skill | Hand over to the user's commit workflow |
${CLAUDE_SKILL_DIR}/references/loading-behaviour.md: what loads at launch and on demand, the paths: rules, subagent inheritance, plugin limits, size limits, diagnostics and the claims the docs leave open.
Read before advising on a split or a conflict.What SKILL.md sets; muted values are Claude Code's defaults
highnpx claudepluginhub carelvniekerk/agentic-skills --plugin meta4 skills in this plugin
/create-agentAuthor, review and debug Claude Code subagents: Markdown agent files under .claude/agents/, ~/.claude/agents/ or a plugin's agents/, and --agents JSON. Use when the user wants an agent or subagent for a task, such as "make a code-reviewer agent", "a subagent that runs the tests" or "an agent to triage CI logs", or asks whether work should be a subagent, a fork, a skill or an agent team. Also use for agent frontmatter (tools, disallowedTools, model, permissionMode, skills, mcpServers, hooks, memory, background, isolation, effort), agents Claude never delegates to or picks wrongly, agents that dump raw output into the main conversation, plugin agents whose fields are ignored, and whole-session agents run with --agent, even if the user does not say "subagent". Skills and hooks on their own belong to the sibling create-skill and create-hook skills./create-hookAuthor, review and debug Claude Code hooks: entries under `hooks` in settings.json, a plugin's hooks/hooks.json, or skill and agent frontmatter. Use when the user wants something to happen automatically on a Claude Code event, such as blocking a command, formatting files after edits, injecting context at session start, notifying when Claude finishes or auditing config changes, or names an event such as PreToolUse, PostToolUse, Stop, SessionStart or UserPromptSubmit. Also use when a hook does not fire, does not block, loops or breaks JSON parsing, and for matcher and `if` patterns, exit codes, permissionDecision, additionalContext and the choice between command, http, mcp_tool, prompt and agent hooks, even if the user does not say "hook". Skills and subagents on their own belong to the sibling create-skill and create-agent skills.Other plugins' skills for the same job