---
topic: claude-code-lighter-and-faster
title: How to make Claude Code lighter and faster (context, cache, subagents, tools)
description: What really cuts usage and context in Claude Code: measuring with /usage, CLAUDE.md, MCP versus CLI, trimming tool output, subagents, plugins and the cache.
aliases: [optimisation, slimming down, context, tokens, limits, usage, cache, prompt cache, subagents, plugins, MCP, CLI, CLAUDE.md, harness, /usage, /context, compact instructions]
domain: ai
created: 2026-11-18
license: CC BY 4.0, Jakub Dudek
address: https://stacks.jakubdudek.com/claude-code-lighter-and-faster
---

## Conclusions

Measure first: on a subscription plan `/usage` shows what share of usage goes to skills, subagents, plugins and each MCP server [c1]. Optimising without it is guesswork.

The largest cost is usually the Claude Code harness itself, not the task. In the TokenSave measurement on a simple task the subagent was the most expensive route: +578% input tokens [c2]. Installed plugins cost tokens even when none was used [c3]. A subagent pays off on a large, noisy task, not on a small one.

Standing context: Anthropic's documentation recommends a CLAUDE.md under 200 lines [c4] and CLI tools (gh, aws) over MCP servers, because a CLI adds no tool listing [c5]. Long tool results are better trimmed by a hook that returns only the errors than read as whole logs [c6].

Cache: after a pause longer than the cache lifetime, the first message reprocesses the whole context [c7]. Compaction can be steered with a `# Compact instructions` section in CLAUDE.md, which says what to keep [c8].

## Claims

### c1. On a plan, /usage shows the share of usage that goes to skills, subagents, plugins and MCP servers.
- source: https://code.claude.com/docs/en/costs · T1
- quote: recent usage attributed to skills, subagents, plugins, and individual MCP servers, each shown as a percentage of the total.
- checked: 2026-11-18
- valid until: 2026-12-18

### c2. A subagent is the most expensive way to do a small task: +578% input tokens.
- source: https://doi.org/10.5281/zenodo.23465633 · T2
- quote: A subagent is the most expensive way to do a small task: 534,125 input tokens (+578%)
- checked: 2026-11-18
- valid until: 2026-12-18

### c3. Installed plugins cost tokens even when they are not used.
- source: https://doi.org/10.5281/zenodo.23465633 · T2
- quote: Installed plugins cost tokens even when unused.
- checked: 2026-11-18
- valid until: 2026-12-18

### c4. Anthropic recommends keeping CLAUDE.md under 200 lines.
- source: https://code.claude.com/docs/en/costs · T1
- quote: Aim to keep CLAUDE.md under 200 lines by including only essentials
- checked: 2026-11-18
- valid until: 2026-12-18

### c5. CLI tools are more context-efficient than MCP servers.
- source: https://code.claude.com/docs/en/costs · T1
- quote: are still more context-efficient than MCP servers because they don’t add any per-tool listing.
- checked: 2026-11-18
- valid until: 2026-12-18

### c6. A hook can cut a long log down to its errors alone, from tens of thousands of tokens to hundreds.
- source: https://code.claude.com/docs/en/costs · T1
- quote: Instead of Claude reading a 10,000-line log file to find errors, a hook can grep for `ERROR` and return only matching lines, reducing context from tens of thousands of tokens to hundreds.
- checked: 2026-11-18
- valid until: 2026-12-18

### c7. The first message after a pause longer than the cache lifetime reprocesses the whole context.
- source: https://code.claude.com/docs/en/costs · T1
- quote: misses the cache and reprocesses your full context
- checked: 2026-11-18
- valid until: 2026-12-18

### c8. A Compact instructions section in CLAUDE.md tells compaction what to keep.
- source: https://code.claude.com/docs/en/costs · T1
- quote: When you are using compact, please focus on test output and code changes
- checked: 2026-11-18
- valid until: 2026-12-18

## History
