tamaratran/fast-jev-compaction on GitHub
- Stars
- 6,640
- Forks
- 388
- Language
- TypeScript
- License
- MIT
- Last push
- 18 Sep 2026
Read from GitHub on . Counts change daily.
Claude Code and similar agents compact long conversations by asking a language model to summarize old turns, which is lossy: a file path, an exact error message or a constraint can drop out of the summary. fast-jev-compaction replaces that summary step with Jev decisions about each tool call and result. Nothing gets rewritten. It only removes tool calls, or cuts their results down to the first 300 characters, when Jev judges them no longer needed. User and assistant text stays verbatim and in order.
Each tool_use is paired with its tool_result, and calls in the first message or the most recent messages are pinned. Jev sees the whole conversation so far, with tool results replaced by short notes. For every other call it gets two noul (yes or no) questions: should the call stay, and should the result stay verbatim. Above the keep threshold (0.5 by default) the result stays; if only the call passes, the result is truncated; otherwise both go. To keep that state under Jev’s 32k request limit, the library shrinks it in stages, truncating tool inputs first and folding old messages last, and splits the questions across concurrent requests. If the state still does not fit, compaction throws.
It ships as an npm library and as a Claude Code plugin built on function hooks, an early-access feature. The plugin falls back to Claude Code’s built-in summary when Jev fails or cannot remove enough.
How it uses Jev
import type { JevAnswer, JevQuestions, JevResponse, JevState } from './types.js';
export const SYSTEM_ONE_URL = 'https://api.typesafe.ai/v1/systemone';
export const DEFAULT_MODEL = 'jev-latest';
export interface JevRequest {
url: string;
method: 'POST';
headers: Record<string, string>;
body: string;
}
/** The HTTP request for one Jev call, for any fetch-like transport. */

