agentmemory-hooks
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseThe Claude Code plugin registers lifecycle hooks so memory is captured automatically. You do not have to call for routine work; the hooks observe tool use, prompts, and session boundaries and write observations for you.
memory_saveClaude Code插件会注册生命周期钩子,从而自动捕获内存数据。在日常工作中,你无需调用;这些钩子会监控工具使用情况、提示词以及会话边界,并自动为你记录观察数据。
memory_saveQuick start
快速开始
Install the plugin and the hooks register themselves:
bash
/plugin marketplace add rohitg00/agentmemory
/plugin install agentmemoryWatch observations land live at .
http://localhost:3113安装插件后,钩子会自动注册:
bash
/plugin marketplace add rohitg00/agentmemory
/plugin install agentmemory可在实时查看观察数据。
http://localhost:3113What the hooks do
钩子功能
- Session start and end frame each unit of work and let resume it.
handoff - Tool-use hooks capture what changed and why, the raw material for and
recall.recap - Prompt-submit captures intent. Pre-compact preserves context before the host trims it.
- A post-commit hook links commits to sessions, which powers and
commit-context.commit-history
- 会话开始和结束钩子会标记每个工作单元,并允许功能恢复会话。
handoff - 工具使用钩子会捕获变更内容及原因,为和
recall功能提供原始数据。recap - 提示词提交钩子会捕获用户意图。预压缩功能会在宿主裁剪上下文之前保留相关内容。
- 提交后钩子会将代码提交与会话关联,为和
commit-context功能提供支持。commit-history
Important
重要说明
- Capture is on by default and is zero-LLM. Turning observations into LLM summaries () and injecting them back into context (
AGENTMEMORY_AUTO_COMPRESS) are separate opt-ins because they spend tokens.AGENTMEMORY_INJECT_CONTEXT - If observations are missing, confirm the plugin is enabled and the server is running. See ../_shared/TROUBLESHOOTING.md.
- 捕获功能默认开启,且无需调用大语言模型(LLM)。将观察数据转换为LLM摘要()并注入回上下文(
AGENTMEMORY_AUTO_COMPRESS)是独立的可选功能,因为这些操作会消耗令牌(tokens)。AGENTMEMORY_INJECT_CONTEXT - 如果观察数据缺失,请确认插件已启用且服务器正在运行。详见../_shared/TROUBLESHOOTING.md。
See also
另请参阅
- agentmemory-config for the capture and injection flags.
- The handoff, recap, and session-history skills consume what these hooks record.
- agentmemory-config:包含捕获和注入相关的配置标志。
- handoff、recap和session-history功能会使用这些钩子记录的数据。
Reference
参考文档
The exact registered hook events live in REFERENCE.md, generated from .
plugin/hooks/hooks.json已注册的具体钩子事件可查看REFERENCE.md,该文档由生成。
plugin/hooks/hooks.json