关于 memory
用于搜索未载入上下文的追加式 JSONL 历史日志的 skill,指导 Agent 使用 grep 定位过往事件并查看匹配记录。
主要功能
- 01搜索系统提示指定的历史日志
- 02先统计匹配数再缩小范围
- 03匹配字面时间戳和 JSON 片段
- 04分页查看结果及相邻记录
适用场景
- 01查找项目的早前讨论
- 02按主题或日期定位历史记录
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ hkuds/ nanobot --skill memory安装后在 Claude Code 中输入/memory确认已加载。
详细介绍
记忆
搜索过往事件
用 grep 搜索系统提示词中确切的 History log 路径;项目相对的
memory/history.jsonl 可能属于另一个工作区。该日志是仅追加的 JSONL,
每条记录包含 cursor、timestamp 和 content,且不会加载到上下文中。
先用 output_mode="count" 进行宽泛搜索,然后按主题或日期缩小范围并请求
匹配的内容。对于字面时间戳或 JSON 片段,使用 fixed_strings=true。
用 head_limit / offset 对较长的结果分页,当附近条目重要时使用
context_before / context_after。
示例(将 <history-log-path> 替换为系统提示词中的路径):
grep(pattern="project-name", path="<history-log-path>", output_mode="content", case_insensitive=true, head_limit=20)
评论
支持 Markdown