Summary
The UserPromptSubmit hook (scripts/user-prompt-submit.sh, function print_toolsearch_message) injects a ToolSearch select: instruction using the mcp__engram__* tool prefix. This is correct when engram is registered as a direct MCP server named engram, but wrong when engram is installed as a Claude Code plugin (e.g. via the engram@engram marketplace).
When installed as a plugin, the real tool names are prefixed mcp__plugin_engram_engram__*. As a result, the injected ToolSearch matches no tools, and the first-message memory bootstrap silently fails — the agent never loads mem_context, mem_save, etc. on the first turn.
Environment
- Claude Code, engram installed as plugin (
enabledPlugins: { "engram@engram": true })
- engram plugin cache version
0.1.0
- Linux
Steps to reproduce
- Install engram as a Claude Code plugin (not as a direct MCP server).
- Start a new session and send the first message.
- Observe the injected
systemMessage: select:mcp__engram__mem_save,...
- The
ToolSearch resolves to nothing because the actual tools are mcp__plugin_engram_engram__*.
Suggested fix
The hook should detect the installation mode (plugin vs direct MCP server) and emit the matching prefix — e.g. resolve the prefix dynamically, or fall back to a name-agnostic ToolSearch keyword query ("engram memory tools") instead of hardcoding select:mcp__engram__*.
Note
Hardcoding either prefix breaks the other install mode. A keyword-based ToolSearch or runtime detection would cover both.
Summary
The
UserPromptSubmithook (scripts/user-prompt-submit.sh, functionprint_toolsearch_message) injects aToolSearch select:instruction using themcp__engram__*tool prefix. This is correct when engram is registered as a direct MCP server namedengram, but wrong when engram is installed as a Claude Code plugin (e.g. via theengram@engrammarketplace).When installed as a plugin, the real tool names are prefixed
mcp__plugin_engram_engram__*. As a result, the injectedToolSearchmatches no tools, and the first-message memory bootstrap silently fails — the agent never loadsmem_context,mem_save, etc. on the first turn.Environment
enabledPlugins: { "engram@engram": true })0.1.0Steps to reproduce
systemMessage:select:mcp__engram__mem_save,...ToolSearchresolves to nothing because the actual tools aremcp__plugin_engram_engram__*.Suggested fix
The hook should detect the installation mode (plugin vs direct MCP server) and emit the matching prefix — e.g. resolve the prefix dynamically, or fall back to a name-agnostic
ToolSearchkeyword query ("engram memory tools") instead of hardcodingselect:mcp__engram__*.Note
Hardcoding either prefix breaks the other install mode. A keyword-based
ToolSearchor runtime detection would cover both.