jevmem README

README проекта с github.com/Avinash-jetwani/jevmem. Одним файлом markdown: README.md.

jevmem

Claude remembers you. jevmem makes your project's rules stick, across your agents and your teammates. jevmem saves your project's decisions, rules and failed approaches from your chats to one file in your repo, JEVMEM.md, that Claude Code, Cursor and Codex read, and checks Claude's commands against those rules before they run. Your teammates get the same file through git. It works beside Claude Code's own auto memory and adds what that doesn't have: the guard, a shared file in git, and the other tools. It is open source (MIT), built on TypeSafe AI's Jev, in Anthropic's Claude plugin directory and on the MCP Registry, and it works with Claude Desktop over MCP.

You need a paid TypeSafe API key: your message text is sent to TypeSafe to be scored, with common secrets removed first. No telemetry. Opt-in per project.

In Anthropic's Claude plugin directory · On the MCP Registry · Open source, MIT

The docs site, one page per question: avinash-jetwani.github.io/jevmem

npm version license node CI M8ven Verified

https://github.com/user-attachments/assets/c8a7eced-c427-4ef6-85f2-124eb34ad291

You chat as usual in Claude Code, Cursor or Codex; decisions, rules and failed approaches go to JEVMEM.md in your repo, shared through git; your agents read it; and in Claude Code the guard checks each command and edit against the rules before it runs.

Three ways teams use it

1. The guard: a rule Claude checks before it acts

Your team decided "don't hand-edit db/migrations/: those files are generated". Three weeks later, in a fresh session, Claude is about to edit one. Before the edit runs, jevmem checks it against the rules in JEVMEM.md, and Claude Code stops and asks you first, with the rule:

Claude wants to edit a generated migration, jevmem finds the team's rule in JEVMEM.md, and Claude Code asks you before the edit runs.

jevmem: this may break a saved rule: "Don't hand-edit db/migrations/: those files are generated." (JEVMEM.md)

In our tests (0.7.7, checked by hand), a change a rule forbids was left in the code in 0 of 15 sessions with jevmem on. The guard checks Claude's commands, file edits and file writes in Claude Code, and jevmem trust lets a rule you wrote block the call instead of asking (the guard).

2. The team: one file, shared through git

On Monday you tell Claude "we use pnpm, not npm". jevmem saves it as a line in JEVMEM.md, and you commit it with your code. On Tuesday your teammate pulls and opens the repo in Cursor: with the jevmem plugin, the agent looks up the project's rules before a task, and the pnpm line is there, because it travelled with the code through git. Codex reads the same file over MCP when the agent asks, and in Claude Code the guard checks an npm install against the rule before it runs.

On Monday you tell Claude Code we use pnpm, not npm; jevmem saves it to JEVMEM.md, committed with your code; on Tuesday your teammate's Cursor agent looks up the rules and finds it.

3. No repeated mistakes

You tried caching the API responses in memory, it broke the build, and you kept Redis. jevmem saves that as a failed approach, with the reason. Next month, when a prompt comes near it, Claude gets it back as "Already tried: …" with the reason, and in Cursor and Codex the agent finds it when it looks up the project's memory, so an idea you already ruled out stays ruled out. In our tests, an approach that had already failed was repeated in 0 of 15 sessions with jevmem, against 3 of 15 without.

An in-memory cache broke the build; jevmem saves it as a failed approach with the reason; next month Claude gets it back as Already tried.

Install

You need a TypeSafe API key, 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:
    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):
    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.

Other ways to install: the jevmem marketplace, npm, Cursor, Codex

From the jevmem marketplace:

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):

npm install -g jevmem
cd your-project
jevmem init --tool claude    # or cursor, codex, claude-desktop, all

In Cursor, the jevmem plugin (0.7.6) carries the hooks, the MCP server and the rule for every window: install it from the Cursor Marketplace once it is listed there, or copy this repository's cursor-plugin/ folder to ~/.cursor/plugins/local/jevmem and reload the window; then jevmem setup in each project (the steps). jevmem is also listed on cursor.directory; its Add to Cursor button installs the MCP server alone (recall, with the entry in docs/mcp.md), so saving still needs the plugin folder or jevmem init --tool cursor.

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.

