Type: url

Original: https://baoyu.io/blog/2026-04-06/claude-code-token-optimization

Status: generated

Summary

A practitioner guide, in Chinese, arguing that the common habit of frequently running /clear or starting a new Claude Code session is usually counterproductive once prompt caching is understood, because a new session pays full price to rebuild roughly 50,000 tokens of system prompt, tool definitions and project configuration. It explains that caching is prefix-only and time-limited — a one-hour window for the main agent and five minutes for subagents, with cache reads costing about a tenth of recomputation — and offers a decision table for continuing versus restarting a session. It further cautions against the 1M context window, whose cache misses are proportionally far more expensive, and gives six operational rules covering model choice, CLAUDE.md size, CLI-over-MCP, planning, and permissions.deny.

Generated pages