Skip to main content
Claude Code is the primary supported agent. Agent Memory integrates directly via Claude Code’s plugin system and hooks, capturing every tool use automatically — no prompting, no manual saves. Once connected, Claude Code remembers your architecture decisions, file conventions, and past debugging work across every future session.

Installation

Install Native Skills (optional)

Run this after connecting to install 15 custom skills that let Claude Code trigger memory operations directly by name:
npx skills add rohitg00/agentmemory -y
This installs 15 skills:
  • 8 action skills you can invoke directly: /recall, /remember, /recap, /handoff, /forget, /commit-context, /commit-history, /session-history
  • 7 reference skills Claude Code loads on demand: MCP tools reference, REST API reference, config guide, agents guide, hooks guide, architecture overview, and a skill-authoring guide
These skills teach Claude Code when and how to call the underlying memory tools — without them, the agent still has access to the tools but may not use them as proactively.

How Hooks Work with Claude Code

When you install via the plugin marketplace, Agent Memory registers as a pre/post tool use hook inside Claude Code. Claude Code fires these hooks automatically around every tool call — you do nothing differently. Here is what gets captured without any manual effort:

File reads and writes

Every Read, Write, and Edit tool call is recorded with file path, project context, and the agent’s reasoning.

Bash commands

Shell executions are captured with their output, so Agent Memory learns which commands you run for which tasks.

Web and codebase searches

Search queries and their results build a picture of what your agent looked for and what it found.

Conversation turns

Session start and end events create session boundaries, so memories are grouped by the work you were doing.
Claude Code fires 12 lifecycle hooks in total: SessionStart, UserPromptSubmit, PreToolUse, PostToolUse, PreCompact, Stop, SubagentStart, SubagentStop, Notification, TaskCompleted, PostToolUseFailure, and SessionEnd. Agent Memory listens to all of them.

CLAUDE_MEMORY_BRIDGE

Enable bi-directional sync between Agent Memory and your CLAUDE.md file:
CLAUDE_MEMORY_BRIDGE=true agentmemory
With the bridge enabled, Agent Memory writes key decisions and patterns to CLAUDE.md as they accumulate, and reads from it as additional context during recall. This means your CLAUDE.md stays current automatically instead of going stale.

Available MCP Tools

When connected via the plugin or ~/.claude.json, Claude Code has access to these tools. It calls them automatically via hooks — or you can invoke them directly in your prompt:
ToolWhat it does
memory_recallFull-text and semantic search across all past observations
memory_saveExplicitly save an insight, decision, or pattern
memory_smart_searchHybrid BM25 + embedding search with RRF fusion and reranking
memory_file_historyRetrieve all past observations about a specific file
memory_patternsSurface recurring patterns across sessions
memory_sessionsList recent sessions with summaries
memory_timelineChronological view of observations
memory_profileFull project profile: key concepts, files, and patterns
The plugin exposes all 53 tools when the Agent Memory server is reachable. To limit the tool surface for smaller context windows, set AGENTMEMORY_TOOLS=core when starting the server.

Hooks-Only Wiring (MCP-Standalone Path)

If you used agentmemory connect claude-code instead of the plugin install, Claude Code cannot resolve ${CLAUDE_PLUGIN_ROOT} and hook scripts need absolute paths. Run this to wire hooks using absolute paths from the currently installed package:
agentmemory connect claude-code --with-hooks
This merges hook entries into ~/.claude/settings.json with absolute paths. Re-run this command after upgrading Agent Memory to refresh the paths — user-defined hook entries in the file are preserved.
The MCP-standalone path (manual ~/.claude.json wiring) without --with-hooks means hooks will not fire. You get MCP tools but no automatic capture. The plugin marketplace install is the recommended approach precisely because it handles both.

Verification

After connecting, open a new Claude Code session. You should see a line like Loaded N memories in the session context. To confirm hooks are working:
agentmemory status
Run a few tool-use operations in Claude Code (read a file, run a command), then check status again. The hook count should be incrementing. You can also watch memories arrive live at http://localhost:3113.