memem-mine-history
Skill31 starsChanged 7 months agoMITView on GitHub
Mine ALL existing Claude Code sessions, including history from before memem was installed.
In this repository7 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- llms.txtllms.txt
- memem-doctorSkill
- memem-mineSkill
- mememSkill
- memem-statusSkill
- memem-welcomeSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 30
Run /memem-status to check progress and Stop-hook registration
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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.
- Show how many sessions exist:
find ~/.claude/projects/ -name "*.jsonl" ! -path "*/subagents/*" -size +5k | wc -l- Tell the user approximately how long it will take (~3-5 seconds per session, plus Haiku API costs).
- Confirm with the user before starting — this can take hours for large histories and makes many Haiku API calls.
- 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 $!)"- 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_deltato 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-statusto check progress and Stop-hook registration - To opt out:
rm ~/.memem/.miner-opted-in(no daemon to stop)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

