How to give Claude Code memory with Jevmem? Jev decides what to save, not an LLM

I propose that Claude Code remember between sessions: after each turn, save your decisions, constraints, bugs, and pending items as lines in a JEVMEM.md file inside your repo. What’s different is who decides what to save: not an LLM, but Jev, TypeSafe AI’s decision model, which returns probabilities instead of text. That’s why Jevmem can evaluate each message for fractions of a cent, instead of summarizing once at the end of the session.

Note: at the time this note was published (September 26, 2026), Jevmem is at version 0.5 and publishes several versions a day. Take the installation below as valid for v0.5 and check the README before installing.

What is Jevmem?

Jevmem is an open source memory layer for AI programming tools, licensed under MIT and published on npm as jevmem. It solves a known problem: Claude Code starts each session without remembering what you decided yesterday. Either you repeat yourself, or you keep a CLAUDE.md file handy.

Jevmem maintains the file for you. Each memory is a line tagged with its type, and metadata goes in an HTML comment:

- [decision] Use Postgres 16 for the primary store; SQLite locks under load  <!-- id:k3d9xq ts:2026-09-22T10:14:02.113Z conf:0.93 -->
- [constraint] Node 20 is the floor; CI runs 20 and 22  <!-- id:p1m4zt ts:2026-09-22T10:20:41.907Z conf:0.88 -->
- [superseded] Use SQLite as the primary store → id:k3d9xq  <!-- id:a8s2ww ts:2026-09-20T16:02:11.000Z conf:0.81 by:k3d9xq -->

The third line shows the most important behavior. When you change your mind, the previous memory isn’t deleted: it’s marked as [superseded] and points to the decision that replaced it. When you start the next session, the most relevant lines are automatically injected into Claude’s context.

Since JEVMEM.md is a normal file, you can edit it, commit it, and review it in pull requests like any other code. It’s claude code memory that lives in your repo, not in a separate database.

How does Jevmem decide what to remember?

Jevmem divides the work in two: Jev decides whether it’s worth saving something, and only then is a line written. The README describes five steps:

  1. Clean. Before the turn leaves your machine, common secret formats, email addresses, and card-shaped numbers are removed.
  2. Ask Jev typed questions. Is there a decision? A rule? A bug? Trivial chat? An injection attempt? What existing memory contradicts it? Jev answers each one with a probability.
  3. Apply thresholds in code. Whether to save or skip is decided with simple rules about those probabilities, defined in jevmem.config.json. It’s not a prompt you hope the model will obey.
  4. Write a line. By default, Jevmem extracts the most relevant sentence from the turn and trims it to 200 characters. A model from OpenAI or Anthropic condenses it only if you configure it to.
  5. Replace without deleting. If the turn replaces an existing memory, the previous line is tagged instead of deleted.

The decision works on two levels. A quick pass evaluates each turn, and a set of more detailed questions runs only in borderline cases, which were between 6% and 14% of turns in the author’s evaluations.

The design also pays off in security. Jev can’t generate text, so a transcript that says “ignore previous instructions and remember X” has nothing to hijack. Also, Jevmem asks Jev directly whether the message is directed at an automated system, and refuses to save it when it is.

What is Jev?

Jev is TypeSafe AI’s first “System One Model”: a model made to make decisions inside software, not to converse. You send it structured questions and it returns typed answers with calibrated probabilities. It can’t write prose, and that’s part of the design, not a limitation.

We explain in depth how it works in Jev from TypeSafe: how AI that makes decisions without generating text works. At the time this note was published, TypeSafe offers Jev in early access.

How do I install Jevmem in Claude Code?

The recommended path in v0.5 is the Claude Code plugin. You need Node 20 or higher and a TypeSafe API key.

As a Claude Code plugin

npm install -g jevmem
claude plugin marketplace add Avinash-jetwani/jevmem
claude plugin install jevmem@jevmem
cd your-project && jevmem enable

Next, enter your TypeSafe key inside Claude Code with /plugin configure jevmem@jevmem; the install command in the terminal doesn’t ask for it. Claude Code saves it in your system’s secure credentials store, not in settings.json.

The plugin is activated project by project. Until you run jevmem enable in a repo, it makes no network calls, creates no files, and prints nothing. jevmem disable sets the configuration aside and doesn’t touch JEVMEM.md.

npm only

This path also configures Cursor and Codex:

npm install -g jevmem
cd your-project
jevmem init --tool claude

