optim-jev

Reviewed at commit ad9135a

Sends data to TypeSafe Jev (api.typesafe.ai), only when you set a TypeSafe API key

Jev based token-usage optimization tools for Claude Code workflows.

Made by
oqura.ai
What we checked

On compaction (on by default) a bundled Python program sends parts of your conversation, tool calls and outputs to TypeSafe's Jev service and drops stale tool output instead of summarizing; when the prompt cache has expired it asks whether to prune now. An optional router picks each subagent's model and an optional skill picker sends your prompts and skill names to Jev. Logs stay in the project's .optim-jev folder.

Review details

Static review of the source at the pinned commit; not run. The TypeScript module registers session.start, classic.SessionStart, classic.PostModelSwitch, turn.start, turn.step, turn.complete, prompt.compose, prompt.submit, prompt.attachment, skill.prompt, agent.spawn, tool.call (Edit, Write, NotebookEdit, Bash, PowerShell), tool.check (Read, Glob, Grep), session.compact, command.run (/jev-compact, /jev-route, /jev-skills) and ui.render (AbovePrompt dashboard, CommandOutput cards). All logic runs in the plugin's own Python package (src/optim_jev, standard library only; read from the clone for network, process and file access, since the hook starts it) via $.process.run with the configured python, PYTHONPATH set to the plugin's src and the API key passed only in the child environment; the key comes from the plugin option, the TYPESAFE_API_KEY environment variable or the env block of Claude settings ($.settings.read, also read for prompt cache TTL settings). The only network call is a urllib POST to https://api.typesafe.ai/v1/systemone (Jev, Bearer key): the compacter sends a trimmed state of the conversation (goal text, assistant text, tool names, inputs and result excerpts, never the newest 6 messages) and applies Jev's keep/drop answer by returning rebuilt messages from session.compact; without a key or on failure it skips or falls back to the built-in summary. After each main turn it may call $.session.compact() at the soft threshold (60%), and new in this version a timer notices when the prompt cache has expired (idle past its TTL, resume, model switch) and asks via $.ui.ask before running /compact (option 'auto' prunes without asking, 'off' disables it). The router (off by default) now lets the main loop write except where the project's .optim-jev/jev_router/rules.json forbids the session model (previously it denied all main-loop writes), denies routed subagents' writes and deleting shell commands outside their allowed paths, sends subagent descriptions, prompts, file paths and the last four prompts to Jev to pick a model and effort for agent.spawn (Explore included, resumes skipped), overrides turn.step effort, and uses $.model.complete (haiku fallback decider, sonnet for /jev-route init, one-token availability checks), which uses tokens; init runs git ls-files and reads the first 8 KB of larger code files for a digest sent to Claude only. The skill picker (off by default) replaces the built-in skill listing via prompt.attachment, sends the prompt, recent prompts and skill names and descriptions to Jev, and in the opt-in global scope reads ~/.claude/skills and installed plugins' skill folders (via installed_plugins.json) and turns ask into allow for Read/Glob/Grep inside those folders, which the option description discloses. It writes only inside <project>/.optim-jev (gitignored JSONL logs with file locks, rules, model and index caches), only checks that the session transcript under ~/.claude/projects exists, and stores dashboard and mode state with $.store. UI: toasts, $.ui.log, $.ui.ask, status line or an animated dashboard with buttons. The repository also contains a separate Codex plugin (codex-plugin/, src/optim_jev/cli.py, hosts/codex.py) that Claude Code does not load; it was only skimmed. Python is started with -m from the default working directory, so a module file in the opened project could shadow a standard library module. Not reviewed: TypeSafe's service.

What it uses
  • Reads your prompts: yes
  • Sees tool calls: yes
  • Blocks or changes tool calls: yes
  • Reads or writes files: yes
  • Runs programs on your machine: yes
  • Calls the model (uses tokens): yes
  • Sends data over the network: yes
  • Stores data: yes
  • Shows something on screen: yes
Made this mod? Add a badge to your README

modsforClaude badge for optim-jev

Paste this into your README. The badge says reviewed once the current version has been reviewed, and links readers to this page.

[![Listed on modsforClaude](https://modsforclaude.com/badge/optim-jev.svg)](https://modsforclaude.com/mods/optim-jev/)

← All mods