# How do I use jevmem in Claude Desktop?

Run `jevmem init --tool claude-desktop` in your project and paste the config snippet it prints into Claude Desktop's `claude_desktop_config.json`: that starts jevmem's MCP server for that one project, and jevmem then saves a line when you ask Claude to call `add_memory` and looks lines up when you ask for `search_memory`.

Last updated: 2026-11-29 · jevmem 0.7.11 · [Install](https://jevmem.dev/install/) · [Source on GitHub](https://github.com/Avinash-jetwani/jevmem)

Nothing is automatic in Claude Desktop: it has no hook and no rule file, so jevmem acts only when you ask. A line added this way goes through the same check as a Claude Code turn: on 66 held-out turns that check was right on save or skip for 98.5% (jevmem 0.7.1, one run on 2026-10-13, [results](https://github.com/Avinash-jetwani/jevmem/blob/main/results/eval-heldout-2026-10-13-v071.json)). Those turns were given to the decider directly; nothing has been measured inside Claude Desktop.

## Set it up

1. Install the CLI:
   ```bash
   npm install -g jevmem
   ```
2. In your project's folder:
   ```bash
   jevmem init --tool claude-desktop
   ```
3. Paste the snippet it prints into the config file named below, with your [TypeSafe API key](https://console.typesafe.ai/keys) in its `env`, and restart Claude Desktop.

Every install path: [install](https://jevmem.dev/install/).

## The MCP config

`~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows). Claude Desktop does not inherit your shell and has no project directory, so name the project with `--root` and give the key explicitly. One config entry serves one project:

```json
{
  "mcpServers": {
    "jevmem": {
      "command": "npx",
      "args": ["-y", "jevmem", "mcp", "--root", "/absolute/path/to/your-project"],
      "env": { "TYPESAFE_API_KEY": "<your TypeSafe API key>" }
    }
  }
}
```

## What Claude can call

`jevmem mcp` starts a stdio MCP server with four tools:

| Tool | Args | Jev calls | Annotations (readOnly / destructive / idempotent / openWorld) |
|---|---|---|---|
| `search_memory` | `query`, `limit?` | 1 (choice over ids + noul per candidate, + a poisoning-gate noul per unverified, unchecked candidate) | true / false / true / true |
| `add_memory` | `text`, `kind` | 1, or 2 on a borderline line (the hook's decide: scrub, then refuse injection / small talk; since 0.7.0 a line a live memory already says is not added and the answer names that line, `duplicate_of`, with no error; Jev may correct the kind; a contradiction supersedes the old line) | false / true / false / true |
| `list_memory` | `include_superseded?` | 0, or 1 when unverified lines have no cached gate verdict (the poisoning gate alone) | true / false / true / true |
| `audit_memory` | `apply?` | ⌈memories / 60⌉ | false / true / true / true |

In a project without `jevmem.config.json` (not opted in with `jevmem enable` or `jevmem init`) every tool returns only "jevmem isn't enabled in this project: run `jevmem enable`" and does nothing else: no Jev call, no file.

`search_memory` and `list_memory` never return a line the [poisoning gate](https://github.com/Avinash-jetwani/jevmem/blob/main/SECURITY.md#memory-poisoning) withholds (they list it under `withheld` with the reason instead), and `list_memory` without a key withholds unverified lines it cannot check. Both are marked open-world because they may ask Jev.

`add_memory` takes `kind` ∈ `decision | constraint | preference | bug | architecture | todo`, and, since 0.6.0, `dead-end`: an approach that was tried and failed or was dropped. A dead-end line must say what was tried and why, and Jev decides whether it does (the dead-end noul, in the request `add_memory` already makes, at `thresholds.deadEndMin`), or it is refused ("a dead end must say why it failed or was dropped, and Jev found no reason in this line"); a line Jev reads as a dead end with no reason keeps the kind you gave. A retry of a saved dead end that failed again for the reason that line gives is refused ("a retry that failed again adds nothing"); for a new reason, the saved line is the old line's reason followed by "retried:" and yours, and it replaces the old line ([Dead ends](https://github.com/Avinash-jetwani/jevmem/blob/main/docs/dead-ends.md#when-it-is-tried-again)). `search_memory` and `list_memory` return dead ends with `"kind": "dead-end"`; the Claude Code hook injects them as `Already tried: <line>` ([Dead ends](https://github.com/Avinash-jetwani/jevmem/blob/main/docs/dead-ends.md)).

Both writing tools are marked destructive because they can change existing lines, not only add new ones: `add_memory` re-tags a contradicted memory `[superseded]`, which takes it out of what is served (the line stays in the file), and `audit_memory` with `apply: true` sets or clears `[stale?]` flags on existing lines (flagged lines keep their text and stay live).

The `Dockerfile` at the repository root is for MCP directories that inspect a server in a sandbox (Glama builds it, starts the server and calls `tools/list`): it installs the jevmem CLI from npm and starts `jevmem mcp` on an empty folder, where the server lists its four tools and a call to one replies that jevmem isn't enabled there. It needs no key. It is not a way to run jevmem: the server works on the project it is started in.

## What is automatic in each tool

What is automatic and what depends on the agent:

| Tool | Setup | Capture | Recall |
|---|---|---|---|
| **Claude Code** | the plugin, or `jevmem init --tool claude` | **Automatic**, every turn, via the `Stop` hook | **Automatic**, every prompt, via `UserPromptSubmit` |
| **Codex** | `jevmem init --tool codex` | **Automatic while `jevmem watch` runs** (it tails Codex's session log for this project and runs the same decide → write path); otherwise agent-initiated via MCP `add_memory`, prompted by an `AGENTS.md` section | Agent-initiated: `search_memory` via MCP, prompted by `AGENTS.md` |
| **Cursor** | [the Cursor plugin](https://jevmem.dev/install/#the-cursor-plugin-076) (0.7.6), or `jevmem init --tool cursor` | **Automatic since 0.7.4**, every finished agent turn, via Cursor's hooks (the plugin's, or the project's in `.cursor/hooks.json`; the app's `stop` hook, the `agent` CLI's `sessionEnd`), through the same decide and write path as Claude Code ([what was measured](https://github.com/Avinash-jetwani/jevmem/blob/main/docs/hooks.md#cursor-hooks-074)). Before 0.7.4: only when the agent called MCP `add_memory` | Agent-initiated: the rule (the plugin's, or `.cursor/rules/jevmem.mdc`) tells it to call `search_memory` before non-trivial tasks (Cursor's prompt hook takes no context, so recall is not automatic there). The plugin's MCP server runs in every window from the start; a project's `.cursor/mcp.json` server starts only after you turn it on once in the Cursor app, Customize → MCPs → jevmem → Configure → the source toggle for `.cursor/mcp.json`, then Reload ([the step](https://github.com/Avinash-jetwani/jevmem/blob/main/docs/mcp.md#cursor)) |
| **Claude Desktop** | `jevmem init --tool claude-desktop` prints a config snippet to paste (one project per config, named with `--root`) | Manual: ask it to call `add_memory` (no hook, no rule file) | On request: `search_memory` |

**The guard** (0.7.9) runs in all three: in Claude Code through the `PreToolUse` hook; in Cursor through the plugin's or the project's `beforeShellExecution` and `preToolUse` hooks (the app asks about shell commands; edits, deletes and the `agent` CLI's calls are stopped until you run `jevmem guard allow <code>`); in Codex through the project's `.codex/hooks.json`, which `jevmem init --tool codex` writes and each person trusts once in `/hooks` (Codex 0.171 or newer). See [Guardrails](https://jevmem.dev/guard/#cursor-and-codex-079).

MCP `add_memory` goes through the same gate as the hook. Client configs: [docs/mcp.md](https://github.com/Avinash-jetwani/jevmem/blob/main/docs/mcp.md).

## The limits, in short

- jevmem needs a TypeSafe API key ([where to get one, and the install steps](https://jevmem.dev/install/)).
- Message text is sent to TypeSafe to be scored, with common secrets scrubbed first ([what leaves your machine](https://jevmem.dev/privacy/)).
- 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 watch` runs, 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](https://jevmem.dev/install/#works-with)).
- 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](https://jevmem.dev/compare/)).
- The guard is a backstop, not a sandbox ([what it misses](https://jevmem.dev/guard/#limits)). In Cursor and Codex it is a hook, and a hook that times out or fails lets the call run.
- 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](https://jevmem.dev/pane/)).

Every limit, with the numbers: [the FAQ](https://jevmem.dev/faq/#what-are-jevmems-limits).
