
kunchenguid/compact-adviser on GitHub
- Stars
- 183
- Forks
- 18
- Language
- TypeScript
- License
- MIT
- Last push
- 23 Sep 2026
Post on X
- Views
- 47,105
- Likes
- 653
- Reposts
- 42
Read from GitHub and X on . Counts change daily.
Reported by the author
- Eval set
- 40 sessions
i built a private eval set from 40 real sessions and manually labeled all the safe vs unsafe checkpoints
x.com - Hint floor (empty)
- 0.90
The hint floor is 0.90 while the context is mostly empty
github.com
Compact-adviser answers one question for Claude Code and pi users: is this the moment to run /compact, the command that shrinks a session’s context to save tokens? Kun Chen built it because the real answer depends on whether the agent’s next action will need the details currently sitting in context, which is hard to judge from outside the conversation.
The plugin sends Jev two one-sentence questions per check, composed in code into a single score: is the current unit of work finished, and is this hands-on work or coordination. To build it, Chen collected 40 real sessions, manually labeled the safe and unsafe checkpoints in each, and hill-climbed the Jev prompt against that set. The confidence bar for a hint moves as the context fills: it starts at 0.90 while the window is mostly empty, since a wrong hint costs the most when there’s still room to keep working, and relaxes toward 0.50 as the window approaches the point where the host would compact anyway.
It ships two modes. Hint mode just tells the user it’s a good time to compact; automatic mode, opt-in on Claude Code and pi, runs /compact itself once Jev says it’s safe, after a first-use confirmation. Codex CLI and Grok support hint mode only, since nothing outside their sessions can trigger the command.
How it uses Jev
import type { JudgeProfile } from "./profile.ts";
export const ENDPOINT = "https://api.typesafe.ai/v1/systemone";
export const MAX_REQUEST_BYTES = 32000;
export const MAX_RESPONSE_BYTES = 32768;
export const TIMEOUT_MS = 2000;
/**
* Two atomic questions in one request, composed in code.
*
* `done` asks whether the assistant's own latest unit of work is finished;
* `shape` asks whether this conversation is hands-on work or coordination.
* Neither asks Jev to reason two steps at once, which is the shape TypeSafe's
* guide recommends and the one that measured best: hill-climbed from these
* one-sentence seeds against the judgment-eval set, no added clause earned itsView in packages/claude-mod/lib/judge.ts


