jev-compact-gate
Reviewed
at commit 9f4a843
Sends data to TypeSafe Jev via OpenRouter (openrouter.ai)
Jev decides when the session compacts, inside a 280k–400k token band; Claude's own summary does the compacting.
0 upvotes
Log in to upvote or save- Made by
- Tom di Mino
- Pinned commit
-
9f4a84393dc894c2afd6b6f748c4e523003ae08d - What we checked
-
Between 280k and 400k tokens of context, after each finished turn it sends your last three prompts, the last answer and a one-line summary of the last 15 tool calls (secret-looking text masked) to TypeSafe's Jev model on OpenRouter, using your OPENROUTER_API_KEY. In live mode it compacts at a good moment; the default shadow mode only logs. It writes a metrics log under ~/.claude.
Review details
Static review of the source at the pinned commit; not run. Module hooks/jev-compact-gate.ts with src/run.ts and src/decide.ts; scripts/smoke.py is a manual test script not loaded by the plugin. Registers turn.complete and session.compact. On a main-loop turn it reads $.session.usage and $.session.messages, builds a bounded state (3 prompts up to 600 chars, last answer up to 1500 chars, 15 tool calls as tool name plus one key argument up to 120 chars, tool output never sent) and passes it through a pattern-based redact() for key and token assignments, bearer headers and sk-, ghp_ and AKIA shapes. It reads OPENROUTER_API_KEY with $.env.get and posts to https://openrouter.ai/api/v1/systemone with $.http.fetch and a 5 second timeout; any failure means hold. Shadow is the default and still sends the state. In live mode it calls $.session.compact with a short instruction naming the latest prompt; at or above the ceiling it compacts without asking Jev. It reads HOME and appends JSONL rows (token counts, probabilities, verdict, cost, no conversation text) to ~/.claude/jev-compact-gate/<session>.jsonl, rotating every 200 rows, via whole-file $.fs.read and write. Shows a toast when it compacts. No eval, process calls or code loading.
- What it uses
-
- Reads your prompts: yes
- Sees tool calls: yes
- Blocks or changes tool calls: no
- Reads or writes files: yes
- Runs programs on your machine: no
- Calls the model (uses tokens): no
- Sends data over the network: yes
- Stores data: yes
- 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/jev-compact-gate/)