
Agentmemory Hooks
Understand and debug how the agentmemory Claude Code plugin auto-captures session memory via lifecycle hooks without manual saves.
Overview
agentmemory-hooks is an agent skill most often used in Build (also Operate monitoring, Grow support workflows) that documents the twelve Claude Code lifecycle hooks the agentmemory plugin uses to capture observations aut
Install
npx skills add https://github.com/rohitg00/agentmemory --skill agentmemory-hooksWhat is this skill?
- Documents 12 Claude Code lifecycle hook events that auto-capture observations
- Covers SessionStart/End, Pre/PostToolUse, UserPromptSubmit, TaskCompleted, SubagentStart/Stop, and more
- Explains handoff framing so sessions can resume without calling memory_save for routine work
- Install path via marketplace plugin: agentmemory with live UI at localhost:3113
- Reference for debugging missing observations and tuning capture scope
- 12 lifecycle hook events
- Live observation UI at http://localhost:3113
Adoption & trust: 3 installs on skills.sh; 21.9k GitHub stars; trending (+300% hot-view momentum).
What problem does it solve?
Your agent sessions feel amnesiac and you do not know which lifecycle events should be recording memory or why observations are missing.
Who is it for?
Claude Code users running the agentmemory plugin who want automatic observation capture and need a precise hook catalog for debugging or tuning.
Skip if: Builders not using Claude Code plugins, teams that want a generic vector-DB RAG skill with no hook model, or users who only need one-off manual memory_save calls.
When should I use this skill?
Explaining how memory gets captured without manual saves, debugging missing observations, or tuning what the agentmemory plugin records.
What do I get? / Deliverables
You can install and reason about hook-driven capture, debug gaps against the documented event list, and watch observations at the local agentmemory UI without manual save rituals.
- Hook event catalog aligned to hooks.json
- Operational mental model for automatic observation capture
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Canonical shelf is build agent-tooling because hooks are part of configuring how your coding agent remembers work across tools and sessions. Agent-tooling subphase covers plugin install, hook registration, and tuning what observations get recorded during real development.
Where it fits
After installing agentmemory, you map which hook fires on PostToolUse so refactors are captured without manual saves.
Production-minded solo builder verifies SessionEnd hooks flush observations before closing a long fix session.
You trace UserPromptSubmit hooks to see what context was stored when revisiting a customer bug thread weeks later.
How it compares
Reference meta-skill for plugin hook wiring—not a standalone memory store or MCP server integration.
Common Questions / FAQ
Who is agentmemory-hooks for?
Solo builders on Claude Code who installed agentmemory and need to understand or debug automatic memory capture across the session lifecycle.
When should I use agentmemory-hooks?
During Build agent-tooling setup; during Operate when diagnosing missing observations; when onboarding someone to how handoff and tool-use hooks frame each unit of work.
Is agentmemory-hooks safe to install?
Hooks observe prompts and tool activity—review Security Audits on this page and treat captured observations as potentially sensitive; tune PreToolUse and related hooks to match your compliance comfort.
SKILL.md
READMESKILL.md - Agentmemory Hooks
# agentmemory hooks reference Generated from `plugin/hooks/hooks.json`. Do not edit the block below by hand; run `npm run skills:gen` after changing the hook registration. <!-- AUTOGEN:hooks START - generated by scripts/skills/generate.ts, do not edit by hand --> The Claude Code plugin registers hooks on 12 lifecycle events to capture observations automatically: - `Notification` - `PostToolUse` - `PostToolUseFailure` - `PreCompact` - `PreToolUse` - `SessionEnd` - `SessionStart` - `Stop` - `SubagentStart` - `SubagentStop` - `TaskCompleted` - `UserPromptSubmit` <!-- AUTOGEN:hooks END --> --- name: agentmemory-hooks description: 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. user-invocable: false --- 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`.