mem0-forget

mem0-forget is a skill for Claude Code, Codex from mem0ai/mem0. It costs 43 tokens per session (691 once invoked), scanned A, original, Apache-2.0.

A tool for finding and deleting selected mem0 memories after the user confirms the removal.

In plain words
What is it for?
Use it with a search phrase or memory ID, including to undo a recent memory addition.
Why use it?
It helps remove outdated decisions, incorrect information, sensitive data, or temporary notes without deleting anything accidentally.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions OpenCode.

About the project

mem0 is memory infrastructure that lets AI agents and applications store and retrieve information across interactions. It supports agents and developers who need persistent context for AI systems.

mem0ai/mem0 · 64,756 stars · on GitHub · mem0.ai

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/mem0ai/mem0/mem0-forget
Any agent
npx skills add mem0ai/mem0 --skill mem0-forget
Clone the repo
git clone --depth 1 https://github.com/mem0ai/mem0

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for mem0-forget

README.md
[![agentmods](https://agentmods.dev/badge/skills/mem0ai/mem0/mem0-forget.svg)](https://agentmods.dev/skills/mem0ai/mem0/mem0-forget)
Your own site
<a href="https://agentmods.dev/skills/mem0ai/mem0/mem0-forget"><img src="https://agentmods.dev/badge/skills/mem0ai/mem0/mem0-forget.svg" alt="Measured on agentmods" height="20"></a>
Per session 43 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 691 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00043 $0.00691
Opus 5 $0.00022 $0.00345
Sonnet 5 $0.00009 $0.00138
Haiku 4.5 $0.00004 $0.00069

Measured 6d ago against content hash bcdcfcfa250b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

mem0-forget scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

integrations/mem0-plugin/.opencode-plugin/opencode-skills/mem0-forget/SKILL.md · 75 lines

How it starts

The opening of the file, as written. The whole thing — 75 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Mem0 Forget

Delete specific memories from mem0.

Execution

Step 1: Parse input

The user provides either:

  • A search query: /mem0-forget auth module decisions
  • A memory ID: /mem0-forget <memory_id>

If no argument, ask: "What should I forget? Provide a search query or memory ID."

Step 2: Find memories

If memory ID provided (looks like a UUID or hex string):

  • Call get_memory with the ID to verify it exists.
  • Show: Found: "<memory content first 120 chars>" (created <date>)

If search query provided:

  • Call search_memories with:
    • query=<user's query>
    • filters={"AND": [{"user_id": "<active_user_id>"}, {"app_id": "<project_id>"}]}
    • top_k=10
  • Show numbered list:
    Found <N> memories matching "<query>":
    1. <content, 120 chars> (type: <type>, created: <date>) [ID: <short_id>]
    2. ...
    

Step 3: Confirm

Ask: "Delete which memories? Enter numbers (e.g., 1,3,5), 'all', or 'cancel'."

For a single memory ID, ask: "Delete this memory? [y/N]"

Never delete without confirmation. This is destructive.

Step 4: Delete

For each confirmed memory, call delete_memory with the memory ID.

Step 5: Report

Deleted <N> memories.

If any deletions failed, report which ones and why.

Undo recent writes

If the user says "undo last N memories" or "undo last write":

  1. Check the MEM0_SESSION_ID environment variable (set by the plugin's shell.env hook).
  2. If MEM0_SESSION_ID is set, call search_memories with:
    • query="recently added"
    • filters={"AND": [{"user_id": "<active_user_id>"}, {"app_id": "<project_id>"}, {"metadata": {"session_id": "<MEM0_SESSION_ID>"}}]}
    • top_k=20
  3. Sort results by creation time descending and show the last N entries (default 1). Ask for confirmation.
  4. Delete confirmed entries via delete_memory.

If MEM0_SESSION_ID is not set or the search returns no results, tell the user: "No recent memory IDs tracked this session. Try /mem0-tour to browse recent memories, or /mem0-forget <search query> to find specific ones."

Read the full file on GitHub · 75 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 75 lines · 43 tokens per session scan A bcdcfcfa250b

Subscribe to this mod's changes

mem0-forget is a skill published in the GitHub repository mem0ai/mem0 (64,756 stars, last pushed yesterday), licensed Apache-2.0. It adds 43 tokens to every session and 691 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.