jevmem
by sjain94022
README.md
<picture><source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/Avinash-jetwani/jevmem/main/brand/lockup/svg/jevmem-lockup-horizontal-dark.svg"><img alt="jevmem" src="https://raw.githubusercontent.com/Avinash-jetwani/jevmem/main/brand/lockup/svg/jevmem-lockup-horizontal-light.svg" height="64"></picture>
**Say it once.** jevmem saves the decisions, rules and failed approaches from your Claude Code chats to JEVMEM.md in your repo, and brings the relevant ones back next session. Before Claude runs a command or edits a file, it checks the call against your saved rules. It is open source (MIT), built on TypeSafe AI's Jev, in Anthropic's Claude plugin directory and on the MCP Registry. Since 0.7.4 it saves from Cursor chats the same way, and it works with Codex and Claude Desktop over MCP.
In Anthropic's Claude plugin directory · On the [MCP Registry](https://registry.modelcontextprotocol.io/v0/servers?search=io.github.Avinash-jetwani/jevmem) · Open source, MIT
The docs site, one page per question: [avinash-jetwani.github.io/jevmem](https://avinash-jetwani.github.io/jevmem/)
[](https://www.npmjs.com/package/jevmem)
[](LICENSE)
[](package.json)
[](https://github.com/Avinash-jetwani/jevmem/actions/workflows/ci.yml)
[](https://m8ven.ai/mcp/avinash-jetwani/jevmem)
https://github.com/user-attachments/assets/c8a7eced-c427-4ef6-85f2-124eb34ad291
## Why
Each Claude Code session starts with a fresh context, so what you decided last week lives in last week's chat.
A `CLAUDE.md` file helps if you keep it up to date. jevmem keeps a file like it up to date for you, as you work.
## In numbers
In real Claude Code sessions on three small test projects, with jevmem and without it:
- **Claude followed the project's earlier decisions:** in 66 of 72 sessions with jevmem, 28 of 72 without (about 9 in 10, against 4 in 10).
- **Tried a change the project forbids:** in 0 of 18 sessions with jevmem, against 10 of 18 without.
- **Repeated an approach that had already failed:** in 0 of 15, against 3 of 15.
- **Saving:** about 18 cents per 1,000 messages and about a fifth of a second to decide, in the background: Claude doesn't wait for it.
- **Bringing lines back:** about a third to half a second on each prompt, which Claude waits for; the time and the cost grow with the file.
- **To be fair:** a `CLAUDE.md` you keep up to date by hand did about as well (67 of 72), and better on one convention nothing in the prompt points at (3 of 3 against 0 of 3). jevmem keeps a file like it up to date for you, and since 0.7.1 marks such rules always-on, so they reach every session: 18 of 18 on six held-out tasks written for that gap, against 14 of 18 with 0.7.0.
My own test sets, each number from one run; none is an independent benchmark. [Method and results](https://avinash-jetwani.github.io/jevmem/results/)
## How it works
You chat as usual. When you decide something, jevmem writes it as one line in a file in your repo, and brings the right lines back next session.
<picture><source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/Avinash-jetwani/jevmem/main/docs/img/how-it-works-dark.svg"><img alt="You say it, Jev decides, jevmem writes one line to JEVMEM.md, and next session Claude gets the lines that matter." src="https://raw.githubusercontent.com/Avinash-jetwani/jevmem/main/docs/img/how-it-works-light.svg"></picture>
1. You decide something in a chat: "We use Postgres."
2. jevmem asks [Jev by TypeSafe AI](https://typesafe.ai), a model that answers yes/no questions with probabilities, whether it's worth keeping.
3. If it is, jevmem writes one line to `JEVMEM.md` in your repo.
4. Next session, the lines that matter for your prompt go back to Claude.
Change your mind, and the old line is crossed out: kept for history, not sent to Claude. Your team gets the same file through git.
jevmem keeps **decisions, rules, bugs, to-dos and dead ends** (an approach that was tried and failed, with the reason).
```text
- [superseded] We'll use SQLite as the primary store for now. → id:cuasaq
- [decision] Switch the primary store to Postgres 16.
- [constraint] Node 20 is the minimum supported version, and CI runs Node 20 and 22.
```
<details><summary>About these lines</summary>
Each line also carries a comment with its id, time and confidence, left out above. The full lines:
```text
- [superseded] We'll use SQLite as the primary store for now. → id:cuasaq <!-- id:21ycba ts:2026-09-26T13:46:34.703Z conf:1.00 by:cuasaq -->
- [decision] Switch the primary store to Postgres 16. <!-- id:cuasaq ts:2026-09-26T13:46:35.240Z conf:1.00 -->
- [constraint] Node 20 is the minimum supported version, and CI runs Node 20 and 22. <!-- id:tollba ts:2026-09-26T13:46:35.763Z conf:0.90 -->
```
Real lines from 0.5.7's default writer, which 0.5.8 to 0.5.10 did not change ([the run](results/readme-example-2026-09-26.txt), 2026-09-26). It kept one sentence of each turn: the Postgres turn also said "SQLite locks up under concurrent writes", and that reason was left out. Since 0.6.0 the line is made from the sentences Jev picks, the one that states the memory and the one that gives its reason ([What's new](docs/whats-new.md)). With `writer` set, an OpenAI or Anthropic model condenses the whole turn instead.
</details>
## Does it work?
In 72 real Claude Code sessions for each setup, Claude acted on the saved line about as often with jevmem as with the same lines in a hand-written `CLAUDE.md`, and in fewer than half the sessions with neither.
<picture><source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/Avinash-jetwani/jevmem/main/docs/img/results-dark.svg"><img alt="A/B results: followed the project's decision 28 of 72 with no project memory, 66 of 72 with jevmem, 67 of 72 with a hand-written CLAUDE.md." src="https://raw.githubusercontent.com/Avinash-jetwani/jevmem/main/docs/img/results-light.svg"></picture>
| | No project memory | jevmem | Same lines in `CLAUDE.md` |
|---|---|---|---|
| Followed the project's decision | 28 of 72 | **66 of 72** | 67 of 72 |
| Tried a change the project forbids | 10 of 18 | **0 of 18** | 0 of 18 |
| Repeated an approach that had already failed | 3 of 15 | **0 of 15** | 0 of 15 |
So jevmem did about as well as a hand-written `CLAUDE.md`, without you writing it.
`CLAUDE.md` did better on a convention nothing in the prompt points at (3 of 3 against 0 of 3), measured on 0.6, where jevmem brought a line back only for a prompt it bears on. Since 0.7.1 jevmem marks a rule every change must follow always-on and sends it at the start of every session: on six held-out tasks written for that gap, Claude followed the convention in 14 of 18 sessions with 0.7.0 and 18 of 18 with 0.7.1, as with the same lines in a hand-kept `CLAUDE.md` ([what's new](#whats-new), [limits](docs/limits.md)).
How the sessions were run, and every row: [the benchmark page](docs/benchmark.md#outcome-ab-does-claude-act-on-the-memory).
## The guard
<picture><source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/Avinash-jetwani/jevmem/main/docs/img/guard-dark.svg"><img alt="The guard: Claude wants to run a command, jevmem checks it against your saved rules, and Claude Code asks you first." src="https://raw.githubusercontent.com/Avinash-jetwani/jevmem/main/docs/img/guard-light.svg"></picture>
Before Claude runs a command or edits a file, jevmem checks it against your saved rules. If one might break, Claude Code asks you first:
```text
jevmem: this may break a saved rule: "Never commit .env files" (JEVMEM.md)
```
On a test of 274 tool calls, a set the guard was not tuned on, it caught 66 of 68 rule breaks and asked about 3 or 4 of the 206 calls that broke no rule (one run each on 0.6.0 and 0.6.1).
It's a backstop, not a sandbox: it looks at the words a rule and a call share. Since 0.7.0, `jevmem trust` lets a rule you added by hand block a call in the guard's block mode, not only ask about it. [How the guard works](docs/guardrails.md).
## Side pane
A pane beside your Claude Code chat shows what jevmem just did: the memory lines it gave Claude for your prompt, what its guard said about a command, and the line it saved from the turn, each with `why`, `wrong` and `forget` buttons. The two that change `JEVMEM.md` ask first; a rule is retired in a terminal only. It reads three local files and sends nothing anywhere.
```
/plugin install jevmem-pane@jevmem
```
It is a second plugin from the jevmem marketplace (the jevmem plugin itself still ships no code), for Claude Code 2.1.299 or newer; it opens on its own in a terminal 144 columns wide or wider and in the desktop app's Code tab, and `/jevmem` opens or closes it anywhere. What each block shows, and what was measured: [docs/pane.md](docs/pane.md).
## Install
You need a [TypeSafe API key](https://console.typesafe.ai/keys), which jevmem's requests are billed to, and Claude Code 2.1.273 or later.
1. In the Claude app: **Plugins → Discover → jevmem → Add**.
2. Install the CLI the plugin runs:
```bash
npm install -g jevmem
```
3. In your project's folder, finish the setup in one go (it asks for your key without showing it, turns jevmem on in that folder, and checks the setup):
```bash
jevmem setup
```
Start Claude Code in that project. If you start it before the setup is done, the plugin says once what is left; `jevmem doctor` checks the setup any time.
<details><summary>Other ways to install: the jevmem marketplace, npm, Cursor, Codex</summary>
From the jevmem marketplace:
```bash
npm install -g jevmem
claude plugin marketplace add Avinash-jetwani/jevmem
claude plugin install jevmem@jevmem
claude plugin install jevmem-pane@jevmem # the side pane (0.7.5), optional
cd your-project && jevmem setup
```
With npm only (also sets up Cursor and Codex):
```bash
npm install -g jevmem
cd your-project
jevmem init --tool claude # or cursor, codex, claude-desktop, all
```
Already have a `CLAUDE.md`? `jevmem import` shows what it would add from it; `--apply` writes it.
Every step, and what to do if the plugin can't find the CLI: [docs/install.md](docs/install.md).
</details>
## Works with
Saving is automatic in Claude Code and, since 0.7.4, in Cursor, where Cursor's hooks save each finished agent turn; and in Codex while `jevmem watch` runs. Cursor, Codex and Claude Desktop reach jevmem over MCP, a standard way for an AI tool to call another program, when the agent asks for it; in the Cursor app a project's MCP server starts off until you turn it on once ([the step](docs/mcp.md#cursor)). In Cursor, on 10 held-out chats captured before the code (24 turns), the first run paired 21 of 24 turns whole, the prompt with the whole reply; a reader fix came from that run, and the second run paired 24 of 24, with what to save right in 21 of 24 ([measured](docs/hooks.md#cursor-hooks-074)).
| | Saving | Bringing it back |
|---|---|---|
| **Claude Code** | Automatic, every turn | Automatic, every prompt |
| **Codex** | Automatic while `jevmem watch` runs | When the agent asks, over MCP |
| **Cursor** | Automatic, every finished agent turn (0.7.4) | When the agent asks, over MCP, once you have turned the project's server on in the Cursor app ([the step](docs/mcp.md#cursor)) |
| **Claude Desktop** | When you ask it to, over MCP | When you ask it to, over MCP |
The MCP server is on the [MCP Registry](https://registry.modelcontextprotocol.io/v0/servers?search=io.github.Avinash-jetwani/jevmem) as `io.github.Avinash-jetwani/jevmem`. Client setup: [docs/mcp.md](docs/mcp.md) · [docs/install.md](docs/install.md#works-with).
## Fast and cheap
<picture><source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/Avinash-jetwani/jevmem/main/docs/img/benchmark-dark.svg"><img alt="Median time to decide one message on 66 held-out turns: jevmem 0.23 s, six current LLMs 2.78 to 4.29 s." src="https://raw.githubusercontent.com/Avinash-jetwani/jevmem/main/docs/img/benchmark-light.svg"></picture>
Deciding what to save takes 0.23 s and costs $0.00018 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%); two 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 0.7.5 on 2026-10-17 ([results](results/eval-heldout-2026-10-17-v075.json)); the six LLMs ran on 2026-09-23. All seven in one table, with the cost of each and how it was run: [benchmark](docs/benchmark.md#075-beside-the-six-llms).
## How it decides
<picture><source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/Avinash-jetwani/jevmem/main/docs/img/how-it-decides-dark.svg"><img alt="How jevmem decides: scrub secrets, ask Jev typed questions, apply thresholds in code (a restated line is not saved again), write one line, supersede the old line, and mark a rule for every change always-on." src="https://raw.githubusercontent.com/Avinash-jetwani/jevmem/main/docs/img/how-it-decides-light.svg"></picture>
No prompt decides what to save: Jev answers small yes/no questions with probabilities, and plain rules in code act on them.
<details><summary>Each step in detail</summary>
1. **Scrub.** Common secret shapes, email addresses and card-shaped numbers are removed from the turn before it leaves your machine.
2. **Ask Jev typed questions.** [Jev by TypeSafe AI](https://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?
3. **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).
4. **Write one line.** On save, jevmem writes one line of at most 200 characters from the sentences of the turn that Jev picks (the one that states the memory and the one that gives its reason), or, if you set `writer` in `jevmem.config.json`, a small OpenAI or Anthropic model condenses the turn.
5. **Supersede the old line.** If the turn replaces an existing memory, that line is tagged `[superseded] … → id:new` and stays in the file.
6. **Mark it always-on (0.7.1).** A saved rule that Jev reads as one every change must follow gets `always:1` in its comment, and the `SessionStart` hook 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](docs/how-it-works.md).
</details>
## Privacy
Your messages go to TypeSafe's API to be scored, with common secrets removed first, and nowhere else unless you set a `writer`.
- jevmem only runs in projects you turn on (`jevmem enable` or `jevmem init`). Elsewhere, nothing is sent.
- Your message, the previous two turns and your memory lines go to TypeSafe's API to be scored, with common secrets scrubbed first. So does Claude's reply on turns that ask a question, report a bug or try something, and, for the guard, the command or the file being changed.
- `jevmem import --from sessions` (0.7.1) sends a project's past Claude Code sessions, turn by turn and scrubbed the same way, only when you run it and answer yes after seeing the count and the cost.
- No telemetry. Nothing goes to OpenAI or Anthropic unless you set `writer` in `jevmem.config.json`.
- Lines a teammate or a pull request adds are checked before Claude sees them.
Exactly what is sent, scrubbed and checked, with the third parties' privacy policies and how to delete your data: [PRIVACY.md](PRIVACY.md). What the check on planted lines does not cover: [SECURITY.md](SECURITY.md).
## Limits
jevmem is young, and these are the limits to know before you rely on it:
- **Early:** first released on 2026-09-22, and every test set was written by the author or captured from Claude Code sessions on scratch projects built for it. None is an independent benchmark.
- **Not the most accurate:** two LLMs scored higher at picking the kind of line. jevmem's edge is speed and cost.
- **Answer quality isn't measured:** the tests check that the right lines reach Claude, not that its answers get better.
- **Automatic saving is Claude Code and, since 0.7.4, Cursor** (and Codex while `jevmem watch` runs); Claude Desktop saves only when the agent calls `add_memory`, and in Cursor recall is still the agent's call.
- **The guard looks at shared words:** a rule worded far from the command it should catch can be missed.
- **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.
Every limit, with the numbers: [docs/limits.md](docs/limits.md).
## What's new
What changed, newest first; the measurements behind each line are on the what's new page.
- **0.7.5: a pane beside the chat shows what jevmem did.** Install `jevmem-pane` from the jevmem marketplace and Claude Code shows, for each prompt and turn, the lines it recalled, what the guard decided and what was saved, with `why`, `wrong` and `forget` buttons. Also: a leading label like "Decision for this project:" no longer ends up in the saved line (on 12 held-out turns written that way, run once, 0 of 10 lines kept it), `jevmem init --tool cursor` gitignores Cursor's own state folder, `jevmem doctor` says when the Cursor app has not started the project's MCP server, and `jevmem wrong … --should-be none` on a rule asks on a terminal like `forget` does ([what's new](docs/whats-new.md)).
- **0.7.4: a Cursor chat saves like a Claude Code one.** `jevmem init --tool cursor` writes Cursor's hooks (and a launcher, both committable), and when an agent turn finishes the `stop` hook reads the turn from Cursor's transcript and runs the same decide and write path as in Claude Code; reading memory in Cursor stays the agent's MCP call. On 10 held-out Cursor chats (24 turns), captured through Cursor's own CLI before the code, the first run paired 21 of 24 turns whole; a reader fix came from that run, and the second run paired 24 of 24, with what to save right in 21 of 24. Run `jevmem init --tool cursor` once more in a project set up earlier. [Details](docs/whats-new.md).
- **0.7.3: the setup message stays off cloud and Cowork sessions.** 0.7.2's one-time message showed at the start of every claude.ai chat that ran in a cloud workspace, where its marker could not stay. Now it shows only on your own computer (a terminal, the desktop app, the VS Code extension or an SSH session), and a cloud or Cowork session gets no message and no file. The plugin's launcher and the docs; the CLI's code is unchanged. [Details](docs/whats-new.md).
- **0.7.2: finish the setup in one command.** After **Add** in the Claude app, the first session on a machine says once what is left, and `jevmem setup` asks for your key, turns jevmem on in the folder and checks the setup. Always-on lines now go through the poisoning gate before they reach a session, and Jev 1.13.0 is pinned: beside 1.13 on six test sets, 1.14 missed one of five contradictions in all three runs, saved fewer dead ends from captured sessions in all three, and kept fewer of the reasons on the written set. [Details](docs/whats-new.md).
- **0.7.1: rules for every change, and memory from past sessions.** A line marked always-on reaches ClThis server cannot be deployed
Maintenance
ActivityActive
ResponsivenessResponsive