Skip to content
Join 7,000+ leaders following Alastair's work on LinkedIn.

Skill

CLAUDE.md Discipline

Token budgets and context tiers for your CLAUDE.md, so your AI coding assistant loads what it needs every time and nothing else.

  • Works in
  • Claude Code

Download the skill or copy it below

---name: claude-md-disciplinedescription: Token budgets, context tiers and edit types for CLAUDE.md and .claude/rules/ files - what belongs always-loaded, what moves to on-demand skills or docs, and what gets archived. Use when creating or editing any CLAUDE.md, adding a rules file, deciding whether something belongs in CLAUDE.md at all, recording a finished phase or a new gotcha, or when a CLAUDE.md is over its token budget.license: "CC BY 4.0. Credit: CLAUDE.md Discipline, a free skill from HumanSpark.ai (https://humanspark.ai/claude-md-discipline/)"---# CLAUDE.md DisciplineCLAUDE.md is a document for the AI, not a reference for humans (humans read README.md). Every token in it is loadedinto every conversation, costs money and dilutes attention. Treat it like code: budget the tokens and review thegrowth.**Token budgets:** small projects under 2,000 tokens, medium under 4,000, large under 6,000. State the budget andthe current count in the body near the top, never in an HTML comment: comments can be stripped before the filereaches the model, so a budget written as a comment cannot limit anything. Measure with a real tokenizer; neverestimate.

When to use it

You're creating a CLAUDE.md for a new project.

set up a CLAUDE.md for this

You're about to add another rule to a CLAUDE.md.

where should this rule go?

A CLAUDE.md has grown past its token budget.

is this CLAUDE.md over budget?

A phase just finished and you want to record it.

update the CLAUDE.md for this

New to skills? A skill is a saved set of instructions your AI assistant reads whenever the job comes up, so you set it up once and it works the same way every time. AI Skills for Teams explains how they work.

More than a style guide

A style guide says how to write it. CLAUDE.md Discipline decides what belongs in it at all: what loads every time, what loads on demand, what goes to the archive, and how many tokens it's allowed to cost.

What it does

It treats CLAUDE.md like code. Every token costs money and dilutes attention, so the file gets a budget. Small projects under 2,000 tokens, medium under 4,000, large under 6,000. State the budget and the current count in the body near the top, never in a comment - comments can be stripped before the file reaches the model.

It covers three tiers of context. Always loaded is CLAUDE.md and rules files - design philosophy, architecture, how to build and run, testing, security, active gotchas, the 10 to 15 key files. On demand are skills and docs files - detailed patterns, module contracts, reference gotchas, loaded when working in that area. Archive is git history and docs/HISTORY.md - how things evolved, finished phases.

