My Claude Code Sessions Now Hand Off and Compact While I’m Away
I stepped away for lunch expecting the session to move on without me.
It hadn’t moved an inch.
The Context Alert dialog was sitting on the screen, asking whether to write a handoff doc. Claude had been waiting on that one click the whole time I was gone. (Like a dog by the front door, staring at the handle.)

One click. That’s all it needed.
In I Kept Forgetting to Check My Context. Now Claude Code Reminds Me., I handed the watching over to a mod. It tapped me on the shoulder at my threshold and offered to write a handoff doc and compact.
Here’s the thing. The watching was the chore. Turns out the clicking was too.
So I gave Context Alert an auto mode that runs the Claude Code auto compact handoff for you. It ships in version 0.3.0, which is still a beta (so treat it like one).
The quick version: Context Alert now has an auto mode. When your session reaches your threshold, it writes the handoff doc, waits for any sub-agents still working in the background, compacts, and tells Claude to carry on. You don’t click a thing. One command turns it on.
Already using Context Alert? Run
/plugin marketplace update nathanonn-agent-skills, then/reload-plugins, to get auto mode.
.
.
.
Watch it run
The first time I let it run, I sat there with my hands hovering over the keyboard, ready to jump in the moment it did something odd. I never had to touch it.
Here’s a Claude Code auto compact handoff from start to finish.

If you’d rather skim, here’s the whole loop on one page.

So what actually happened in there?
When the session crosses your threshold, the mod lets Claude finish its reply first. It never cuts in halfway through a sentence. (Good manners.)
Then Context Alert sends the handoff prompt into the chat for you. Every prompt after the threshold came from the mod. I didn’t type a single one.
Claude writes the handoff doc without asking a thing. If it doesn’t know about a doc yet, it picks a sensible spot in the project and tells you which file it wrote.
If a sub-agent is still working in the background, the mod waits for it (more on that in a second). After that it sends the compact command, followed by a short message telling Claude to pick up where it left off. Claude opens the handoff doc and carries on.
In my real run, the compaction freed about 282k tokens and dropped the session back to 8%, which is 77k of a 1M window.
After the continue message, Claude keeps working through any tasks still pending. The session never grinds to a sudden halt, and I don’t have to nudge it to continue. It stops only when there’s nothing left to do or the next step needs my approval.
.
.
.
It waited for the sub-agent
This is the part that sold me.
I’ve been burned before. A compaction once ran while a sub-agent was still out working, and its results never made it into the next session, so I had to run the whole check again.

When my session hit its threshold, a sub-agent was still working in the background, running a long check alongside the main session.
Claude wrote the handoff doc anyway and noted that the sub-agent hadn’t reported back yet.
And here’s the kicker. Context Alert held the lift door. (The polite kind, arm out, waiting for the stragglers.) It kept the compaction on hold until the sub-agent made it in.
Once the sub-agent reported back, Claude reopened the same handoff doc and added its results.
Only then did the compaction run.
👉 The doc Claude carried into the lighter session had everything in it, the sub-agent’s work included.
That’s what made me trust auto mode with a real session.
.
.
.
Turn it on
New here? Install it first, and choose user scope when it asks, so it works in every project.
/plugin marketplace add nathanonn/agent-skills
/plugin install context-alert@nathanonn-agent-skills
/reload-plugins
Already installed? Grab the update instead.
/plugin marketplace update nathanonn-agent-skills
/reload-plugins
Then come my two settings.
/context-alert set mode auto
/context-alert set tokens 320000
The first line switches auto mode on, and on its own it’s enough. Leave the threshold alone and auto mode kicks in at the default 40%.
The second line is my own preference. A fixed token count is the same amount of conversation on any window size, so I set mine at 320k.
.
.
.
The brakes
Handing over the controls can feel a bit nervy. (Remember those hovering hands?) A few things keep it in check.
- Type anything to cancel. A message you send while Claude is writing the doc, or while the mod is waiting, stops the run before it compacts. The doc may still get saved, which does no harm.
- It waits for sub-agents still working in the background, as you saw above.
- Need a quiet session?
/context-alert pauseswitches alerts and auto runs off for the current session, and/context-alert resumebrings them back.
It won’t loop forever, either. If something looks off, it goes back to asking you.
.
.
.
What I get from auto mode
Most days, I leave auto mode on and let the Claude Code auto compact handoff take care of itself. Here’s what it gives me.
- Work keeps moving. Long sessions carry on while I’m away from the desk, and nothing sits waiting on a click I forgot to make.
- Usage stays light. The context resets before each turn grows heavy and expensive. Each compaction keeps my sessions lean, so my usage stays predictable even on a long working day.
- Nothing gets lost. The plan, the decisions, the next steps and every sub-agent’s results all live in the handoff doc, and they survive every compact.
Now when I come back from lunch, the session has either kept going or stopped on a real question from Claude. Nobody’s left waiting by the door.
Turn on auto mode and go have lunch.
Leave a Comment