Learn Claude Code: Cost & Context Mastery MCP Servers, Skills, and Your CLAUDE.md Budget

MCP Servers, Skills, and Your CLAUDE.md Budget

Intermediate 🕐 10 min Lesson 9 of 11
What you'll learn
  • Explain how deferred MCP tool schemas reduce context overhead and when to force full schema loading
  • Move CLAUDE.md workflow instructions to skills so they only load when needed
  • Audit CLAUDE.md size and apply the 200-line rule to keep the startup stack lean

Three Structural Levers You Control

Beyond session commands and model choices, three structural elements of your Claude Code setup determine your base token cost on every session: how MCP servers load their tool schemas, where you put your instructions (CLAUDE.md vs skills), and how long your CLAUDE.md files are. Each one affects every session, not just expensive ones.

MCP Servers: Deferred Is the Default for a Reason

By default, Claude Code uses tool search — only MCP tool names and server instructions enter context at startup. Full tool schemas (which can be hundreds of tokens per tool) stay deferred until Claude needs a specific tool. This is a significant saving when you have many MCP servers configured.

Three modes available:

  • Default (deferred): tool names only at startup. Claude loads specific schemas on demand via tool search. Best for most setups with multiple MCP servers.
  • ENABLE_TOOL_SEARCH=auto: loads all schemas upfront when they fit within 10% of the context window. Useful for small, focused toolsets where you want Claude to see everything immediately.
  • ENABLE_TOOL_SEARCH=false: loads everything upfront regardless of size. Only appropriate for minimal MCP setups where schema size is small.

Check how many MCP servers you have configured with /mcp. Disable any you are not actively using. Every active server contributes to the startup stack even in deferred mode, and its tool calls consume context when invoked.

CLI Tools vs MCP Servers

For tools that have both a CLI and an MCP server available — gh, aws, gcloud, sentry-cli — prefer the CLI in most cases. CLI tools add no per-tool listing overhead at all. Claude runs them as Bash commands, and the output is just the command result. MCP servers always add at minimum the tool name to the startup listing, plus schema on first use.

The MCP server is worth it when it provides structured data or capabilities that the CLI cannot match — not just as an alternative interface to the same CLI.

Skills: On-Demand Context Loading

Skills load their full content only when invoked. The skill listing (one-line descriptions) is present at startup (~450 tokens total regardless of how many skills you have), but the detailed instructions inside each skill are not in context until Claude actually uses one.

This makes skills the right home for detailed workflow instructions that only apply sometimes:

  • PR review checklists
  • Database migration procedures
  • Deployment steps
  • Framework-specific patterns for less-frequent tasks

If this content lives in CLAUDE.md, it costs tokens on every session even when you are not doing that work. In a skill, it costs zero until you invoke it.

The CLAUDE.md 200-Line Rule

Every line in CLAUDE.md costs tokens on every session. The practical ceiling for reliable adherence is around 200 lines — beyond that, instructions buried deep in the file receive less reliable attention as the context window fills over a session. Two practical rules:

  1. Only include what Claude would get wrong without it. Instructions Claude already follows correctly are noise. Instructions about behavior that never comes up in this project are noise. HTML comments (<!-- your note here -->) are stripped before the content enters Claude's context, so you can leave notes for human maintainers without paying tokens for them.
  2. Move reference content to skills or path-scoped rules. Detailed API conventions for src/api/ belong in .claude/rules/api-conventions.md with a paths: [src/api/**] pattern — they load only when Claude reads a file in that directory, not on every session.

Audit your CLAUDE.md every few months. Rules that no longer apply, instructions for patterns that have changed, notes from a project phase that is over — all of these are dead weight paid on every session.

Key takeaways
  • Deferred MCP schemas (the default) keep the startup stack lean — tool names load at startup, full schemas only when used; disable MCP servers you are not actively using to reduce even that overhead.
  • CLI tools (gh, aws, gcloud) have zero listing overhead compared to MCP servers; prefer CLI when both options exist and the capability gap is negligible.
  • Move workflow instructions that only apply sometimes (PR checklists, deployment steps, migration procedures) from CLAUDE.md to skills — they cost zero tokens until invoked.
  • The CLAUDE.md 200-line ceiling is about attention reliability, not just token cost — instructions buried deep in a long file get less reliable attention as the session grows.
  • HTML comments in CLAUDE.md are stripped before entering context — use them for human maintainer notes without paying tokens for them.