Beside Claude Code's memory

Claude Code keeps notes of its own, auto memory, on your machine. jevmem runs beside it and adds the parts a team needs:

Claude Code's auto memory jevmem
Saves from your chats Yes Yes: decisions, rules, failed approaches, bugs, to-dos
Where it keeps them Notes on one machine, under ~/.claude/projects/ JEVMEM.md in your repo, shared through git
Checks commands and edits against your rules before they run No Yes, the guard
Works in Claude Code Claude Code, Cursor, Codex, Claude Desktop

Run both: the guard leaves auto memory's own notes alone (0.7.7), and the two side by side, measured, are below.

Why

Each AI coding session starts with a fresh context, and a rule your team agreed lives in one person's chat, on one machine, in one tool. 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, shares it with your team through git, gives it to Claude Code, Cursor and Codex, and checks Claude's commands against it.

In numbers

In real Claude Code sessions on three small test projects, with jevmem and without it:

My own test sets, each number from one run; none is an independent benchmark. Method and 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.

You say it, Jev decides, jevmem writes one line to JEVMEM.md, and next session Claude gets the lines that matter.

  1. You decide something in a chat: "We use Postgres."
  2. jevmem asks Jev by 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).

- [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.
About these lines

Each line also carries a comment with its id, time and confidence, left out above. The full lines:

- [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, 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). With writer set, an OpenAI or Anthropic model condenses the whole turn instead.

The guard

The guard: Claude wants to run a command, jevmem checks it against your saved rules, and Claude Code asks you first.

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:

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.

Works with

Saving is automatic in Claude Code and, since 0.7.4, in Cursor, where Cursor's hooks save each finished agent turn (since 0.7.6 from the jevmem plugin for Cursor, or from the files jevmem init --tool cursor writes); 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; the Cursor plugin's server runs in every window, while a project's own .cursor/mcp.json server starts off until you turn it on once (the step). 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).

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; the plugin since 0.7.6) When the agent asks, over MCP (the plugin's server runs in every window; a project's own server needs one toggle in the Cursor app, the step)
Claude Desktop When you ask it to, over MCP When you ask it to, over MCP

The MCP server is on the MCP Registry as io.github.Avinash-jetwani/jevmem. Client setup: docs/mcp.md · docs/install.md.

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.

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.

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, limits). How the sessions were run, and every row: the benchmark page.

Next to Claude Code's auto memory (0.7.7)

Beside Claude Code's auto memory (0.7.7, by hand): a line taught earlier was followed in 17 of 54 sessions with no memory, 49 with auto memory, 40 with jevmem, 48 with both and 46 with the line in CLAUDE.md; a change a rule forbids was left in the code in 9, 1, 0, 0 and 2 of 15.

Claude Code keeps notes of its own, auto memory, on by default. To see what jevmem adds next to it, a fact was stated in plain chat in one session, and a later session got a task that needed it, in 558 real Claude Code sessions on three new projects (one model, claude-fable-5-1, and Claude Code 2.1.306; three runs of each task).

Followed the taught line (18 tasks, 3 runs) No memory Auto memory jevmem Both Same line in CLAUDE.md
By the checks written before the run 17 of 54 47 of 54 40 of 54 45 of 54 45 of 54
After reading every miss by hand 17 of 54 49 of 54 40 of 54 48 of 54 46 of 54
Left a change a rule forbids in the code (by hand) 9 of 15 1 of 15 0 of 15 0 of 15 2 of 15
Long project, 230 earlier lines (checks → by hand) 7 → 7 of 18 12 → 12 of 17 14 → 15 of 18 12 → 16 of 18 14 → 15 of 18