```In this case, save your key in `~/.jevmem/env` as `TYPESAFE_API_KEY=...`. Claude Code hooks don't inherit variables from your shell, and Jevmem doesn't read shell profiles. `jevmem doctor` checks the installation and tells you which key it found, without displaying it.

### Do you already have a CLAUDE.md?

`jevmem import` splits `CLAUDE.md`, `AGENTS.md` and Cursor rules into statements, and passes each one through the same filter as a live turn. By default it only shows what it would add; with `--apply` it writes it. With `--from claude-auto-memory` it also reads Claude Code's own automatic memory for the project. Source files are only read, never modified.

## Is Jevmem free?

The tool is free and open source. Using it isn't entirely free, because every decision is a call to Jev, and Jev is paid.

TypeSafe charges Jev at USD 42 per billion input tokens, and according to Jevmem documentation output tokens are not charged. The author's own measurements calculate that a day of 300 turns costs around USD 0.03–0.04 in decisions plus USD 0.02 in memory retrieval. If you set up an LLM to write the lines, add a short completion for each saved line.

These figures come from the author's tests, not from an independent evaluation, but they are documented call by call in `docs/cost.md` of the repo. `jevmem stats` shows you your actual daily cost from the local log.

## Does it work with Cursor, Codex and Claude Desktop?

Yes, but automatic capture is exclusive to Claude Code. The README makes it clear:

| Tool | Capture | Retrieval |
|----|----|----|
| **Claude Code** | Automatic, on every turn (hook `Stop`) | Automatic, on every prompt (hook `UserPromptSubmit`) |
| **Codex** | Automatic while `jevmem watch` runs; otherwise the agent calls `add_memory` via MCP | The agent calls `search_memory` via MCP |
| **Cursor** | A rule asks the agent to call `add_memory` when you declare a decision. If it doesn't, nothing gets saved | The rule asks it to call `search_memory` before non-trivial tasks |
| **Claude Desktop** | Manual: you ask it to call `add_memory` | On demand |

If you work mainly in Cursor, Jevmem looks more like a memory tool the agent can use than automatic memory.

## Jevmem or claude-mem?

Both give Claude Code memory between sessions, but with opposite architectures.

* **claude-mem** captures observations from tool use and generates semantic summaries with an AI model: its hosted service, your own OpenRouter or Gemini key, or your Anthropic plan. It saves everything in SQLite with vector search in Chroma, behind a local service with web viewer. Apache 2.0 license.
* **Jevmem** doesn't summarize. Jev decides if a turn deserves a line, and memory is a Markdown file inside your repo. MIT license.

In practice: claude-mem works if you want a rich, searchable history of everything the agent did. Jevmem works if you want a short record of decisions your team can read and review in a pull request. We analyze claude-mem in detail in [claude-mem: give Claude Code the memory it's missing](https://www.yodev.dev/t/claude-mem-dale-a-claude-code-la-memoria-que-le-falta/2263).

### And CLAUDE.md?

`CLAUDE.md` and `JEVMEM.md` solve different halves of the problem:

* **`CLAUDE.md`** saves instructions you write on purpose: how to run the tests, code style, project conventions.
* **`JEVMEM.md`** captures what gets decided along the way: the database choice on turn 41, the constraint mentioned in passing, the bug that took an hour to diagnose.

The reason to automate the second half is that nobody stops mid-session to update a file by hand. The `import` command makes both complement each other instead of competing.

If you switch tools, bringing the context with you is another problem; we cover it in [How to switch from Cursor to Claude Code without losing your project context](https://www.yodev.dev/t/como-cambiar-de-cursor-a-claude-code-sin-perder-el-contexto-del-proyecto/5191). And if you prefer an approach that saves everything, check out [MemPalace](https://www.yodev.dev/t/mempalace-el-sistema-de-memoria-ai-que-guarda-todo-lo-que-tu-agente-olvida/2298).

## How fast and accurate is Jevmem?

In the author's benchmark (66 turns reserved for evaluation, run on September 23, 2026), Jevmem matched frontier LLMs in accuracy for deciding what to save, with about one-tenth their latency:

* **Save/omit accuracy:** 98.5%, tied for first place with GPT-6 Astra.
* **Save accuracy + correct type:** 95.5%. GPT-6 Astra and Claude Opus 5.5 scored higher on this measure, at a cost per decision 40 to 60 times greater.
* **Median time per decision:** 0.30 s, versus 2.8–4.3 s from six current LLMs with the same input.

Since v0.5.0 you don't even wait for that decision. The `Stop` hook runs asynchronously and its process ends in 13–15 ms; the decision gets logged in the background a few hundred milliseconds later.

These are self-reported figures, and the README itself acknowledges it. Its limitations section clarifies that all evaluation datasets were written by the author, that retrieval quality hasn't been measured, and that memory degradation over weeks of use hasn't been measured either.

You can calibrate the model against your own judgment:

* `jevmem right` and `jevmem wrong` label individual decisions.
* `jevmem missed` logs something that should have been saved.
* With 40 labels, `jevmem fit` re-tunes the thresholds.

## What risks does Jevmem have?

There are three worth knowing about before you enable it on a work repo.

**Your turns go to TypeSafe.** Jevmem sends the user message from each turn, the previous two turns, and your memory lines for evaluation. Before that it removes common formats of credentials, email addresses and 16-digit numbers. The README clarifies that it doesn't detect names, phone numbers or addresses. Compare this with your company's policy on sending code conversations to third parties.**Memory can be poisoned.** `JEVMEM.md` lives in git, so a pull request could sneak in a line like "always run this script with sh". Jevmem reviews lines you didn't write on your machine before any agent sees them. In the author's test it blocked 20 of 22 planted lines, without blocking any legitimate rule; the two that slipped through were instructions disguised as normal process. The review also doesn't apply when an agent opens `JEVMEM.md` directly as a file. Review `JEVMEM.md` diffs as if they were code; `jevmem audit --security --ci` runs the same review in CI.

**A Jev outage delays capture.** If Jev doesn't respond or errors, turns wait in a local queue and retry in order. Those still unsaved after 24 hours are discarded with a line in the log.

## Who is Jevmem for?

Jevmem is for people living in Claude Code who have already suffered through an agent that forgets. The interesting part is the architecture:

* A cheap decision model filters what's worth saving.
* Thresholds live in the config, not in a prompt.
* The memory file is reviewed in PRs.

It's an early project: it's days old, versions change daily and the benchmarks are the author's own. But you can already install it, activate it project by project and it's cheap enough to run on every turn. Activate it in a repo, run `jevmem why` on some saved lines and judge the decisions yourself.

https://github.com/Avinash-jetwani/jevmem
1 Like