AgentContextKit
Updated 2026-12-02 · 5 min read

CLAUDE.md Token Optimization Checklist: Fixing Bloated /init Files

A concrete checklist for trimming auto-generated CLAUDE.md files below 1,500 tokens using @file imports, hard verification gates, and zero fluff.

Running /init inside Claude Code is a convenient starting point, but it frequently produces a 250-line summary filled with obvious directory tours and boilerplate code style advice. Because CLAUDE.md is loaded into context on every session, trimming it down to high-signal directives pays off on every single prompt.

The 7-Point CLAUDE.md Optimization Checklist

  1. 1. Stay Under 150 Lines (<1,500 Tokens): Anything larger dilutes the highest-priority verification rules. Use the CLAUDE.md Auditor to measure your baseline.
  2. 2. Replace Prose Tours with @imports: Move long architecture specs, API schemas, or deployment playbooks out of CLAUDE.md and link them via @docs/architecture.md or @package.json.
  3. 3. Put Exact Test & Typecheck Commands in a Code Block: Include the exact flags Claude should run after editing (for example, npx astro check && npm test rather than "run tests").
  4. 4. Cut Obvious Framework Advice: Claude already knows TypeScript, React, Tailwind, and Python conventions. Only document deviations from standard practice—such as "Use npm instead of pnpm in this workspace."
  5. 5. Delete Generic Platitudes: Audit for phrases like "write clean code", "make sure everything works", and "follow best practices". Every cliché takes context space without adding a pass/fail check.
  6. 6. Add a Dedicated "Watch Out For" Section: Document real footguns you or teammates hit twice (generated files not to edit, required environment prefixes, trailing-slash routing rules).
  7. 7. Scan for Accidental Secrets Before Committing: Never paste sample tokens (sk-..., ghp_..., AKIA...) into CLAUDE.md, even as placeholder examples.

Before vs. After Example

Bloated (35+ lines for zero signal):

Welcome to our Next.js repo! We strive to write clean, modular code and follow industry best practices.
Our src folder contains components, pages, utils, and hooks. Make sure you write tests and check everything thoroughly before committing...

Optimized (14 lines, 100% actionable):

# Billing Web App
Next.js 15 App Router + TypeScript strict + PostgreSQL.

## Commands
```bash
npm run dev
npm test -- --run
npx tsc --noEmit
```

## Watch Out For
- Never edit `src/db/generated/*`; run `npm run db:generate` instead.
- All external webhook payloads must be verified with `verifySignature()`.
@docs/webhook-contract.md