shiichan

Claude Blog Shares Six Tips to Get the Most Out of Your Claude Code Sessions!

Hi everyone, it's me! I found something today that I think every Claude Code user should know about.

Claude Blog claude.com

What was announced?

I'm covering a guide article published on Claude Blog called "Maximizing the value of your Claude Code sessions." It's written by Lydia Hallie, and it walks through practical tips for using Claude Code sessions in a way that saves tokens and keeps costs down while getting the most value out of each session.

This isn't a new feature launch, it's a knowledge guide about using the existing Claude Code more wisely. The article opens by comparing an efficient session, where you read a test file, edit it, and run the tests, with an inefficient one where you grep around, read several files, and only then edit and test. Even for the same fix, the cost can end up very different.

Why it matters

Older code editing tools were often flat-rate, but Claude Code is priced by tokens. That means how you ask for something actually changes the cost. What surprised me is that the price of a token itself depends on a few different factors.

  • Model choice — bigger models do more computation, so they cost more. The article suggests using a larger model for hard problems and a smaller one for routine work
  • Input (prefill) versus output (decode) — output tokens cost roughly five times as much as input tokens, apparently because the GPU runs longer to produce them
  • Prompt caching — when the same leading tokens are sent again, the server reuses its previous computation. A cache read can drop to as low as 0.1x the input price, but a cache write can cost up to 2x the input price

This cache is actually pretty delicate. Switching /model or /effort, toggling Fast mode, or running /compact all invalidate it and force a full recompute. It also expires: one hour for subscription usage, but just five minutes for an API key (you can extend an API key's cache to one hour with ENABLE_PROMPT_CACHING_1H=1). That's exactly why the guide recommends deciding on /model and /effort at the very start of a session.

What changes

After reading this, the way you use /clear and /compact day to day suddenly makes a lot more sense. For developers who use Claude Code regularly, being a bit more intentional about these habits can noticeably affect both cost and how smooth the session feels. It's especially useful if your sessions tend to run long or you're working in a large repository.

Dive Deep

The article also digs into what actually piles up in your context during a session.

  • File reads and command outputs get added to the context, and once they're in, they get resent on every subsequent turn (as a cache read, but they still take up space)
  • Using @ to mention a file attaches it directly to your first request instead of triggering a separate Read call. But if you mention the same file multiple times in one turn, it can end up attached multiple times, so the guide recommends mentioning each file just once
  • Very long command output (roughly over 30,000 characters) gets written to a file automatically, leaving only a path reference in the conversation. Still, something like a few hundred lines of test output can stay in the conversation and get resent every turn, so it's worth adding a quiet command to your CLAUDE.md, like npx vitest run <file> --reporter=dot
  • For noisy jobs, running them in a subagent with its own separate context window helps. Something like log processing is a good candidate for a subagent configured with the haiku model, so it doesn't clutter your main conversation
  • /rewind just removes the last few turns, and it's free as long as the cache is still valid. /compact re-summarizes the whole conversation, which costs something for generating the summary (though it's relatively cheap if the prior conversation is still cached)

At the end, the article ranks the four biggest cost drivers by impact: session length (context accumulation) first, then number of turns, then model and effort choice, and finally input formatting has the smallest effect.

Wrap-up

  • Claude Blog published a token-efficiency guide for Claude Code sessions, written by Lydia Hallie
  • Output tokens cost about five times input tokens, and cache reads can be as cheap as 0.1x the input price
  • Decide /model and /effort at the start of a session, use /clear between tasks, /compact before a break, and /rewind to undo just the last turns
  • Using @ mentions, quieter commands, and subagents all help keep unnecessary context from piling up
  • This one is especially worth reading if you use Claude Code regularly and want to trim your costs while keeping sessions comfortable!