Prerequisite: Install the
engram binary first via Homebrew or binary download.Option A: Marketplace Plugin (Recommended)
Install from Claude Code’s plugin marketplace:Option B: Setup via Engram Binary
Install the same plugin from the embedded binary:~/.claude/settings.json permissions allowlist. This prevents Claude Code from prompting for confirmation on every memory operation.
Option C: Bare MCP (No Hooks)
Just the 13 memory tools, no session management: Add to.claude/settings.json (project) or ~/.claude/settings.json (global):
CLAUDE.md so the agent remembers to use Engram after context resets.
What the Plugin Provides
| Feature | Bare MCP | Plugin |
|---|---|---|
| 13 memory tools | ✓ | ✓ |
| Session tracking (auto-start) | ✗ | ✓ |
| Auto-import git-synced memories | ✗ | ✓ |
| Compaction recovery | ✗ | ✓ |
| Memory Protocol skill | ✗ | ✓ |
| Previous session context injection | ✗ | ✓ |
Plugin Structure
How the Plugin Works
SessionStart Hook (startup)
Runsscripts/session-start.sh:
- Ensures
engram serveis running - Creates a session via HTTP API
- Auto-imports git-synced chunks from
.engram/manifest.json(if present) - Injects Memory Protocol + previous session context
SessionStart Hook (compact)
Runsscripts/post-compaction.sh:
- Injects previous session context
- Tells the agent: “FIRST ACTION REQUIRED — call
mem_session_summarybefore doing anything else”
SubagentStop Hook
Runsscripts/subagent-stop.sh:
Passive capture trigger — extracts learnings from subagent completion.
Stop Hook
Runsscripts/session-stop.sh:
Logs end-of-session event for tracking.
MCP Server Registration
The plugin includes.mcp.json:
--tools=agent flag — this exposes the agent-facing tools (vs. --tools=all for debugging).
Memory Protocol Skill
The plugin includes a skill atskills/memory/SKILL.md that teaches:
- When to save — Mandatory after bugfixes, decisions, discoveries, patterns
- When to search — Reactive (“remember”) + proactive (overlapping work)
- Session close — Mandatory
mem_session_summarybefore ending - After compaction — 3-step recovery: persist summary → load context → continue
Platform-Specific Notes
Windows
If hooks don’t fire:- Install Git for Windows (includes Git Bash)
- Ensure
bashis in yourPATH - Restart Claude Code
macOS / Linux
Plugin hooks work out of the box. Bash is always available.Git Sync Auto-Import
If your project has.engram/manifest.json, the plugin automatically imports team memories on session start:
Compaction Recovery
When Claude Code compacts (summarizes long conversations to free context), the plugin:- Auto-saves checkpoint — Calls
/sessions/{id}/endwith the summary - Injects previous context — Fetches recent session data and adds to compaction prompt
- Reminds new agent — Adds instruction: “FIRST ACTION REQUIRED: Call
mem_session_summary…”
post-compaction.sh hook:
Permissions Allowlist
When usingengram setup claude-code, you can add engram tools to the permissions allowlist in ~/.claude/settings.json:
Troubleshooting
Plugin not listed
Hooks not firing
Check that bash is available:MCP tools not available
Check.claude/settings.json or ~/.claude/settings.json for the engram MCP server entry.
Server not starting
Manually start:Next Steps
- Learn about the Memory Protocol
- Explore MCP Tools
- Set up Git Sync for team memory sharing