Skip to content
Development
Skill

/memem-mine-history

Mine ALL existing Claude Code sessions, including history from before memem was installed.

From plugin
memem
316 skills4 hooks
Install
$ npx -y skills add TT-Wang/memem --skill memem-mine-history --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-mine-history

Context preview

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

Mine ALL existing Claude Code sessions, including history from before memem was installed.

SKILL.md

memem-mine-history.SKILL.md
name: memem-mine-history
description: Mine ALL existing Claude Code sessions, including history from before memem was installed.
allowed-tools: [Bash]

Mine all historical Claude Code sessions for knowledge. By default the Stop hook only handles new sessions; this command backfills existing JSONL transcripts. It also opts you in to event-triggered mining for future sessions.

1. Show how many sessions exist:

find ~/.claude/projects/ -name "*.jsonl" ! -path "*/subagents/*" -size +5k | wc -l

2. Tell the user approximately how long it will take (~3-5 seconds per session, plus Haiku API costs).

3. Confirm with the user before starting — this can take hours for large histories and makes many Haiku API calls.

4. Record the opt-in and start history backfill in the background:

mkdir -p ~/.memem && touch ~/.memem/.miner-opted-in
nohup PYTHONPATH="${CLAUDE_PLUGIN_ROOT}" python3 -m memem.server --mine-all > ~/.memem/mine-all.log 2>&1 &
echo "History mining started in background (PID $!)"

5. Tell the user:

  • History mining is running in the background (log at `~/.memem/mine-all.log`)
  • Future sessions will also be mined automatically — every Claude Code Stop event spawns `mine_delta` to extract new turns
  • They can continue working normally
  • New memories appear as they're extracted (Haiku-extracted, written to `~/obsidian-brain/memem/memories/`)
  • Run `/memem-status` to check progress and Stop-hook registration
  • To opt out: `rm ~/.memem/.miner-opted-in` (no daemon to stop)
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
31
Stars
1
Forks
Active
Maintenance
Python
Language
MIT
License
16d ago
Last commit
5mo ago
Created

Repo: TT-Wang/memem

Other skills on memem.