Maximizing the value of your Claude Code sessions
-
Token Pricing & Cost Mechanics:
- Cost is driven by inference time across model size, token direction, and prompt caching.
- Output (decode) tokens cost roughly 5x more than input (prefill) tokens because they require sequential step-by-step generation.
- Prompt cache hits cost only 0.1x of standard input pricing, while writing to the cache costs up to 2x (billed once per token).
-
Protecting the Prompt Cache:
- Changing models (
/model), effort levels (/effort), or switching on fast mode mid-session invalidates cache prefixes and forces a full re-prefill at normal prices. - Prompt caches expire after 1 hour on subscription plans (5 minutes by default on API keys unless
ENABLE_PROMPT_CACHING_1H=1is set); running/compactbefore stepping away is much cheaper while the old context is still warm. - Use
/rewindinstead of/compactto drop recent failed turns without discarding prior cached tokens.
- Changing models (
-
Controlling Context Growth & Tool Bloat:
- Direct File References: Use
@-mentions(e.g.,@utils.ts) on first reference to attach files immediately and avoid separateReadtool calls or search greps. - Silencing Command Output: Append quiet flags to frequently run commands (e.g., test runners) or configure them directly in
CLAUDE.mdto prevent terminal spam from lingering in the context for all subsequent turns. - Subagents & Modular Sessions: Offload verbose, one-off tasks (like parsing large logs) to isolated subagents, run
/contextto remove unnecessary MCP tools, and execute/clearbetween distinct development tasks.
- Direct File References: Use
Hacker News Discussion
-
Handoff Skills and Document-Driven Development:
- Commenters highlight custom skills like
/handoffand structured Markdown-based plans as superior alternatives to native/compact. - Dumping state, architectural decisions, and checklists into committed project files enables clean session restarts, seamless switching between AI models, and durable project memory.
- Commenters highlight custom skills like
-
Fatigue Over "Token Accounting" & Prompt Engineering:
- Users express frustration over having to micro-manage cache lifespans, command flags, and session lengths, feeling that agent harnesses should handle cost and memory optimization automatically.
- Short cache TTLs are noted as punishing workflows where developers step away while the agent computes.
-
Tooling Bugs & UI Friction:
- Community members discuss issues with file
@-mentionsmalfunctioning in the desktop app versus the CLI. - Frustrations are voiced over GitHub repository issue bots auto-closing legitimate bug reports as stale.
- Community members discuss issues with file








and one more:

