The user wants to remove data from agentmemory: $ARGUMENTS
IMPORTANT: This is a destructive operation. Always confirm with the user before deleting.
Steps:
- First search for matching observations with the
memory_smart_searchMCP tool (provided by the agentmemory server this plugin wires up via.mcp.json). Use the user's input as thequerywithlimit: 20. - Show the user what was found — session IDs, observation IDs, titles — and ask for explicit confirmation before deleting.
- Once confirmed, call
memory_governance_deletewith: If the user wants to drop an entire session's observations, collect every memory ID in that session from the search results and pass them all viamemoryIds. The standalone MCP doesn't accept a baresessionIdargument — it deletes by memory ID only.
- memoryIds: [<id>,...] — an array (or comma-separated string) of the memory IDs returned by the search in step 1 - reason: "<short reason>" — optional, defaults to "plugin skill request"
- Confirm the deletion count back to the user.
Never delete without explicit user confirmation. If the MCP tools aren't available, the stdio MCP shim didn't start — tell the user to:
- Run
/plugin listin Claude Code and confirmagentmemoryshows as enabled. - Restart Claude Code (the plugin's
.mcp.jsonis only read on startup). - Check
/mcpto see whether theagentmemoryMCP server is connected.