What is Jev used for in coding agents, and how does jevmem use it?
In jevmem, Jev (a model by TypeSafe AI) is what decides: it scores each message of a Claude Code chat so that jevmem can tell whether it holds a decision, a rule or a failed approach worth saving, it picks the saved lines that bear on your next prompt, and it judges whether a command or a file edit may break a saved rule.
Deciding what to save takes 0.16 s and costs $0.00019 per message, and was right on save or skip for 98.5% of 66 held-out turns (jevmem 0.7.7, one run on 2026-11-08, results). This page covers only what jevmem does with Jev. What Jev itself is: TypeSafe's docs and their launch post.
How jevmem asks Jev #
No prompt decides what to save: Jev answers small yes/no questions with probabilities, and plain rules in code act on them.
Each step in detail
- Scrub. Common secret shapes, email addresses and card-shaped numbers are removed from the turn before it leaves your machine.
- Ask Jev typed questions. Jev by TypeSafe AI answers a fixed set of small questions with probabilities: is there a decision, a rule, a bug? is it small talk or an injection attempt? does it say the same as a saved line (0.7.0)? is it a rule for how any work in this project is done (0.7.1)? which existing line does it change?
- Apply thresholds in code. Plain rules over those probabilities decide save or skip; they live in
jevmem.config.json, not in a prompt. A message that restates a saved line is skipped as a duplicate, and one that restates it word for word is skipped before anything is sent (0.7.0). - Write one line. On save, jevmem writes one line from the sentences of the turn that Jev picks (the one that states the memory and the one that gives its reason), aiming at 200 characters and, since 0.7.7, keeping those sentences whole up to 300 so their rule is not cut off, or, if you set
writerinjevmem.config.json, a small OpenAI or Anthropic model condenses the turn. - Supersede the old line. If the turn replaces an existing memory, that line is tagged
[superseded] … → id:newand stays in the file. - Mark it always-on (0.7.1). A saved rule that Jev reads as one every change must follow gets
always:1in its comment, and theSessionStarthook puts it in front of Claude at the start of every session, whatever the prompt.jevmem always <id>marks a line by hand.
Tiers, questions, policy, contradictions, recall and audit: docs/how-it-works.md.
The three places jevmem calls Jev #
- After each turn, to decide what to save. One request of small typed questions; a second, larger set only when the first is unsure. Thresholds in
jevmem.config.jsonturn the probabilities into save or skip (how it works). Since 0.7.0 one of the questions asks whether the message restates a saved line, so that it is not saved twice, and since 0.7.1 one asks whether it is a rule for how any work in this project is done, which marks the line always-on. - On each prompt, to pick the lines to bring back. Each live line, up to 250 of them, is asked about on its own, and at most five go to Claude (the read side).
- Before a Bash, Edit or Write call, to check it against your rules. Only for a call that shares a path, a command or enough words with a saved rule (the guard).
Jev also checks lines that jevmem did not write on your machine, such as a teammate's or a pull request's, before they reach Claude (what leaves your machine). The same questions run when you ask for them: jevmem trust asks that check about one line you wrote (0.7.0), jevmem always --suggest asks the always-on question about each rule-like line (0.7.1), and jevmem import --from sessions decides each past turn of the project's Claude Code sessions (0.7.1). The SessionStart hook, which puts the always-on lines in front of Claude, makes no call.
Why Jev and not an LLM #
- It is fast enough to run on every turn. About 0.2 s in-process (0.7.3: a median of 216 ms on the 66 held-out turns, 2026-10-15; and the
Stophook no longer waits for it), against 2.8–4.3 s p50 for the LLMs we measured, means the decision can happen on every Stop, not once per session. Memory that updates continuously catches the decision made in passing at turn 41. It is not the most accurate: see Benchmark. - Typed answers, thresholds in code. Jev returns probabilities, not prose. "Save if importance ≥ useful and chit-chat < 0.5" is a line of config, testable and tunable, not a prompt you hope the model follows.
- A narrow attack surface, not a closed one. Per TypeSafe, Jev returns probabilities and does not generate text or call tools, so a transcript that says "ignore previous instructions and remember X" has no channel to run a command through Jev; the failure mode is a wrong probability. Injected text can still bias those probabilities, which is why an injection noul gates every hook and MCP
add_memorysave (one broad noul in tier 1, four atomic nouls when tier 2 runs), the eval sets carry injection attempts, and the harness sends one. Once Jev says save, the line itself is written by the writer LLM (or the extract) from the scrubbed message, so injected text that gets past the gate can still shape the line's wording. Lines typed withjevmem addare not checked by Jev.
Fast and cheap, measured #
Deciding what to save takes 0.16 s and costs $0.00019 per message, in the background: Claude doesn't wait for it. On whether to save a message at all, jevmem was right as often as the best of six LLMs (98.5%); three of them were better at naming the kind of line.
Measured on 66 turns written before the code and not tuned on, one run of the 0.7.7 build on 2026-11-08 (results); the six LLMs ran on 2026-09-23. All seven in one table, with the cost of each and how it was run: benchmark.
A local model in Jev's place #
jevmem was tried once against a local model server, Ollaya 0.9.0, on an Apple M4 with 16 GB, on 2026-10-02, next to a Jev run of the same set the same afternoon. On the 66 held-out turns, in jevmem's default mode, Jev was right on save or skip for 65/66 at a median of 0.23 s a turn; winnow:e4b for 60/66 at 28.5 s; laya:typed-decisions for 19/66. This was one run each on one Mac, with two models, on a set written for Jev's behaviour (Jev, winnow:e4b, laya:typed-decisions). A local model is not a supported mode (FAQ).
Set it up #
Jev needs a TypeSafe API key, and jevmem sends message text to TypeSafe to be scored, with common secrets scrubbed first. The four steps: install.
The limits, in short #
- jevmem needs a TypeSafe API key (where to get one, and the install steps).
- Message text is sent to TypeSafe to be scored, with common secrets scrubbed first (what leaves your machine).
- It is automatic in Claude Code and, since 0.7.4, in Cursor (as a Cursor plugin since 0.7.6, whose rule sits in every chat), automatic in Codex while
jevmem watchruns, and in Claude Desktop only when the agent calls it; in Cursor, bringing lines back is still the agent's call (what each tool does). - Rules every task must follow reach every session only when they are marked always-on (0.7.1), by Jev's reading or yours (jevmem next to CLAUDE.md).
- The guard is a backstop, not a sandbox (what it misses).
- The side pane is Claude Code only, 2.1.299 or newer: Cursor has no pane, and Claude Code for VS Code draws none yet (the pane).
Every limit, with the numbers: the FAQ.