improve-claude-md
What it does
This skill teaches an agent how to improve a CLAUDE.md instruction file for a coding assistant. It wraps task-specific guidance in conditional blocks so the assistant pays attention to the parts that matter for each task.
When to use it
- βWhen a user has a CLAUDE.md file that the assistant seems to ignore.
- βWhen a project's instruction file has grown long and mixes general and task-specific guidance.
- βWhen a user asks for their assistant instructions to be rewritten for better follow-through.
Skill link
https://github.com/humanlayer/skills/blob/main/plugins/improve-claude-md/skills/improve-claude-md/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βImprove my CLAUDE.md so Claude follows the testing rules when I am writing tests.β
5 new skills a week. 1 minute to read.
How it works
The agent keeps the core project context as plain text and moves task-specific guidance into blocks marked with a condition. This gives the assistant a clear signal of when each block applies.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
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.
Domain-specific guidance that only matters for certain tasks β testing patterns, API conventions, state management, i18n β gets wrapped in <important if> blocks with targeted conditions.
The rule of thumb: if it's relevant to 90%+ of tasks, leave it bare. If it's relevant to a specific kind of work, wrap it.
2. Conditions must be specific and targeted
Bad β overly broad conditions that match everything:
<important if="you are writing or modifying any code">
- Use absolute imports
- Use functional components
- Use camelCase filenames
</important>
Good β each rule has its own narrow trigger:
<important if="you are adding or modifying imports">
- Use `@/` absolute imports (see tsconfig.json for path aliases)
- Avoid default exports except in route files
</important>
<important if="you are creating new components">
- Use functional components with explicit prop interfaces
</important>
<important if="you are creating new files or directories">
- Use camelCase for file and directory names
</important>
3. Keep it short, use progressive disclosure sparingly
Do not shard into separate files that require the agent to make tool calls to discover, unless the extra context is incredibly verbose or complex.
The whole point of <important if> blocks is that everything is inline but conditionally weighted β the agent sees it all but only attends to what matches.
Prefer to keep the file concise.
4. Less is more
- Frontier models can reliably follow a few hundred. Claude Code's system prompt and tools already use ~50 of those. Your CLAUDE.md should be as lean as possible.
- Cut any instruction that a linter, formatter, or pre-commit hook can enforce
- Cut any instruction the agent can discover from existing code patterns. LLMs are in-context learners β if your codebase consistently uses a pattern, the agent will follow it after a few searches.
- Cut code snippets. They go stale and bloat the file. Use file path references instead (e.g., "see
src/utils/example.tsfor the pattern").
5. Keep all commands
Do not drop commands from the original file. The commands table is foundational reference β the agent needs to know what's available even if some commands are used less frequently.
Output Structure
When rewriting a CLAUDE.md, produce this structure:
# CLAUDE.md
[one-line project identity β what it is, what it's built with]
## Project map
[directory listing with brief descriptions]
<important if="you need to run commands to build, test, lint, or generate code">
[commands table β all commands from the original]
</important>
<important if="<specific trigger for rule 1>">
[rule 1]
</important>
<important if="<specific trigger for rule 2>">
[rule 2]
</important>
... more rules, each with their own block ...
<important if="<specific trigger for domain area 1>">
[guidance]
</important>
... more domain sections ...
How to Apply
When given an existing CLAUDE.md to improve:
- Identify the project identity β extract a single sentence describing what this is. Leave it bare at the top.
- Extract the directory map β keep it bare (no
<important if>wrapper). This is foundational context. - Extract the tech stack β if present, k
FAQ
What is an important-if block?
It is an XML-style tag with a condition, which tells the assistant when the guidance applies.
Should the whole file be wrapped?
No. The skill says foundational context, such as project identity and tech stack, stays as plain markdown.
Why does the file need this?
The skill explains that an assistant may ignore context it judges irrelevant, so long unrelated text can hide what matters.
Details
Original description by the author
improve a CLAUDE.md file using <important if> blocks to improve instruction adherence
repo: humanlayer/skills
Popularity
- GitHub stars
- 5.5k
- Ranking position
- #14776
- License
- MIT
- Updated
- 11/1/2026
Comments
- β¦
More skills from this repository
build-iterated-agentic-loop
5.5kHelps your agent turn a repeated coding task into a repo skill plus a scheduled GitHub Actions workflow that runs a coding agent, with a memory file and one open PR per loop.
design-control-loop
5.5kHelps your agent interview you and design a control loop that moves your codebase toward a goal through small, reviewable changes, then builds it as a scheduled workflow.
rpi
5.5kHelps your agent research a change, work through its design, and implement it in clear phases, with a document for each step you can review.
visual-pr
5.5kHelps your agent write or update a pull request description that explains why a change exists and how it is built, using a clear template and a short visual outline.
Similar skills
writing-skills
311kTeaches your agent to write new skills and test each one first, checking that the skill actually changes how the agent behaves.
writing-for-agents
310kExplains how to write clear instructions for AI agents, including skills, AGENTS.md, and CLAUDE.md files, so the agent behaves predictably.
bengali-nlp
280kHas your agent process Bengali text. It helps understand and work with the language, normalizing text and handling its unique characteristics.