This is how it runs. In the background.
You work as usual. Smart PreCompact steps in only when needed, and asks you for one action.
- 1
Context grows
You work as usual.
- hook2
Reminder at 60%
Claude answers you first, then reminds you.
- 3
Smart PreCompact prepares the handoff
A ready /compact line, plus a small handoff file on the side.
- you4
You send the line
Copy the ready line and send it. That's the only manual step.
- hook5
Context comes back
Right after the compact, even if it ran by itself.
- 6
Keep working
Same spot, same decisions.
It doesn't replace /compact or change how you work. 60% and 80% are Smart PreCompact's thresholds, and you can change them.
Regular compact. Two problems.
In a long conversation, every message sends the whole conversation to Claude again, and usage burns. Compact summarizes the conversation and frees up space. But:
You don't notice, and suddenly the context is at 98%. Then compact runs on its own, without any instructions from you.
What you already tried, why you decided, what you asked for. After the compact, Claude repeats the same mistakes.
What Claude remembers after the compact.
For every detail in the conversation, Smart PreCompact asks one question: if this disappears, what breaks later?
Continue where we left off. Building: what the project is, and the goal. State: what's done, what's in progress, and what isn't tested yet. Decisions: what was decided, and why. Failed, don't retry: what was already tried, and why it didn't work. Rules set: what you asked for, in your own words. Next up: up to three steps, in order.
Install Smart PreCompact.
One prompt. Paste it into Claude Code, and it does the rest.
Install Smart PreCompact for me. Download the file:
https://jaygptpro.com/smart-precompact/smart-precompact.zipUnzip it to a temporary folder, and follow the instructions in the install-prompt.txt inside it.
- Checksthat you have Python, for the hook
- Installsthe skill on your computer
- Runs a testand tells you everything passed
- Askswhether to turn on the hook
Prefer manual? Download the file, drag the folder into your project, and paste the contents of install-prompt.txt into Claude.
Questions people already asked.
How is this different from regular /compact? +
A regular compact summarizes the whole conversation without knowing what matters most to you. Smart PreCompact tells it what it must keep, saves the handoff to a file, and brings it back into the conversation right after. The compact itself is still Claude Code's own /compact.
What do I do after installing? +
Keep working as usual. When the context passes 60%, Claude answers you, and at the end of the reply adds a ready /compact line. Copy it and send it. That's it.
What's saved on my computer, and for how long? +
One small handoff file per conversation, in ~/.claude/handoffs, outside your project. With the hook, a file nobody touched for 14 days is deleted automatically. No server, and nothing is sent anywhere new. Nothing is written into your project unless you explicitly ask for save.
Keys and passwords that came up in the conversation are replaced with [REDACTED] before anything is written. That's an instruction to Claude, not a filter, so the safest move is not to paste secrets into the chat.
Why 60%? +
Early enough to leave room for a good summary. Claude Code's automatic compact only runs when the context is almost full, and by then it's too late. You can change the threshold in one line.
Can I run it manually? +
Yes, any time. There are four modes:
/smart-precompactPrepares the lines to paste. Nothing is written to disk.
/smart-precompact handoffAlso saves the handoff to a file, so you can continue tomorrow in a new conversation.
/smart-precompact saveAdds decisions and tasks to the docs files that already exist in your project.
/smart-precompact save notesLike save, plus your notes folder set in config.md (Obsidian or similar).
You can also just say it: "prep me for compact".
Do I need the hook? +
No. Without the hook you run it manually. The hook adds the 60% reminder and the automatic context restore.
Doesn't compact burn my usage? +
It costs once. Staying at high context costs on every message, because every message resends the whole conversation. After a compact you're back to a small conversation, and it pays for itself within a message or two.
Two tips: compact right at the end of a stage, not after a long break. And if you're switching to a completely different task, /clear is cheaper.
How do I know it actually works? +
At the end of the install, one check shows you the hook is running and how full your context is. Behind it: 55 automated tests.
Does it work with every model? On Windows? +
Yes, anywhere Claude Code runs. The hook needs Python 3.8 or newer, and the install prompt checks that for you. Tested on Mac. It should work on Windows and Linux, but it hasn't been tested there yet.
Is this an Anthropic product? +
No. It's an independent skill by JayGPTPro, built around Claude Code's /compact, and not affiliated with Anthropic.
Pick up where you left off. Even after a compact.
One prompt, a minute to install, and you stop re-explaining to Claude what you already explained.
Install Smart PreCompact