Help users continuously optimize the global context (~/.claude/CLAUDE.md), keeping it concise, efficient, and compliant with official standards.
This skill does three things:
- Extract content from user input that is suitable for global effect, and generate specific changes
- For content not suitable for global scope, suggest whether it is worth extracting as an independent skill
- Review and streamline the existing global context against official standards
Sources of official standards (re-fetch the latest version when needed):
- https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices
- https://code.claude.com/docs/en/best-practices
- nix-self-iteration-protocol: Diagnose prompt failures that have already occurred, classify failure modes, and fix the instruction system
- This skill: Starting from user input or official standards, proactively optimize the content and structure of the global context
If the user is describing "a certain rule didn't take effect" or "a skill was triggered by mistake", use nix-self-iteration-protocol. If the user is thinking "how should I write my global context better", use this skill.
Input modesThe user may trigger it in four ways:
Mode 1: Describe collaboration friction
The user talks about unpleasant scenarios they encountered recently.
Approach:
- Determine the root cause of the friction — is it a missing rule in the global context, a missing skill, a tooling gap, or a model capability boundary
- If it is a global context issue, propose specific rule changes
- If not, tell the user where the real fix lies
Mode 2: Evaluate a change proposal
The user directly provides content they want to add to the global context.
Approach:
- Read the current
~/.claude/CLAUDE.md - Check the proposed content item by item using the evaluation checklist (see "Evaluation criteria" below)
- Give a verdict for each item: suitable for global / should be extracted as a skill / not needed
- For content suitable for global scope, provide the rewritten specific text and insertion location
- For content recommended to be extracted as a skill, explain the rationale and the rough outline of the skill
Mode 3: Review the existing global context
The user does not provide specific content and asks for direct optimization.
Approach:
- Read the current
~/.claude/CLAUDE.md - Review each existing rule item by item using the evaluation checklist
- Output a review report: keep / streamline / delete / migrate to skill, with a rationale for each item
- Provide the complete rewritten global context
Mode 4: Extract from information
The user gives an instruction for you to obtain information (such as reading a file or searching a topic), then extract candidate global context content from it.
Approach:
- Execute the user's instruction and obtain the information
- Filter out content from the information that may be valuable for the global context
- Process it according to the evaluation flow in Mode 2
For each candidate rule, check in order:
- Cross-task applicability — Is it needed by all/most task types? If it is only needed in a specific workflow, it belongs in a skill
- Non-inferability — Can Claude infer it from the code or context on its own? If it can be inferred, it doesn't need to be written
- Observability — Can a violation be seen in the output? An unobservable rule cannot be verified or improved
- Non-redundancy — Is it different from Claude's default behavior? A rule that duplicates default behavior is noise
- Conciseness — Is it already the shortest effective phrasing?
- With rationale — Does it explain the why? Explaining the why is more effective than MUST/NEVER (Claude 4.5/4.6 is very sensitive to system prompts and does not need heavy-handed instructions)
- Non-contradiction — Does it conflict with other rules?
Global CLAUDE.md conciseness principles
Source:https://code.claude.com/docs/en/best-practices
- Treat CLAUDE.md like code: review, prune, test
- If deleting a line would not cause Claude to make a mistake, delete it
- An overly long CLAUDE.md causes rules to be ignored (the official explicitly named failure pattern: "Over-specified CLAUDE.md")
Prompt engineering standards
Content suitable for global context
- Role setting — A single-sentence role description focused on behavior and tone
- Clear and direct instructions — Rules with unambiguous, observable behavior
- Constraints with rationale — Explaining the why is more effective than MUST/NEVER
- Output format preferences — Write them only when the preference differs from the default
- Over-engineering constraints — Claude 4.5/4.6 has a tendency to over-engineer, so the global layer is a suitable place to add such constraints
Content not suitable for global context
- Specialized workflows — Should go into a skill (loaded on demand, does not consume global tokens)
- Rules specific to a single project — Should go into the project-level CLAUDE.md
- Things that can be deterministically enforced by tooling — Replace with hooks, linters, tests
- Over-instruction — Claude 4.5/4.6 is more sensitive to system prompts and does not need emphasis words like CRITICAL/MUST
- Redundant rules — Rules consistent with Claude's default behavior are noise
- Things inferable from the code — Architecture, file paths, code style, etc. that Claude can figure out on its own
Claude 4.5/4.6 behavioral characteristics (affecting global context design)
- More direct, less redundant output
- More sensitive to system prompts, dials back over-emphasized instructions
- Has a tendency to over-engineer
- Uses adaptive thinking by default
- Good at parallel tool calls
- Naturally uses subagent delegation
Regardless of the input mode, the final output includes:
1. Global context changes
For each change:
- Change type: add / modify / delete
- Change content: the specific rewritten text
- Evaluation basis: which items in the evaluation checklist are cited
- Position in the existing structure: which section of CLAUDE.md it should be inserted into/replace
2. Skill suggestions (if any)
For each suggested skill:
- Name and one-sentence description
- The scenarios it covers
- Why it is not suitable for the global context (usually because it does not satisfy cross-task applicability)
3. Content not adopted (if any)
For each item not adopted, explain the reason (redundant, inferable, belongs to the tooling layer, etc.).
Execution discipline- Read the existing global context before making suggestions; do not write from thin air
- The global context is extremely scarce—every added rule consumes part of the token budget of every conversation. Better to have one fewer than one too many
- Do not repeat Claude's default behavior (for example, "write safe code"—Claude does this by default)
- Explain why instead of shouting MUST in all caps. Claude 4.5/4.6 understands motivation more reliably than it obeys commands
- Changes should be concrete enough to be directly appliable text, not just abstract suggestions