Maximizing the value of your Claude Code sessions

204 points - yesterday at 4:15 PM

Source

Comments

superasn yesterday at 9:32 PM
Recently I came across the /handoff skill, which I've been using a lot. I find it much better than /compact.

Basically:

- /handoff file creates a short document with the important context from your current session and maybe next steps as checklist.

- You can then start a fresh session with /continue file

- You can also hand the work from Claude to ChatGPT, or the other way around. Very useful at time of session limits.

- Plus your handoff files becomes a useful piece of project memory that you can reference later.

I find this much more useful than /compact or /clear because the context is saved in something portable instead of being tied to one session and i've seen better results doing this every 20 messages or so than running long sessions.

rhaksw yesterday at 6:45 PM
> @-mention files instead of naming them

Love Claude, but the @ mention is broken in the desktop app. For the same project if I type the same query "@ephem" I get:

CLI: https://imgur.com/a/VZMUCOa (good, relevant results)

Desktop: https://imgur.com/a/QLSo4Ms (bad, irrelevant)

Opened issue for this and it was automatically closed:

https://github.com/anthropics/claude-code/issues/71421

I could have written the issue better (using CLI as comparison instead of VS Code). But, no doubt in my mind Claude could fix this itself in a minute.

Glyptodon yesterday at 6:47 PM
What I see is that I have to read a bunch of stuff and go through a bunch of hassle to save money when the root of it is that if I tell an AI to do work on a task while I'm busy with something else and come back later I've doubled my cost because the cache expires too quickly?
jnwatson yesterday at 5:55 PM
Can anyone explain why the prefix cache is tied to effort?

I frequently run Fable at xhigh effort to run statistical modeling way above my undergraduate understanding. Claude Fable produces Masters-degree level output, and then I spend lots of round trips asking it to explain different parts to me.

The first part absolutely uses the extra effort, but the interrogation exercise is something a much simpler model, or the same model with much less effort, could answer.

BeetleB yesterday at 6:55 PM
> @-mention files instead of naming them. The file gets attached to your message directly, which saves a Read call, or a search if Claude has to go find it.

I've heard it argued that this is an antipattern. If the file is large, it will read the whole file. With Read or something similar, it can do a targeted search and read only the relevant portion.

Is this still not the case?

Also, since they mention /context: Can anyone explain why /context takes so long to run? It usually takes several seconds, and I've had cases of it taking over a minute.

And why don't they just show the basics in a status line somewhere? Just a plain: "120K/200K tokens" I hate having to type /context just to get this. And I shouldn't need to install an extension.

nathanyz yesterday at 6:20 PM
This feels like the Anthropic version of "You're holding it wrong" (1)

1) https://www.wired.com/2010/06/iphone-4-holding-it-wrong/

zmmmmm today at 12:59 AM
What I want is a version of `/clear` that keeps the conversation but drops out things like bloated logs, error traces, etc that were only relevant in the immediate local context.

I guess compacting somewhat does that but I want something more explicitly that trims out these extremely bloated artefacts while maintaining in full the actual conversation history.

apt-apt-apt-apt yesterday at 5:35 PM
I'm finding that unexpected cache rewrites cost me huge.

I have 1h cache TTL set, and do nothing to cause rewrite (response in time, no model/effort/tool changes).

At 400K tokens in, I'll write a message, and /usage shows only a small increase in cache write. On the next message, cache writes shows 800K, and by the end, I often hit 2M cache writes with no explanation.

This seems to happen when: using /btw, asking it to review code, other random times. Anyone know what's going on?

lovasoa today at 6:47 AM
I don't understand why changing effort levels busts the cache. Couldn't effort levels be a decoding-only thing where they just change the probability of the <end of thought> token? Are they literally adding a hidden system prompt that says "effort level: $level" ?
fwlr today at 4:33 AM

    Until pretty recently, the tools you wrote code with were a flat fee (or free) … [so] an individual task didn't really have a price of its own … [but] with agentic coding tools like Claude Code, it does.
I’ve heard this anti-AI thesis before, but it’s certainly novel to read it on ā€œclaude.comā€.
NoDodgeQuestion yesterday at 5:53 PM
Bro: superintelligent machine line go up AI AGI software solved automate everything

Also bro: Run /clearbetween tasks. This prevents prior irrelevant context from being sent back to the model, which can reduce token usage. Set your model and effort level before you start. Changing either one mid-conversation can bust your prompt cache, which can increase token cost. @-mention files instead of naming them. The file gets attached to your message directly, which saves a Read call, or a search if Claude has to go find it. Add quiet flags to noisy commands, or run them in a subagent. Command output is added to the conversation just like a file, and stays there for the rest of the session. Run /context once in a fresh session. It shows what's loaded (CLAUDE.md, MCP tool definitions), so you can cut out anything unnecessary. /compact before you take a break from your keyboard. The prompt cache expires after an hour, and summarizing a conversation is much cheaper while it's still cached.

mccoyb yesterday at 5:44 PM
I mean, it feels hard not to laugh at this type of blog post. My cynical interpretation is that this is a type of passing the buck to engineers in enterprise settings ("Stop spending tokens. Did you read the value maximization blog post? It is your fault.")

