Jevmem – 为 Claude Code 提供的自动项目记忆功能,基于 Jev 构建。
Jevmem – automatic project memory for Claude Code, built on Jev

原始链接: https://github.com/Avinash-jetwani/jevmem

**jevmem** 是一款专为开发者打造的工具,旨在通过将 AI 编码会话中的决策、约束、Bug 和待办事项(TODOs)保存至本地的 `JEVMEM.md` 文件中,从而自动管理项目上下文。 与传统的日志不同,它将记忆视为一个版本化的流:当决策发生变更时,旧的内容会被标记为 `[superseded]`(已取代),而不会被直接删除。这些记忆会在后续的会话中自动注入到 AI 代理的上下文中。 **主要功能:** * **集成性**:原生支持 Claude Code(自动),并通过 MCP 或规则文件支持 Cursor、Codex 和 Claude Desktop。 * **高效性**:使用专门的高速 "Jev" API 来判断是否需要保存当前对话。相比使用标准大语言模型进行筛选,其速度显著提升(0.3秒 vs 3秒以上),且成本更低。 * **安全性**:在数据离开本地之前,自动在本地清除敏感信息(如 API 密钥、密码、电子邮件)。 * **可审计性**:内置审计、搜索及手动标记决策的工具,以便随着时间推移不断提高系统的准确性。 尽管高端大语言模型(如 Claude Opus)可能在分类准确度上略胜一筹,但 jevmem 在速度、成本和自动化项目持久化之间提供了最佳平衡。

这篇 Hacker News 讨论聚焦于 **Jevmem** 的发布,这是一个为 Claude Code 等 AI 编程智能体自动追踪项目历史和决策过程的工具。 虽然开发者强调了它在整理相关项目笔记和处理“想法变更”方面的效率,但用户表达了强烈的怀疑。讨论中的一个反复出现的主题是 AI 生成文档的“平庸(slop)”特征:参与者指出,现代 AI 编写的 README 文件往往充斥着冗余的技术细节,却无法阐明项目的核心目的或“为何如此”的初衷。 除了文档质量,评论者还提出了对数据隐私的担忧,特别是 Jevmem 需要将对话数据发送给第三方供应商(TypeSafe AI)。其他人则质疑将“已过时”的决策保留在上下文窗口中的设计选择,认为这会用过时的信息干扰 AI 的记忆。总体而言,这次讨论是对 AI 辅助技术写作现状的一次广泛批评,贡献者们认为,人类的判断力在创建有用、清晰且优雅的文档方面仍然是不可或缺的核心。
相关文章

原文

Automatic project memory for Claude Code. Also works with Cursor and Codex.

npm version license node CI M8ven Verified

jevmem-launch-readme-v2.mp4
  • Saves decisions, constraints, bugs and todos from your Claude Code chats into JEVMEM.md, automatically.
  • When you change your mind, the old line is marked superseded, not deleted.
  • Next session, the relevant lines are added to Claude's context.
