Skip to content

Jev directory

Save Token Jev

A Jev-guided context compaction library for coding agents: instead of summarizing old context, Jev decides which tool calls and results still matter while user and assistant text is kept verbatim.
Stars
81
Language
TypeScript
License
MIT
Reading time
4 min
Published by
Community
Author
IAmUnbounded
Last verified
Sep 2026

About this project

Portable, Jev-guided context compaction for coding agents. Instead of asking another LLM to rewrite old context into a lossy summary, save-token-jev asks Jev which tool calls and results still matter. User and assistant text is kept verbatim. A tool call can be kept with its full result, kept with a bounded result, or removed together with its result. The algorithm is implemented behind a normalized transcript model and host adapters so the same compaction policy works across multiple coding-agent runtimes.

Quoted from the project's README. Read the full README.

Highlights

  • Each tool call is kept with its full result, kept with a bounded result, or removed together with its result; text blocks are never summarized or deleted.
  • Adapters cover Codex CLI, OpenCode V2, Claude Code, the Anthropic API, and OpenAI Responses or Chat Completions transcripts, plus a generic format.
  • Codex integration scores before built-in compaction and injects retained context at SessionStart; missing keys or low reduction fall back to native compaction.
  • Node 20 or newer is required and the runtime package has no third-party dependencies; on macOS the key can live in the Login Keychain.
  • The README notes token counts are estimates and that Jev probabilities are decisions, not proofs, so expensive sessions warrant a higher threshold.

Quickstart

bash
npm install
npm run check
export TYPESAFE_API_KEY="YOUR_API_KEY"
save-token-jev compact --format anthropic --input transcript.json --output compacted.json

Watch out

MIT-licensed. Needs Node.js 20+ and a TYPESAFE_API_KEY (or a macOS Keychain entry); integrations fail open to the host's native compaction.

Questions about this entry

Short answers drawn from the linked project or page.

Reactions & coverage

Posts, threads, and videos about this entry from around the web.

X: The compaction plugin, in Chinese

YouTube: Ray Amjad puts Jev inside an agentic coding loop and looks at what it costs to run.

YouTube: RoboNuggets puts Jev to work inside Claude Code.

X: Decision outputs in Grep

From the Jev guides

Original write-ups on what this entry is for.

From the Jev AI model community

Posts from builders shipping with Jev right now.

Follow @typesafeai