Oh yes, Claude will do all sorts of different things -- it depends on how you use it! You should totally learn all of these little finicky things ... because now completing your tasks cost money. It's not "free" anymore haha like when you used your old text editor, what are you a grandpa?

Oh, and those things will definitely change, as we (the priests of Claude) are vibe coding the system you use to do your little "tasks" ... right, you can't see how it works ... the code is not available. It's all good, just trust us -- we're totally looking out for you.

I mean it is utterly ridiculous to talk around this model of development. There are so many walls between you and doing the thing you want to do.

Agents are great, but the notion of "best tricks" for how to best use an opaque costful tool which will, by all odds, be completely different in a few months time is quite funny.

You know what won't change? A fucking text editor. Or your pi config, or a local model you run and trust.

myshapeprotocol today at 5:52 AM
Great practical insights on streamlining AI coding sessions. Maximizing workflow efficiency like this is essential for modern development.
ahurmazda yesterday at 7:04 PM
What’s the point of running /clear vs starting a brand new session. At least with the latter I have session history, no? Pardon my ignorance since Claude isn’t my primary driver
olsondv yesterday at 5:25 PM
After having used Codex for a promotional month, and now using Claude, Claude is not as efficient with finding relevant information. I can give it the one file it should be using and then it goes off and greps parent directories for more context. It’s also incredibly slow at producing results because of this side work. In this article, it seems like they are catching up to what GitHub copilot users had already been doing since the cost restructuring in June.
docheinestages today at 12:01 AM
Anthropic should build a harness (and model) that smartly takes care of all these points. Not requiring the user to do the manual work. All I see are excuses because they cannot handle the load and enforce strict quotas on users, all while OpenAI constantly resets their quotas.

With Qwen 3.8 27B, we're one step closer to on-device LLMs that can replace subscriptions.

wjakob yesterday at 10:51 PM
When rewinding to an earlier turn, what if that turn is more than 1hr old? Can this cause KV-cache misses compared to continuing the conversation?
8note yesterday at 11:49 PM
how many times it stays there i think doesnt give the best comparison

if youre working on the same codebase, that cache stays quite relevant, and i dont think they make the case that clearing and reading the same couple files over and over again is cheaper that relying on it already being cached. same with doing some of the same teaching claude the right way to approach changes in that codebase again and again.

what would be nice is pulling back and reusing an earlier part of the cache for the later two tasks, but claude code doesnt make that particularly easy, and using an LLM to pick where to go back to isnt really gonna save much when it reads all the same text again.

pzo yesterday at 7:48 PM
> Set your model and effort level before you start. Changing either one mid-conversation can bust your prompt cache, which can increase token cost.

I know we supposed to do this but is there any particular reason why such things cannot be supported? I thought its running on same model just different settings like reasoning. This would be super useful.

swingboy today at 2:19 AM
How about Anthropic just be more generous with their usage limits instead?
aleksiy123 yesterday at 6:53 PM
Is it possible to have some kind of script to keep your cache warm, or auto compact or something.

I sometimes just leave some goals or something running before I go to bed or out and I don’t want to pay the cache text when I come back.

dpkirchner today at 1:07 AM
TIL the prompt cache lasts 1 hour. I thought it was reduced to 5 minutes.
tolugenius yesterday at 5:43 PM
Part of the cynic in me just wants to ask "why not make a better harness by default?" The other cynic in me knows I'm about to see a hundred post on 'HOW TO 10X CLAUDE" from the ai bros and I'm already tired.

I guess if I had to ask something (as someone who doesn't use CC as their daily driver), how much control do you have on subagents and roughly how do define or know when a session is getting too long? I know the answer is "when the model is getting worse" but worse is doing a lot of lifting in that sentence.

Shorn yesterday at 11:46 PM
No RSS feed for their blog.
bytestrix yesterday at 6:22 PM
do people use the Caveman, RTK plugins
PeterStuer yesterday at 6:11 PM
I do all that, but an 'AS-BUILT' full review of my project still eats 3x my 5 hour budget on max 100€. Meanwhile, my 20€ GPT never hit a limit. Different, but just saying.
andai yesterday at 8:01 PM
Austerity on tap!
dude250711 yesterday at 10:20 PM
"TL;DR ..."

If only they had some kind of technology that could make a judgement and automate those actions...

apercu yesterday at 7:18 PM
I didn't read the whole thing, but I got my back up at the headline and my first reaction is now even the "AI" companies are telling you that "you're holding it wrong".

I mean, they told us "just talk naturally to the AI because it's so much smarter than all you meatbags" and now it's ā€œfor best results, please learn to manage context windows, prompt caching, cache invalidation, model switching, output verbosity and when to manually clear or compact your session.ā€

I get it, but it seems like the "PRODUCT" should be doing this shit. I.e., the PRODUCT is getting less efficient because I didn't manually manage its context correctly and now it's MY fault.

Edit: i.e., for e.g. Doh. Even the robots get that right. Sigh.

NamlchakKhandro today at 3:57 AM
meah Claude is peak trash. Really fucking upset that they ban you for using a superior harness
pitiflautico today at 7:29 AM
[flagged]
tizerluo today at 6:36 AM
[flagged]
dmzxnico today at 6:09 AM
[flagged]
wongallen010 today at 4:12 AM
[flagged]
query_ilands yesterday at 9:09 PM
[flagged]