- [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 -->
npm install -g jevmem
export TYPESAFE_API_KEY=...        # https://typesafe.ai (an OpenAI or Anthropic key is optional)
cd your-project
jevmem init --tool claude

init creates JEVMEM.md, jevmem.config.json and a gitignored .jevmem/ folder, and registers two Claude Code hooks in .claude/settings.local.json, which it adds to .gitignore (details).

What is automatic and what depends on the agent:

Tool Setup Capture Recall
Claude Code 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 jevmem init --tool cursor Agent-initiated: a .cursor/rules/jevmem.mdc rule tells the agent to call MCP add_memory when you state a decision. Nothing is captured if it doesn't Agent-initiated: the rule tells it to call search_memory before non-trivial tasks
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

MCP add_memory goes through the same gate as the hook. Client configs: docs/mcp.md.

  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? 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.
  4. Write one line. On save, a small LLM (or a deterministic extract, with no LLM key) writes one line of at most 200 characters.
  5. Supersede the old line. If the turn replaces an existing memory, that line is tagged [superseded] … → id:new and stays in the file.

Tiers, questions, policy, contradictions, recall and audit: docs/how-it-works.md.

66 held-out turns, all seven deciders given the same state, 2026-09-23 (method, regression set, pricing, p95, retries):

Decider save/skip save+kind contradictions p50 $/decision
GPT-6 Astra 98.5% 98.5% 5/5 3,469 ms $0.007489
GPT-6 Luna 93.9% 93.9% 5/5 2,927 ms $0.000089
Claude Fable 5.1 95.5% 95.5% 5/5 4,290 ms $0.013256
Claude Opus 5.5 97.0% 97.0% 5/5 2,784 ms $0.005186
Gemini 3.8 Flash 92.4% 92.4% 5/5 2,850 ms $0.001174
Grok 4.7 90.9% 90.9% 4/5 3,320 ms $0.004602
jevmem auto 98.5% 95.5% 5/5 300 ms $0.000127

The 0.30 s is the Jev API decision; through a real Stop hook process, Node start-up included, it is 0.6 s end to end (cost and latency).

On 66 held-out turns, jevmem's median decision took 0.30 s, against 2.8–4.3 s for six current LLMs. Its accuracy was within the LLMs' range: 98.5% save/skip (tied with GPT-6 Astra for highest) and 95.5% save+kind, against 90.9–98.5% for the LLMs. GPT-6 Astra (98.5%) and Claude Opus 5.5 (97.0%) were more accurate on save+kind; Claude Fable 5.1 tied; GPT-6 Luna, Gemini 3.8 Flash and Grok 4.7 were less accurate. It found 5/5 contradictions, as did five of the six LLMs. GPT-6 Luna was cheaper ($0.000089 against $0.000127) but less accurate (93.9%) and about 10× slower. This is a single run, and differences of one or two turns are within run-to-run noise. If the most accurate decision matters most, GPT-6 Astra or Claude Opus 5.5 are better, at about 40–60× the cost per decision and 9–12× the latency. jevmem is for when you want a fast, cheap decision on every message.

  • Sent to TypeSafe AI: the user message of each turn (and the assistant reply for questions and bug reports), the previous two turns, and your memory lines, to be scored. No telemetry. If you set an OpenAI or Anthropic key, the text of a saved turn also goes to that provider to write the line.
  • Scrubbed first: common credential shapes (API keys, tokens, *_PASSWORD= style pairs, connection-string passwords, private keys), email addresses and 16-digit numbers; names, phone numbers and addresses are not caught.
  • Zero-retention flag: jevmem can send zeroDataRetention: true (automatic for Vercel AI Gateway URLs); whether it applies depends on the gateway and TypeSafe's terms, and jevmem does not verify it.

Exactly what is sent, stored and scrubbed: SECURITY.md.

  • Early: v0.4; both eval sets were written by the author, and neither is an independent benchmark.
  • Not the most accurate: GPT-6 Astra and Claude Opus 5.5 scored higher on save+kind; jevmem's edge is speed and cost.
  • Recall quality is not measured: that relevant lines are injected is tested; whether answers get better is not.
  • Long-run drift is not measured: the harness covers five-turn sessions, not weeks of use.
  • Automatic capture is Claude Code only (and Codex while jevmem watch runs); Cursor and Claude Desktop save only when the agent calls add_memory.
  • Jev outages drop turns: each Jev call has a 2 s budget; when the API is slow or down, the turn is skipped and logged in .jevmem/log.jsonl, not retried later.
jevmem init [--tool claude|cursor|codex|claude-desktop|all] [--no-hooks] [--command "<cmd>"]
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
jevmem mcp [--root <dir>]                      Stdio MCP server
jevmem audit [--dry-run]                       Re-score every memory against the repo, flag [stale?]
jevmem search <query> [--limit N]              Rank memories by relevance
jevmem list [--all]                            Print memories
jevmem add <kind> <text>                       Add a line by hand (secrets scrubbed; no Jev check)
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
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                                   Latency p50/p95, cost per day, cache hit rate, escalation rate, labels, last fit
jevmem log                                     Per-label latency, token and cost summary of .jevmem/log.jsonl

Every command accepts --help. Set JEVMEM_VERBOSE=1 for a one-line latency/cost summary after every hook run.

联系我们 contact @ memedata.com