All guides

$ open guides/claude-md-token-rules

FreeClaude CodeCLAUDE.mdTokens

6 lines in CLAUDE.md that stop Claude Code burning your tokens

Most of your usage goes not on code but on the conversation Claude carries with every message. Here is a ready block: copy it, paste it at the end of the file and type /clear.

~5min read

What you'll get

5 sections5 steps2 prompts

Why it works

  • 6 lines

    take almost no room

    and they save on every message that follows

  • under 200

    lines is the CLAUDE.md size the docs advise

    the file is read every session, even when it is not needed

  • 1 hour

    is how long the cache lives on a subscription

    5 minutes on an API key; after a break the full context is reprocessed

01Copy this

The CLAUDE.md block

Paste it at the very end of the file. Nothing else needs to change.

016 lines of context economy

prompt 01
## Context economy

- Search first, then read: find the right spot with search and open only that part, not the whole file.
- Hand wide project exploration, long logs and test output to a subagent. It returns only a short summary to this conversation.
- Show only the changed lines. Print a whole file only when I ask.
- Do not repeat what we already agreed on or what I wrote myself.
- When the task changes or the conversation grows long, suggest /clear or /compact.
- Keep replies short: the result and the next step. Details only on request.

It pays off most in projects with long sessions.

02If your CLAUDE.md already has many rules

This prompt checks that the block does not clash with what you already wrote.

prompt 02
Read our CLAUDE.md. Find rules that conflict with the "Context economy" section or repeat it. Show me the list and suggest edits. Change nothing until I confirm.

02One minute

How to install the block

Five steps, no settings involved.

0/5 done
  1. Open CLAUDE.md

    It sits in the project root. No file yet? Type /init and Claude creates it.

    CLAUDE.md
  2. Paste the block at the end

    Copy the six lines above and save the file.

  3. Type /clear

    The command starts a new session, and CLAUDE.md is read at the start of each one. That is how Claude sees the new rules.

    /clear
  4. Check it

    Ask: "Which context economy rules do you see?" Claude should list all six.

  5. Turn it on everywhere

    Want the rules in every project? Put the block in ~/.claude/CLAUDE.md, your personal file.

03Breakdown

What each line does

Claude Code sends the full conversation with every request, and each tool call is one more request. So anything extra that lands in the conversation gets paid for again and again. These lines keep it out.

  1. 1. Search first

    A thousand-line file opened for one function stays in the conversation until the session ends. Search brings back only the part you need.

  2. 2. Hand exploration to a subagent

    It works in its own separate context. The files and logs it finds stay there, and only the summary reaches your conversation.

  3. 3. Only the changed lines

    You are reviewing an edit, not the whole file. A diff is short, so no extra text settles in the conversation.

  4. 4. No repeating what is settled

    Restating decisions adds nothing to the work, yet it lands in the conversation one more time.

  5. 5. Suggest /clear or /compact

    /clear starts clean when the task is new. /compact condenses the conversation when you carry on with the same work.

  6. 6. Keep replies short

    Long replies cost twice: once to write and again on every later request that carries them.

04Check

How to see the result

Watch the usage

  • /usage shows what you have spent
  • /context shows what is taking up the context now
  • Compare two similar tasks, before the block and after it

Watch the behaviour

  • Claude searches first and opens the file after
  • Large exploration goes to a subagent
  • When the task changes, Claude suggests /clear itself

05

Where the block will not help

  • 01

    CLAUDE.md is context for Claude, not enforced configuration. It tries to follow the rules but may decide one does not apply. For a hard block you need a hook.

  • 02

    A subagent spends tokens too: its requests count toward the same limit. It pays off on large exploration, while a small search is simpler in the conversation itself.

  • 03

    How much you save depends on your project and habits. So compare your own numbers in /usage, not someone else's percentages.

  • 04

    Learning and want explanations? Just ask for detail: the sixth line allows it.

  • 05

    Six lines cost little, a huge CLAUDE.md costs a lot. If the file grows past 200 lines, move rare instructions into skills, which load only when needed.

Sources

  1. 1Claude Code docs: Manage costs effectively
  2. 2Claude Code docs: How Claude remembers your project
  3. 3Claude Code docs: Explore the context window
  4. 4Claude Code docs: Create custom subagents
  5. 5Claude Code docs: Best practices

Go deeper

Claude Code Memory: A Custom Brain for Every Project

Six lines are only the start. In the course we set up Claude Code so it remembers your project between sessions and spends no tokens on repeat explanations.

$44.90 · one payment, lifetime access

More guides on this topic

All guides

Comments