# Improve Claude Md

Improve a CLAUDE.md file using <important if> blocks to improve instruction adherence

- Repository: https://github.com/humanlayer/skills (5529 stars)
- Category: AI and agents
- License: MIT
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add humanlayer/skills --skill improve-claude-md -g -a claude-code -y`
Codex: `npx skills add humanlayer/skills --skill improve-claude-md -g -a codex -y`
Cursor: `npx skills add humanlayer/skills --skill improve-claude-md -g -a cursor -y`
Gemini CLI: `npx skills add humanlayer/skills --skill improve-claude-md -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add humanlayer/skills`

## Description

improve a CLAUDE.md file using <important if> blocks to improve instruction adherence

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

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>
```

The rest: https://github.com/humanlayer/skills/blob/HEAD/plugins/improve-claude-md/skills/improve-claude-md/SKILL.md
