fast-jev-compaction
Reviewed
at commit e3f262a
Sends data to TypeSafe (api.typesafe.ai)
Verbatim Jev-guided compaction for Claude Code sessions.
0 upvotes
Log in to upvote or save- Made by
- tamaratran
- Pinned commit
-
e3f262a7f4d42bd8dd32ced30d26176f7cb545b0 - What we checked
-
When the conversation is compacted, the history goes to TypeSafe's Jev model at api.typesafe.ai under your own TypeSafe API key: your prompts, Claude's replies and the inputs of tool calls, with tool outputs replaced by a size note. Jev scores each older tool call, and calls and results it rates as no longer needed are cut down or removed instead of the history being summarized. It also starts compaction on its own once the context is 60% full. If TypeSafe fails or the saving is too small, Claude Code's normal compaction runs instead, and a notice shows what happened. It reads no files, runs no programs and stores nothing.
Review details
Static review of the source at the pinned commit; not run. hooks/hooks.json loads hooks/fast-jev.ts, which imports src/compact.ts, src/request.ts and src/state.ts (src/types.ts and the claude-code types are type-only imports). Hooks: session.compact replaces the transcript with a pruned copy (returns { messages }) or delegates to next() as a fallback. turn.complete reads $.session.usage() and calls $.session.compact() once context.percent reaches compactAtPercent (default 60), with an in-flight guard. Runtime calls: $.http.fetch (POST to https://api.typesafe.ai/v1/systemone with Authorization: Bearer <key>), $.env.get('TYPESAFE_API_KEY'), $.settings.read() (only to look up env.TYPESAFE_API_KEY in the Claude Code settings when neither the plugin option nor the environment variable is set), $.session.usage, $.session.compact, $.ui.log and $.ui.toast. The request state holds every message's text, abridged or collapsed when over maxStateTokens, plus each tool call's name and JSON input truncated to 1000/200/60 chars. Tool outputs are replaced by an ok/error and character-count note. The goal is the last three user prompts (500 chars each). Requests go out in concurrent batches below maxRequestTokens, with the full state resent each time. Calls in the first message and the newest 6 messages are pinned. For the others, results Jev scores below keepThreshold are truncated plus a note, and calls scored below it are removed with their result. User and assistant text is never removed. A missing key, an HTTP error, malformed answers, a history too large to fit, or a reduction below 25% all fall back to the built-in compaction. Per-call decision lines are written to the plugin log. No files, processes or persistent storage.
- What it uses
-
- Reads your prompts: yes
- Sees tool calls: yes
- Blocks or changes tool calls: no
- Reads or writes files: no
- Runs programs on your machine: no
- Calls the model (uses tokens): no
- Sends data over the network: yes
- Stores data: no
- Shows something on screen: yes
- Hooked events
Made this mod? Add a badge to your README
Paste this into your README. The badge says reviewed once the current version has been reviewed, and links readers to this page.
[](https://modsforclaude.com/mods/fast-jev-compaction/)