Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add commands/jasonhnd/life_os/memorygit clone --depth 1 https://github.com/jasonhnd/life_OSWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00028 | $0.00999 |
| Opus 5 | $0.00014 | $0.00500 |
| Sonnet 5 | $0.00006 | $0.00200 |
| Haiku 4.5 | $0.00003 | $0.00100 |
Grade A, and why
memory scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 88 lines — stays where its author put it; the contents beside it link to each section on GitHub.
/memory · 即时记忆 (v1.8.0 pivot)
v1.8.0 pivot 注解:之前调用
python -m tools.memory,但tools/memory.py在 v1.8.0 pivot 中被删除。v1.8.6/DR-10 后 Memory KV 改为 Markdown 文件。Memory 现在是一个扁平 KV 目录 (~/.claude/lifeos-memory/<key>.md),ROUTER 直接用 Write/Read tool 读写,没有 python 中间层。
Backup mode: 主要路径是 ROUTER 用 inline trigger rules 匹配 "记一下/提醒我/TODO/覚えて" 等关键词后自动 emit。这个命令是给"我想精确控制 key/value 格式"的备份。详见
hosts/CLAUDE.md→ Auto-Trigger Rules → Memory auto-emit。
User invoked: /memory $ARGUMENTS
数据结构
每条 memory 是 ~/.claude/lifeos-memory/<key>.md:
---
key: "<key>"
value: "<text>"
role: "礼/户/刑/工/吏/兵"
created: "<ISO8601>"
trigger_time: "<optional ISO8601 if value contains date/time>"
---
Key 推荐格式:reminder:<context> / decision:<topic> / note:<context>。
你要做的
emit <key>=<value>
-
解析
key和value -
推断
role:决策→刑、人际/学习/品牌→礼、财务→户、健康/数字基建→工、关系经营/团队→吏、项目执行→兵 -
如果
value含日期/时间 → 提取为trigger_time字段 -
用 Write 工具创建
~/.claude/lifeos-memory/<sanitized-key>.md(key 中的:改为__、/改为_) -
报告:
📚 已入档案柜 · key: <key> · role: <role> · trigger time: <if any> · 24h 后未完成会出现在状态行
read
- Glob
~/.claude/lifeos-memory/*.md - 对每个文件 Read 内容
- 按
created倒序列出 - 格式:
📚 当前 memory({N} 条) - <key> · <role> · <value 前 60 字>... · <created 相对时间> - ...
remove <key>
- Resolve sanitized path
Bash: rm ~/.claude/lifeos-memory/<sanitized-key>.md- 报告 "🗑️ 已删除 "
path
显示 ~/.claude/lifeos-memory/ 路径,ls -1 列出当前所有 key。
退朝时自动整理
退朝(archiver 流程)时,archiver 的 knowledge-extractor 会读 ~/.claude/lifeos-memory/ 评估哪些 memory 值得提升为 wiki/,哪些过期可删。本命令本身不参与晋升逻辑。
三层记忆分工
| 时长 | 位置 | 例子 |
|---|---|---|
| 即时(<48h) | ~/.claude/lifeos-memory/<key>.md |
临时提醒、临时决策 |
| 中期(week) | wiki/<topic>.md |
archiver 退朝时写 |
| 长期(年) | SOUL.md |
价值观、维度 |
Anti-pattern
- 不要把长 narrative 塞进 memory — 长内容应该写到 wiki/
- 不要尝试调用已删除的
tools/memory.py(v1.8.0 pivot 删了)—— 直接 Write 文件 - 不要在 key 里用
/或:之外的奇怪字符(保持文件名安全)
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago First seen · 88 lines · 28 tokens per session scan A 1fda00f5d9df
memory is a command published in the GitHub repository jasonhnd/life_OS (5 stars, last pushed 25d ago), licensed Apache-2.0. It adds 28 tokens to every session and 999 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other commands, from other repositories
prompt
System instructions for writing effective prompts. Apply when generating commands, skills, agents, or any LLM instructions.
full
Run the full hope pipeline — intent, shape, target, freeze as needed — then execute.
language-mode-commands
Sets the output language for all system responses. Supports any language the underlying model can produce fluently. Persists across sessions.
output-commands
Reformatting, exporting, and comparing analysis outputs from skills and playbooks.
premortem
Assume your idea has already failed — work backward to find out why.
release
Prepare a release: bump version, finalize CHANGELOG, and show the git tag command.