Skip to content
Development
Skill

/memem

Show memem status for returning users, or the full welcome for brand-new users. Use when the user wants to check memem or learn about it.

From plugin
memem
326 skills4 hooks
Install
$ npx -y skills add TT-Wang/memem --skill memem --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/memem

Context preview

The summary Claude sees to decide when to auto-load this skill.

Show memem status for returning users, or the full welcome for brand-new users. Use when the user wants to check memem or learn about it.

SKILL.md

memem.SKILL.md
name: memem
description: Show memem status for returning users, or the full welcome for brand-new users. Use when the user wants to check memem or learn about it.
allowed-tools: [Bash, Read]

Show memem's current state. Follow these steps in order.

**Step 1 — Detect user type.** Run these commands:

[ -f ~/.memem/last-error.md ] && echo "HAS_ERROR" || echo "NO_ERROR"
[ -f ~/.memem/.welcome-shown ] && echo "WELCOME_SHOWN" || echo "WELCOME_NEW"
[ -f ~/.memem/.migrated_from_cortex ] && echo "LEGACY" || echo "NO_LEGACY"
find ~/obsidian-brain/memem/memories -maxdepth 1 -name "*.md" -type f 2>/dev/null | wc -l | tr -d ' '

Read the four outputs. The user is **brand new** only if ALL of these are true:

  • `NO_ERROR`
  • `WELCOME_NEW`
  • `NO_LEGACY`
  • Memory count is `0`

Otherwise the user is **returning** (even with 0 memories — if they migrated from cortex or dismissed the welcome, they're not brand new).

**Step 2 — If there is a bootstrap error, show it first** regardless of user type. Run `cat ~/.memem/last-error.md` and display the output under a heading like `### ⚠️ memem bootstrap failed`. Then continue to the appropriate branch.

---

Branch A — Brand new user

Show the full welcome:

**A1. Print the banner:**

  ███╗   ███╗███████╗███╗   ███╗███████╗███╗   ███╗
  ████╗ ████║██╔════╝████╗ ████║██╔════╝████╗ ████║
  ██╔████╔██║█████╗  ██╔████╔██║█████╗  ██╔████╔██║
  ██║╚██╔╝██║██╔══╝  ██║╚██╔╝██║██╔══╝  ██║╚██╔╝██║
  ██║ ╚═╝ ██║███████╗██║ ╚═╝ ██║███████╗██║ ╚═╝ ██║
  ╚═╝     ╚═╝╚══════╝╚═╝     ╚═╝╚══════╝╚═╝     ╚═╝
  persistent memory for Claude Code

**A2. Write the one-sentence pitch:** > memem gives Claude Code persistent memory across sessions. It extracts durable lessons (decisions, conventions, bug fixes, preferences) from your completed sessions into markdown files, then surfaces the relevant ones at the start of each new session.

**A3. Show the two mining options prominently:**

Check the past session count first:

find ~/.claude/projects/ -name "*.jsonl" ! -path "*/subagents/*" -size +5k 2>/dev/null | wc -l | tr -d ' '

Then show:

> ### 🟡 memem is installed — choose how to start > > memem won't mine anything until you start it. Two options: > > - **Mine only new sessions going forward.** Every completed Claude Code session will be extracted into durable memories from now on. No API cost for past history. > - Say **"start mining new sessions"** — or type `/memem-mine` > > - **Mine everything, including your past [N] Claude Code sessions.** Extracts memories from your full history plus all new sessions going forward. Uses Claude Haiku API credits; large histories may take up to an hour. > - Say **"start mining everything including history"** — or type `/memem-mine-history` > > Replace `[N]` with the session count. If the count is 0, drop the second option entirely. > > If the user sounds unsure, recommend the first option as the default.

**A4. Tail:**

> **Optional:** Memories are plain markdown at `~/obsidian-brain/memem/memories/`. Open that folder as an Obsidian vault for graph view. memem works identically without Obsidian. > > Commands: `/memem-status`, `/memem-doctor`, `/memem-mine`, `/memem-mine-history`

If useful, add one final plain-English line:

> If you just want the safe default, start with `/memem-mine`.

**A5. Mark welcome as shown so future `/memem` invocations use the compact view:**

mkdir -p ~/.memem && touch ~/.memem/.welcome-shown

---

Branch B — Returning user

Show only current state. No pedagogy, no ASCII art, no tutorials.

**B1. Run the status command:**

PYTHONPATH="${CLAUDE_PLUGIN_ROOT}" python3 -m memem.server --status

Display the output in a code block.

**B2. Check the miner state:**

[ -f ~/.memem/.miner-opted-in ] && echo "OPTED_IN" || echo "NOT_OPTED_IN"
pgrep -f "memem.server --mine-all" > /dev/null && echo "MINING_HISTORY" || echo "NOT_MINING_HISTORY"

Then show a single one-line state summary matching what the signals show:

  • If `OPTED_IN` + `MINING_HISTORY`: "⚙️ memem active — backfilling past history in the background. New sessions are mined automatically on each Stop event."
  • If `OPTED_IN` + `NOT_MINING_HISTORY`: "✅ memem active — event-triggered mining enabled, new sessions extracted on each Stop event."
  • If `NOT_OPTED_IN`: "🟡 memem has N memories but mining is opted out. Type `/memem-mine` to enable, or `/memem-welcome` to re-read the intro."

**B3. Tail (always, for returning users):**

> Commands: `/memem-status`, `/memem-doctor`, `/memem-mine`, `/memem-mine-history`, `/memem-welcome` (re-show intro)

**Do NOT** print the ASCII banner, "how memem works" explainer, Obsidian note, MCP tool list, or mining-option walkthrough. Returning users don't need them.

Read more
Ships withmemem

Persistent, self-evolving memory for Claude Code. Stop re-explaining your project every session. <!-- The Glama badge URL below intentionally uses the legacy cortex-plugin slug.

Get the whole plugin
Stats
32
Stars
1
Forks
Active
Maintenance
Python
Language
MIT
License
13d ago
Last commit
5mo ago
Created

Repo: TT-Wang/memem

Other skills on memem.