forget
Delete saved knowledge from ~/.claude/learnings/.
Instructions
1. Parse Query
Argument: $ARGUMENTS
If empty, list all knowledge files and ask which to delete.
2. Find the File
Search ~/.claude/learnings/:
- •Exact slug:
~/.claude/learnings/<slug>.md - •Partial match:
~/.claude/learnings/*<query>*.md
If multiple matches, list them and ask the user to pick.
3. Confirm Deletion
Show the user:
- •File path
- •Topic name (from frontmatter)
- •Created date
Ask: "Delete this knowledge? (yes/no)"
4. Delete
If confirmed:
Delete the file:
bash
rm ~/.claude/learnings/<slug>.md
Clean up knowledge graph (graceful fallback):
- •If
mcp__memory__search_nodesandmcp__memory__delete_entitiesare available: search for a "learning" entity matching the topic and delete it. - •If MCP memory tools are NOT available: skip this step silently. The file deletion is sufficient.
Confirm:
Deleted knowledge on "<topic>".