Skip to content

agentmemory Lifecycle Hooks

Lets an agent automatically record its work sessions to memory, without manual saves

Stars
30,083
Licence
Apache-2.0
Files
3 files

What it does

This skill explains and helps set up the agentmemory plugin's lifecycle hooks, which watch an AI agent's session (tool use, prompts, session start and end, commits) and save notes about what happened so the agent can recall them later. Once installed, routine work is remembered without the agent having to call a save command. It also helps diagnose missing observations and tune what gets recorded.

Great for

  • Developers who use Claude Code, Devin, Cursor, Pi or similar agents and want persistent memory across sessions
  • Engineers debugging why past work is not appearing in agent memory
  • Teams deciding what their agent should record and what it should leave out

Skip it if

  • Users who do not want an agent recording its tool use and prompts, since captured observations can include sensitive content from the session
  • Environments where a local background server cannot run, because the hooks depend on the agentmemory server being active
  • Cloud-only Devin sessions, where the file notes plugin hooks do not run

Try asking

  • “Install the agentmemory plugin in Claude Code and confirm automatic capture is working”
  • “Why are my observations missing from agentmemory after a session?”
  • “Explain how agentmemory captures memory without manual saves”
  • “Which hook flags should I change to stop context injection?”
Step-by-step guide: how to use agentmemory Lifecycle HooksInstall, first run, examples, tips and FAQs

Install in 3 steps

  1. 1

    Download the skill

    The ZIP contains the 3 original files, the Apache-2.0 licence and an attribution note.

    agentmemory-hooks.zip
  2. 2

    Add it to your agent

    Claude Code (all projects)

    mkdir -p ~/.claude/skills && unzip agentmemory-hooks.zip -d ~/.claude/skills/

    Claude Code / Agent SDK (this project only)

    mkdir -p .claude/skills && unzip agentmemory-hooks.zip -d .claude/skills/

    Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.

  3. 3

    Ask for the task

    No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.

Get better results

  • After installing, run /hooks in Devin or check /agentmemory-status in Pi to confirm hooks are loaded, then do one real turn and check the viewer for an observation
  • Review the optional LLM settings (AGENTMEMORY_AUTO_COMPRESS, AGENTMEMORY_INJECT_CONTEXT) before enabling them, since they change what is sent to a model provider
  • Remember that a pending capture queue does not prove the event was stored; verify in the viewer

What's inside

  • REFERENCE.md
  • SKILL.md
  • TROUBLESHOOTING.md

Redistributed unmodified from rohitg00/agentmemory under the Apache-2.0 licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.