Context Brief v3.0
Install: INLINECODE0
Persistent context survival. Captures what matters before it's lost — and restores it when needed.
Writes ONLY to memory/anchors/. Reads MEMORY.md and daily logs — never modifies them.
Language
Detect from the user's message language. Default: English.
How It Works
Three levels of action, based on user request or trigger:
Level 1 — Context Note (1-2 unsaved items, low risk)
- - Append a brief note to your response, no file writes
- Example: INLINECODE2
Level 2 — Anchor (3+ unsaved items OR user says "save context")
- - Write anchor file to INLINECODE3
- Show summary to user after saving
- Anchor contains task state, decisions, pending items — never credentials or secrets
Level 3 — Deep Anchor (user explicitly requests "save context deep" or "context check")
- - Full anchor with all categories
- User gets the summary
Triggering
Anchors are written when the user explicitly asks ("save context", "context check", "hva husker du", "preserve context") or when resuming after time away.
Do NOT auto-save without user request. Level 2+ requires user initiation or explicit consent.
Write Permissions
| File | Read | Write |
|---|
| INLINECODE4 | ✅ | ✅ — Only location this skill writes to |
| INLINECODE5 |
✅ | ❌ — Never modified |
|
MEMORY.md | ✅ | ❌ — Recommend changes to user |
|
HEARTBEAT.md | ✅ | ❌ — Read only |
Anchor File Format
Write to memory/anchors/YYYY-MM-DDTHH-mm.md:
CODEBLOCK0
Rules:
- - Create
memory/anchors/ if it doesn't exist - ISO 8601 timestamps
- Max 20 lines — prioritize ruthlessly
- REDACT secrets — strip any line containing: password, token, apikey, secret, bearer, privatekey, or credential patterns
- One anchor per checkpoint — never append to old anchors
After Writing
Show user (in their language):
CODEBLOCK1
Recovery — On Resume
When resuming or after compaction:
- 1. Check
memory/anchors/ for recent files (last 48h) - If anchor found and items are missing from conversation:
Restored from anchor: [brief list of items]
Continuing: [last active task]
- 3. If no anchor and context feels lost, ask the user what they were working on.
What This Skill Does NOT Do
- - Does NOT modify MEMORY.md, HEARTBEAT.md, or daily logs
- Does NOT auto-save without user request or consent
- Does NOT store credentials or secrets
- Does NOT restore silently — always informs user
- Does NOT create files outside INLINECODE11
Guidelines for Agent
- 1. Wait for user trigger — "save context", "context check", or resume
- Keep it short — 20 lines max per anchor
- Redact secrets aggressively — strip any sensitive patterns
- Inform on restore — never restore silently
- Only write to
memory/anchors/ — nowhere else - One anchor per checkpoint — new file each time
- Language follows user — anchor content in the language being used
- Timestamp everything — ISO 8601
More by TommoT2
- - cross-check — Auto-detect and verify assumptions in your responses
- setup-doctor — Diagnose and fix OpenClaw setup issues
- locale-dates — Format dates/times for any locale
Install the full suite:
CODEBLOCK3
Context Brief v3.0
安装: clawhub install context-brief
持久化上下文留存。在重要信息丢失前捕获它——并在需要时恢复。
仅写入 memory/anchors/。 读取 MEMORY.md 和每日日志——绝不修改它们。
语言
根据用户消息语言检测。默认:英语。
工作原理
基于用户请求或触发条件,分为三个操作级别:
级别 1 — 上下文备注(1-2 个未保存项,低风险)
- - 在回复中附加简短备注,不写入文件
- 示例:未保存的上下文:[决策 X 待定,路径 Y 重要]
级别 2 — 锚点(3 个以上未保存项,或用户说“保存上下文”)
- - 将锚点文件写入 memory/anchors/
- 保存后向用户显示摘要
- 锚点包含任务状态、决策、待办项——绝不包含凭证或密钥
级别 3 — 深度锚点(用户明确请求“保存上下文深度”或“上下文检查”)
触发条件
当用户明确要求(“保存上下文”、“上下文检查”、“hva husker du”、“保留上下文”)或长时间离开后恢复时,写入锚点。
未经用户请求,请勿自动保存。 级别 2 及以上需要用户发起或明确同意。
写入权限
| 文件 | 读取 | 写入 |
|---|
| memory/anchors/*.md | ✅ | ✅ — 此技能唯一写入位置 |
| memory/YYYY-MM-DD.md |
✅ | ❌ — 绝不修改 |
| MEMORY.md | ✅ | ❌ — 向用户建议更改 |
| HEARTBEAT.md | ✅ | ❌ — 只读 |
锚点文件格式
写入 memory/anchors/YYYY-MM-DDTHH-mm.md:
markdown
锚点 — YYYY-MM-DDTHH:mm+ZZ:ZZ
活动状态
- - 任务:[我们在做什么]
- 状态:[进行中 / 受阻 / 等待中]
决策
待办
关键路径
规则:
- - 如果 memory/anchors/ 不存在,则创建它
- ISO 8601 时间戳
- 最多 20 行——严格优先排序
- 删除机密——删除包含以下内容的任何行:password、token、apikey、secret、bearer、privatekey 或凭证模式
- 每个检查点一个锚点——绝不追加到旧锚点
写入后
向用户显示(使用他们的语言):
上下文已锚定(N 项)→ memory/anchors/YYYY-MM-DDTHH-mm.md
恢复 — 恢复时
当恢复或压缩后:
- 1. 检查 memory/anchors/ 中的最近文件(最近 48 小时)
- 如果找到锚点且对话中缺少项目:
已从锚点恢复:[项目简要列表]
继续:[最后一个活动任务]
- 3. 如果没有锚点且上下文感觉丢失,询问用户之前正在做什么。
此技能不做什么
- - 不修改 MEMORY.md、HEARTBEAT.md 或每日日志
- 未经用户请求或同意,不自动保存
- 不存储凭证或密钥
- 不静默恢复——始终通知用户
- 不在 memory/anchors/ 之外创建文件
给代理的指南
- 1. 等待用户触发——“保存上下文”、“上下文检查”或恢复
- 保持简短——每个锚点最多 20 行
- 积极删除机密——删除任何敏感模式
- 恢复时通知——绝不静默恢复
- 仅写入 memory/anchors/——不写入其他位置
- 每个检查点一个锚点——每次新建文件
- 语言跟随用户——锚点内容使用正在使用的语言
- 为所有内容添加时间戳——ISO 8601
更多来自 TommoT2
- - cross-check — 自动检测并验证回复中的假设
- setup-doctor — 诊断并修复 OpenClaw 设置问题
- locale-dates — 为任何区域设置格式化日期/时间
安装完整套件:
bash
clawhub install context-brief cross-check setup-doctor locale-dates