So auto memory on its own followed the taught line more often than jevmem on its own, and with both on Claude did about as well as with auto memory alone; jevmem's guard kept every forbidden change out of the code. On the long project, auto memory's notes ran past the 25 KB Claude Code loads at the start of a session, and jevmem, alone or beside it, did about as well as CLAUDE.md. Reading the 106 misses by hand found 12 that the checks had scored wrong (a number kept in a constant in another file, a year written another way); both rows are shown. In 14 of jevmem's 17 misses its saved line had left out the rule: 9 cut at the line's 200-character limit, which 0.7.7 changes (a line now keeps the sentences that state it up to 300 characters; what's new), and 5 where Jev's choice of sentences left out the one with the rule, which 0.7.7 does not change. The comparison ran on the build before that change. How the sessions were run, the 12 sessions and every row: the benchmark page.

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.

Fast and cheap

Median time to decide one message on 66 held-out turns: jevmem 0.16 s, six current LLMs 2.78 to 4.29 s.

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.

How it decides

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.

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
  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 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 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 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.

Privacy

Your messages go to TypeSafe's API to be scored, with common secrets removed first, and nowhere else unless you set a writer.

Exactly what is sent, scrubbed and checked, with the third parties' privacy policies and how to delete your data: PRIVACY.md. What the check on planted lines does not cover: SECURITY.md.

Limits

jevmem is young, and these are the limits to know before you rely on it:

Every limit, with the numbers: docs/limits.md.

What's new

What changed, newest first; the measurements behind each line are on the what's new page.

Details and measurements: docs/whats-new.md · Upgrading: docs/upgrading.md · CHANGELOG

Commands
jevmem init [--tool claude|cursor|codex|claude-desktop|all] [--no-hooks] [--files] [--command "<cmd>"]
jevmem init --remove-hooks                     Remove jevmem's Claude Code hooks and Cursor hooks from this project (plugin users; with the Cursor plugin, its rule and MCP entry too)
jevmem enable                                  Opt this project in (plugin users): jevmem.config.json, JEVMEM.md, .jevmem/
jevmem setup                                   Finish the setup here: the CLI and the plugin, your TypeSafe key (asked for, not shown), jevmem turned on in this folder, doctor; terminal only
jevmem disable                                 Opt this project out: jevmem does nothing here (JEVMEM.md is kept)
jevmem hook                                    Hook entrypoint; reads the Claude Code hook JSON on stdin
jevmem daemon [status|start|stop]              Warm Jev client used by the hook (auto-started, exits when idle)
jevmem watch [--replay] [--once]               Capture turns from Codex's session log for this project (Cursor saves through its hooks)
jevmem mcp [--root <dir>]                      Stdio MCP server
jevmem audit [--dry-run]                       Re-score every memory against the repo, flag [stale?]
jevmem audit --security [--ci]                 List lines that read as instructions to an AI (--ci: exit 1 if any)
jevmem search <query> [--limit N]              Rank memories by relevance
jevmem list [--all]                            Print memories (--all: with superseded and retired lines, and provenance)
jevmem add [--trust] [--always] <kind> <text>  Add a line by hand (secrets scrubbed, a leading tag dropped; no Jev check); --trust marks it verified (asks on a terminal); --always sends it to Claude in every session
jevmem always [--off] <id> [<id>…]             Mark a line always-on (in Claude's context at the start of every session), or take the mark off
jevmem always --suggest [--apply]              Ask Jev which live lines are rules for every change and propose the marks; --apply sets them
jevmem forget <id> [<id>…]                     Retire a line in place: it stays in JEVMEM.md as [retired]; a rule asks for a yes on a terminal
jevmem trust <id> [<id>…]                      Mark a line you wrote as verified, after the poisoning gate (asks on a terminal); the guard can then block on it
jevmem import [--from <sources>] [--apply]     Import CLAUDE.md, AGENTS.md, .cursor/rules/* (claude-auto-memory on request); dry run by default
jevmem import --from sessions [--since 30d] [--apply]   Read this project's past Claude Code sessions; counts and asks before anything is sent
jevmem why <id|hash>                           Every Jev answer behind a line or a skipped turn
jevmem right <id|hash>                         Label a decision as correct
jevmem wrong <id|hash> [--should-be <kind|none>]   Label a decision as wrong (--should-be none retires the line)
jevmem missed "<text>" [--kind <kind>]         Label a turn that should have been saved
jevmem fit [--dry-run] [--force]               Refit weights and thresholds from labels (needs 40+)
jevmem stats                                   Writer, latency p50/p95, cost per day, cache hit rate, escalation rate, retry queue, labels, last fit
jevmem doctor                                  Is this project enabled, where the TypeSafe key comes from, which writer is active and why
jevmem key                                     Save your TypeSafe API key to ~/.jevmem/env (asks for it without showing it)
jevmem log                                     Per-label latency, token and cost summary of .jevmem/log.jsonl
jevmem guard test "<command>" | --edit <path>  Dry run of the PreToolUse guard on one call: rules, prefilter, Jev's answer, hook output
jevmem guard log [-n 20]                       The guard's recent asks and denials in this project, with the rule and score

These are 0.7.8's commands: 0.5.10's, jevmem guard (0.6.0), forget, trust and add --trust (0.7.0), always, add --always and import --from sessions (0.7.1), setup (0.7.2), and init --files (0.7.6). Every command accepts --help. Set JEVMEM_VERBOSE=1 for a one-line latency/cost summary after every hook run.

jevmem (Avinash-jetwani/jevmem)

Ищем в базе…

Что это?jevmem сохраняет решения, правила и неудачные подходы из ваших чатов с Claude Code (и другими кодинг-агентами) в файл JEVMEM.md в вашем репозитории, а затем подтягивает релевантные записи в следующих сессиях, чтобы контекст не терялся при новом чате.
Это библиотека для импорта или CLI/плагин, который я запускаю?Это CLI-инструмент, который устанавливается как плагин Claude Code, MCP-сервер и набор хуков; вы его устанавливаете и запускаете, а не импортируете как библиотеку кода.
Нужен ли API-ключ OpenAI или Anthropic?Нет — по умолчанию jevmem решает, что сохранять, через Jev API от TypeSafe AI, а не через LLM. Ключ нужен, только если вы выставите 'writer' в openai или anthropic в jevmem.config.json, чтобы сохранённую строку писала модель.
Воспоминания сохраняются автоматически в любом кодинг-агенте?Автоматическое сохранение работает только в Claude Code, а в Codex — пока запущен 'jevmem watch'; в Cursor и Claude Desktop записи сохраняются или вспоминаются лишь тогда, когда агент явно вызывает jevmem через MCP.
Какие данные уходят с моего компьютера и когда?jevmem работает только в проектах, где вы его включили; он отправляет ваше сообщение, два последних хода и строки воспоминаний в API TypeSafe для оценки, предварительно вычистив типовые секреты, email-адреса и номера карт. Ничто не уходит в OpenAI или Anthropic, пока вы не настроите модель 'writer'.
Что такое Jev?Jev — небольшая модель TypeSafe AI для типизированных вопросов, которую jevmem вызывает на каждом ходу, чтобы примерно за 0,28 секунды решить, стоит ли что-то сохранять и в каком виде, вместо полноценного вызова LLM.
Чем jevmem отличается от того, чтобы просто попросить LLM решить, что сохранять?На бенчмарке из 66 ходов jevmem 0.6.0 показал ту же точность сохранения/пропуска 98,5%, что и лучшая LLM, при 276 мс и $0.000157 за решение, против 2,8–4,3 с и до $0.013 у шести актуальных LLM; две модели (GPT-6 Astra, Claude Opus 5.5) точнее выбирали конкретный тип строки.
Что такое функция 'guard'?Начиная с v0.6.0, перед вызовом Bash, Edit или Write, который затрагивает путь, команду или слова, совпадающие с сохранённым правилом, Claude Code просит подтверждение — чтобы вы не нарушили уже принятое решение.
Какие есть похожие проекты?ownmem, context-mode, claude-mem, okf-agent-memory, ruflo, agent-router, headroom, Trail-Code
Автор
Avinash-jetwani
Размер
11 MB
Звёзды
153
Возраст
2 мес
Коммиты · 90 дней