token-optimize

Audit Claude Code token consumption across context sources and MCP servers.

Updated Mar 1, 2026
One-click install
npx skills add https://github.com/haingt-dev/agent --skill token-optimize
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: token-optimize
Source: https://github.com/haingt-dev/agent/tree/main/global/skills/token-optimize
Command: npx skills add https://github.com/haingt-dev/agent --skill token-optimize

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Audit Claude Code token consumption across project and global context. Measures all context sources, benchmarks against official limits, detects duplication and waste patterns, produces actionable recommendations with quantified savings. Use this skill whenever the user mentions token costs, context size, wants to optimize their Claude Code setup, or complains about expensive sessions. Triggers: "token optimize", "audit tokens", "context audit", "optimize context", "reduce tokens", "token usage".

Core Features & Use Cases

  • Identify where tokens are spent across CLAUDE.md, memory, skill descriptions, and MCP definitions.
  • quantify duplication, waste, and opportunities to simplify context without losing meaning.
  • Generate a concrete, prioritized plan with estimated token savings and a snapshot artifact.

Quick Start

Run a token audit on the current workspace to generate a token-audit.json snapshot.

Frequently Asked Questions about token-optimize

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I audit Claude Code token consumption across my project context?

Token optimization in Claude Code analyzes all always-on context sources including CLAUDE.md, memory, and MCP servers to identify token waste and generate prioritized recommendations for reducing context size without losing meaning.

What context sources are analyzed during a Claude Code token audit?

A Claude Code token audit analyzes all always-on context sources including CLAUDE.md, memory files, skill descriptions, and MCP server definitions to quantify duplication and waste patterns across baseline versus runtime.

How do I reduce token costs and optimize context size in Claude Code?

To reduce token costs and optimize context size, this skill benchmarks context against official limits, detects duplication, and outputs a prioritized plan with estimated savings and a token-audit.json snapshot artifact.

What output artifact does a Claude Code context audit generate?

A Claude Code context audit outputs a token-audit.json snapshot artifact alongside a contextual breakdown and prioritized recommendations quantifying token savings across baseline versus runtime.

Why are my Claude Code sessions so expensive and how can I find token waste?

Expensive Claude Code sessions are often caused by duplicated or bloated context in CLAUDE.md, memory, and MCP definitions; this skill audits those sources to detect waste patterns and quantify actionable token savings.

Does this context audit work with MCP servers and memory-bank files?

Yes, this context audit works with MCP servers and memory-bank files by measuring their token consumption alongside CLAUDE.md and skill descriptions to benchmark usage and detect duplication against official limits.