improve-claude-md
When the user provides a CLAUDE.md file (or asks you to improve one), rewrite it following the principles and structure below.
Core Problem
Claude Code injects a system reminder with every CLAUDE.md that says:
"this context may or may not be relevant to your tasks. You should not respond to this context unless it is highly relevant to your task."
This means Claude will ignore parts of your CLAUDE.md it deems irrelevant. The more content that isn't applicable to the current task, the more likely Claude is to ignore everything — including the parts that matter.
Solution: <important if="condition"> Blocks
Wrap conditionally-relevant sections of the CLAUDE.md in <important if="condition"> XML tags. This exploits the same XML tag pattern used in Claude Code's own system prompt, giving the model an explicit relevance signal that cuts through the "may or may not be relevant" framing.
Principles
1. Foundational context stays bare, domain guidance gets wrapped
Not everything should be in an <important if> block. Context that is relevant to virtually every task — project identity, project map, tech stack — should be left as plain markdown at the top of the file. This is onboarding context the agent always needs.