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.
I've been doing this since I started agentic development, and have a whole framework based on this; Simply put I define workflow s that output templated files for everytype of tasks that happens in development.
It's a powerful pattern I'd recommend everyone.
It might be even better if the harness were to automatically write a handoff note under some circumstances? If the user is away and the cache is going to expire, that would be a good time to do it.
I've been asking Claude to remember important points from our session, or future tasks. Then /clear and continue.
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.
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.
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.
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.
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?
1. My agent writes code.
2. Then it creates tests and verifies that all of them actually work, not just pass. To do this, my agent writes the test, then it deletes the code it covers, reruns the test, confirms it goes red, and finally puts the code back.
3. I receive the ready-to-test code and environment setup.
4. I check that the business logic works as I expected it to be on a working product. Here we usually do several iterations of coding and bug fixing.
5. When the manual part is finished, the agent starts an external review using /code review skill. At that stage, it makes some additional fixes and corrections to the tests.
6. Finally, a branch is ready to be merged. We start CI/CD and wait until the run finishes successfully.
That's what I actually use because it generally works.
Note about only docs PRs: I just ask the agent to make the changes, then it runs the / code review skill, and then we merge the branch into main without CI running.
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.
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.
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.
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”.Would be nice if it was easier to separate output that needs to live in context and stuff I just want to look at.
One thing I wasn’t aware of was the negative impact of switching models
With Qwen 3.8 27B, we're one step closer to on-device LLMs that can replace subscriptions.
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.
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.
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.
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.
- review system prompt + cut it down or remove completely
- review agents.md file(s), check which ones are loaded, remove or improve them
- review context spam from tools, skills etc, de-activate all, see what needs re-adding
- review past sessions to see where tokens get wasted
more advanced: - keep sessions short (be conscious about compaction)
- form a habit of starting new sessions
- deliberately practice how to effectively get the right context into a new session (vs hanging on to a 'good' session)
- you can ask the agent to write the essential context into a .md file and have the new session read that
- learn about forking sessions
- experiment with starting sessions from a custom-built history/context
a good agents.md file can be small and still effective re helping the agent navigate the code basethat said: you will surprised by how well current models can navigate (way better than last year!)
If only they had some kind of technology that could make a judgement and automate those actions...