compact-adviser
Tells you when your session is at a safe point to compact.
Kun Chen’s plugin for Claude and Pi answers the question people keep asking: when should I compact. Jev judges whether the session is at a task boundary where compaction is safe. He built a private eval set from 40 real sessions with hand-labelled safe and unsafe checkpoints, then tuned the question against it. The classifier favours precision while the context window is small, and shifts towards recall as it fills up.
compact-adviser</h1>
<p align="center">
<a href="LICENSE"
><img
alt="License"
src="https://img.shields.io/badge/license-MIT-green?style=flat-square"
/></a>
<a
href="https://img.shields.io/badge/platform-macOS%20%7C%20Linux-blue?style=flat-square"
><img
alt="Platform"
src="https://img.shields.io/badge/platform-macOS%20%7C%20Linux-blue?style=flat-square"
/></a>
<a href="https://x.com/kunchenguid"
><img
alt="X"
src="https://img.shields.io/badge/X-@kunchenguid-black?style=flat-square"
/></a>
<a href="https://discord.gg/Wsy2NpnZDu"
><img
alt="Discord"
src="https://img.shields.io/discord/1439901831038763092?style=flat-square&label=discord"
/></a>
</p>
**compact-adviser** is an agent plugin that answers a single question: should I /compact now?
It uses [Jev](https://typesafe.ai) to instantly judge whether the current session is likely at a boundary that's safe to compact.
It can give you a hint to run `/compact` - or, on Pi and Claude Code, if you opt in, it can run it for you at the right time automatically. Codex CLI and Grok are hint-only: nothing outside their sessions can trigger `/compact`.
Judgment is two one-sentence Jev questions in one request (is the unit finished; is this hands-on work or coordination), composed in code into one score. The hint floor is 0.90 while the context is mostly empty (through about 10%) and relaxes toward 0.50 by about 90% full - a wrong hint costs most when there is still room. "Full" means the point where the host compacts: on Claude Code that is its auto-compact threshold when enabled, elsewhere the model's window. Automatic mode is the same gate, plus a first-use confirmation.
## Quick Start
Prerequisites: Node 22+ (22.18+ for Codex and Grok), a