As CLAUDE.md grows, some things move out. Standalone instruction sets go to .claude/rules/*.md. A history section past five entries goes to docs/HISTORY.md. Gotchas for one subsystem go to a reference doc. A key-files table past 15 rows keeps the top 10 to 15. Duplicates get merged into the most authoritative section.

What it won't do

It won't decide what your design philosophy is. That's on you. It just teaches the structure that keeps CLAUDE.md useful instead of bloated.

It also won't move a rule out without a warning: a rule moved to a skill fails silently if the skill can't load, so it reminds you to check that every moved rule still loads.

More free skills

To shrink a bloated CLAUDE.md, CLAUDE.md Slim moves content to files that load only when needed. For decisions about naming and structure in a skill, Skill Authoring covers what actually makes skills activate. The full set is on the skills page.

How to install it

It's one file with no code in it, so read it first: you'll see exactly what it tells your assistant to do.

Claude Code

  1. Download the skill and unzip it.
  2. Put the folder in ~/.claude/skills/ to use it in every project, or in .claude/skills/ inside one project.
  3. Start a new session. It loads by itself when the job comes up.

Commit a project's .claude/skills/ folder and your whole team gets the skill.

The skill

Download the zip and upload it wherever your assistant takes skills. Or copy the whole block below into any AI assistant: the first lines ask it to save the rest as a skill, so you only do this once.

The skill
Please install the skill below for me.

Save everything between the BEGIN SKILL and END SKILL lines as a new skill called "claude-md-discipline", exactly as written. If you can't create skills, save it as custom instructions or as a project instead. When it's saved, tell me in one line how to use it.

===== BEGIN SKILL =====
---
name: claude-md-discipline
description: Token budgets, context tiers and edit types for CLAUDE.md and .claude/rules/ files - what belongs always-loaded, what moves to on-demand skills or docs, and what gets archived. Use when creating or editing any CLAUDE.md, adding a rules file, deciding whether something belongs in CLAUDE.md at all, recording a finished phase or a new gotcha, or when a CLAUDE.md is over its token budget.
license: "CC BY 4.0. Credit: CLAUDE.md Discipline, a free skill from HumanSpark.ai (https://humanspark.ai/claude-md-discipline/)"
---

# CLAUDE.md Discipline

CLAUDE.md is a document for the AI, not a reference for humans (humans read README.md). Every token in it is loaded
into every conversation, costs money and dilutes attention. Treat it like code: budget the tokens and review the
growth.

**Token budgets:** small projects under 2,000 tokens, medium under 4,000, large under 6,000. State the budget and
the current count in the body near the top, never in an HTML comment: comments can be stripped before the file
reaches the model, so a budget written as a comment cannot limit anything. Measure with a real tokenizer; never
estimate.

## Three tiers of context

1. **Always loaded** (`CLAUDE.md` and `.claude/rules/*.md`): design philosophy, architecture, how to build and run,
   testing, security, active gotchas, the 10 to 15 key files. Use rules files to split instructions that would push
   CLAUDE.md over budget.
2. **On demand** (skills, `docs/*.md`): detailed patterns, module contracts, reference gotchas, loaded when working
   in that area.
3. **Archive** (`docs/HISTORY.md`, git history): how things evolved, finished phases. Never loaded automatically.

**The tier test: can you know in advance that you will need it?** If a task triggers it, it belongs in a skill.
If it covers things you cannot know you are about to break, it stays always-loaded.

## What moves out as CLAUDE.md grows

- Standalone instruction sets (deployment, formatting) go to `.claude/rules/*.md`: still always-loaded, but they
  keep CLAUDE.md focused.
- A history section past about five entries goes to `docs/HISTORY.md`, leaving a three-line summary.
- Gotchas for one subsystem go to `docs/REFERENCE-GOTCHAS.md`.
- A key-files table past 15 rows keeps the top 10 to 15; the full list goes in README.md.
- Duplicates are merged into the most authoritative section.
- Incident stories behind a rule go to a separate origins document, leaving a one-line summary and a pointer. Move
  the story there BEFORE deleting it from the rule.

## Four kinds of edit

- **A finished phase:** add it to the history (or `docs/HISTORY.md` if that is overflowing), update the test count,
  and add key files only if they make the top 15.
- **An architecture correction:** update the main flow and component descriptions.
- **A new gotcha:** add it to "things to watch out for" if it affects everyday work; subsystem-specific ones go to
  `docs/REFERENCE-GOTCHAS.md`.
- **A refinement of philosophy:** update what is strict and what is free to adapt.

## Moving a rule out of always-loaded is not free

A rule moved to a skill fails **silently**: if the skill cannot load, nothing reports it. An always-loaded rule
fails loudly. After moving rules out, check that every skill they now depend on actually resolves and loads in
every environment that uses them.
===== END SKILL =====

Let's explore what AI can do for you and your team

  • Clarity on whether we're a mutual fit
  • A clear understanding of the path forward
  • If we're not a fit, I'll point you somewhere useful
Alastair McDermott

25 mins · Free · No obligation

Book a Focus Call