Claude Code Context Diet
Optimizes Claude Code session context by compressing tool outputs through deduplication, stripping, and truncation.
Combat token bloat and context degradation in Claude Code sessions with this essential hook. Claude Code's 1M-context window often degrades past 200K tokens, and tool results can rapidly inflate token usage, leading to slower, dumber sessions and faster rate-limit exhaustion. This package addresses these issues by applying three deterministic transformations to tool outputs—Dedupe, Strip, and Truncate—before they re-enter your context. This proactive approach significantly reduces token consumption, extending the useful life of your sessions without involving LLM calls or external telemetry, providing a crucial workaround for persistent context management challenges.