A free, independent skill for Claude Code

Smart PreCompact Handles everything around /compact for you

Suddenly you're at 98% context, and every message burns usage. Compact fixes that, but it's easy to forget, and its summary doesn't know what matters to you. Smart PreCompact reminds you in time, tells the summary what it must keep, and brings it back right after.

Free. About a minute to install, one command to remove. Never writes into your project unless you ask.

What matters is kept. The routine gets compressed.

01 / the loop

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. 1

    Context grows

    You work as usual.

  2. hook2

    Reminder at 60%

    Claude answers you first, then reminds you.

  3. 3

    Smart PreCompact prepares the handoff

    A ready /compact line, plus a small handoff file on the side.

  4. you4

    You send the line

    Copy the ready line and send it. That's the only manual step.

  5. hook5

    Context comes back

    Right after the compact, even if it ran by itself.

  6. 6

    Keep working

    Same spot, same decisions.

And again, every time the context fills up

It doesn't replace /compact or change how you work. 60% and 80% are Smart PreCompact's thresholds, and you can change them.

02 / the problem

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:

1. You forget

You don't notice, and suddenly the context is at 98%. Then compact runs on its own, without any instructions from you.

2. The summary misses things

What you already tried, why you decided, what you asked for. After the compact, Claude repeats the same mistakes.

After a regular compact /compact
Conversation summarized
Continue where we left off
Sure. Let's try the first approach again.
With Smart PreCompact /compact
Conversation summarized, context restored
Continue where we left off
Picking up from the same spot. We already ruled out the first approach, and I'm leaving alone what you asked me not to touch.
03 / carried forward

What Claude remembers after the compact.

For every detail in the conversation, Smart PreCompact asks one question: if this disappears, what breaks later?

The handoff Smart PreCompact saves and brings back after the compact
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.
Plus a /compact line that tells Claude Code's summary what it must keep.
04 / install

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.
About a minute to install. With the hook, it reminds and prepares on its own, and you just send the line.
  1. Checksthat you have Python, for the hook
  2. Installsthe skill on your computer
  3. Runs a testand tells you everything passed
  4. 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.

05 / faq

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-precompact

Prepares the lines to paste. Nothing is written to disk.

/smart-precompact handoff

Also saves the handoff to a file, so you can continue tomorrow in a new conversation.

/smart-precompact save

Adds decisions and tasks to the docs files that already exist in your project.

/smart-precompact save notes

Like 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