Agentmemory Hooks

作者 rohitg00007a1a7fe864无许可证29K 个星标收录于 2026年10月8日更新于 2026年10月8日仓库今天更新

The agentmemory plugin hooks that capture observations automatically across the agent session lifecycle. Use when explaining how memory gets captured without manual saves, when debugging missing observations, or when tuning what gets recorded.

仅含说明AI & Agents
AI 生成的概览

说明 agentmemory 插件用于在代理会话生命周期中自动捕获观察记录的生命周期钩子。

功能
这是一份参考文档,说明 agentmemory Claude Code 插件如何注册生命周期钩子,从而无需手动保存即可自动捕获观察记录。内容涵盖会话开始与结束的界定、工具使用捕获、提示提交时的意图捕获、压缩前的上下文保留,以及将提交与会话关联的提交后钩子。文档还指出捕获默认开启且不消耗 LLM,而 LLM 摘要与上下文注入是单独的选项,并指向故障排查与相关技能。
适用场景
适用于解释记忆如何在无需手动保存的情况下被捕获、排查观察记录缺失的问题,或调整记录内容时。
运行要求
需要安装 agentmemory Claude Code 插件并运行其服务器;文档中提到了本地服务器地址和一个共享的故障排查文件。

The Claude Code plugin registers lifecycle hooks so memory is captured automatically. You do not have to call memory_save for routine work; the hooks observe tool use, prompts, and session boundaries and write observations for you.

Quick start

Install the plugin and the hooks register themselves:

bash
/plugin marketplace add rohitg00/agentmemory/plugin install agentmemory

Watch observations land live at http://localhost:3113.

What the hooks do

  • Session start and end frame each unit of work and let handoff resume it.
  • Tool-use hooks capture what changed and why, the raw material for recall and recap.
  • Prompt-submit captures intent. Pre-compact preserves context before the host trims it.
  • A post-commit hook links commits to sessions, which powers commit-context and commit-history.

Important

  • Capture is on by default and is zero-LLM. Turning observations into LLM summaries (AGENTMEMORY_AUTO_COMPRESS) and injecting them back into context (AGENTMEMORY_INJECT_CONTEXT) are separate opt-ins because they spend tokens.
  • If observations are missing, confirm the plugin is enabled and the server is running. See ../_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.

Reference

The exact registered hook events live in REFERENCE.md, generated from plugin/hooks/hooks.json.

来源与署名

来源:rohitg00/agentmemory位于plugin/skills/agentmemory-hooks提交007a1a7

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架