把项目记忆提交进代码仓库
代码背后的取舍与被否掉的死胡同,随代码一起留在仓库里
八月份你的智能体在 webhook 发送端试过带抖动的重试(retry with jitter),结果破坏了幂等性又回滚了。这件事只留在你本机的会话历史里。队友在新克隆的仓库里遇到慢接收端时,他的智能体还会再提议一次同样的错法。deja sync 负责在你自己的多台机器之间同步历史;而 deja repo 则把真正值得全员知道的那几条结论随仓库一起移交给协作者。
挑选并写入条目
$ deja repo candidates 2 candidates for webhooks, newest first. nothing is written until you pick 4cd7e7bb9c rejected Reverted the retry with jitter: it broke idempotency because the sender re-signs each attempt with a new delivery id. (session s1, claude 2026-08-03) c5ea828bb3 decision Reverted the retry with jitter: it broke idempotency because the sender re-signs each attempt with a new delivery id. We decided to keep one delivery id per event and let the outbox table own retries. (session s1, claude 2026-08-03) add the ones that hold for everyone: deja repo add <id> [<id>...] $ deja repo add 4cd7e7bb9c added 1 entry to .deja/memory.jsonl wrote .deja/.gitattributes so parallel additions merge line by line, and a short .deja/README.md for whoever opens the folder nothing is committed: review with `git diff .deja/` and commit it like code
候选条目来自该项目在所有智能体里的历史:你提升过的笔记、deja remember 记录的事项、会话中回滚过的方案(rejected)以及最终敲定的做法(decision)。你也可以直接手写一条:
deja repo add --kind gotcha "预发环境的接收端会丢弃超过 1 MB 的 payload"
文件里存了什么
{"id":"4cd7e7bb9c","kind":"rejected","text":"Reverted the retry with jitter: it broke idempotency because the sender re-signs each attempt with a new delivery id.","date":"2026-10-25","from":"claude 2026-08-03"}
每条记录占一行 JSON,kind 为 decision、rejected 或 gotcha。不会写入本机路径、会话 ID、机器名或用户名,并且在写入前会自动经过密钥脱敏以及主目录路径、邮箱、内网主机名和私有 IP 清洗。条目按 ID 排序并配有 .deja/.gitattributes(memory.jsonl merge=union),多分支并行添加时能按行无冲突合并。
队友克隆仓库后会得到什么
克隆仓库后,只要安装了 deja,无论队友用的是 Claude Code、Codex 还是 Cursor,这些条目都会在会话启动与按需召回时自动出现(以不可信参考数据的安全边界包裹,绝不当作指令执行)。对于陌生仓库,也可以在信任策略里设置 {"activations": {"auto": {"repo": false}}} 关闭自动注入,仅保留手动搜索。
快速开始 · 隐私与信任边界 · 给 Claude Code 加记忆
觉得有用?欢迎在 GitHub 上给 deja-vu 点颗 Star。