memory-reflect · basicmachines-co — Claude Code skill: consolidate agent memory
A background skill that reviews recent sessions and daily notes, pulls out what matters and folds it into long-term memory. Runs on a schedule or on demand.
npx skills add basicmachines-co/basic-memory-skills --skill memory-reflect -a claude-codeWhat memory-reflect does
Think of memory-reflect as sleep for your agent. It opens notes from the last couple of days, checks active tasks, and decides what deserves to stick around: decisions that shape future work, lessons from mistakes, working-style preferences, details about people. Weather checks and routine steps get dropped.
It then updates MEMORY.md in place, following whatever structure the file already has. New sections get added, outdated entries get rewritten instead of duplicated. Today's daily note gets a short reflection log listing what was reviewed, what moved into long-term memory and what was cleaned up. The daily notes themselves stay put — they are the raw record.
The author suggests scheduling it once or twice a day through cron or heartbeat. Another good moment is right after context compaction, when part of the history is gone. The skill leans on the recent_activity, read_note and search_notes tools, so with no note store configured it has nothing to read. While gathering material it also looks for filesystem trouble: recursive nesting like memory/memory/memory/, orphaned files, bloated notes. Those are the usual reason a reflection run ends up hoarding junk.
What it helps with
- carry decisions from yesterday's session into long-term memory
- strip duplicates and stale entries out of
MEMORY.md - turn a chronological note dump into topical sections
- spot orphaned files and recursive nesting in the note store
- run a memory pass after context compaction
Example prompts for the agent
- Reflect on my recent sessions and update MEMORY.md
- Go through the last two days of daily notes and pull out what's worth keeping
- Check my memory for duplicates and junk files
How to install memory-reflect
1Skills CLI (Vercel)
npx skills add basicmachines-co/basic-memory-skills --skill memory-reflect -a claude-code2Manually: put the files in place
~/.claude/skills/memory-reflect/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/memory-reflect/
1Skills CLI (Vercel)
npx skills add basicmachines-co/basic-memory-skills --skill memory-reflect -a codex2Manually: put the files in place
.agents/skills/memory-reflect/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add basicmachines-co/basic-memory-skills --skill memory-reflect -a cursor2Manually: put the files in place
.cursor/skills/memory-reflect/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install basicmachines-co/basic-memory-skills memory-reflect2Manually: put the files in place
.github/skills/memory-reflect/SKILL.md1Skills CLI (Vercel)
npx skills add basicmachines-co/basic-memory-skills --skill memory-reflect -a gemini-cli2Platform CLI
gemini skills install https://github.com/basicmachines-co/basic-memory-skills --path memory-reflectManually: put the files in place
.devin/skills/memory-reflect/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add basicmachines-co/basic-memory-skills --skill memory-reflect -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about memory-reflect
How do I install memory-reflect in Claude?
Run npx skills add basicmachines-co/basic-memory-skills --skill memory-reflect -a claude-code. The skill file then lands at ~/.claude/skills/memory-reflect/SKILL.md.
What does memory-reflect do?
It reads recent notes and active tasks, picks out decisions, lessons and preferences, and writes them into MEMORY.md. It also appends a short log of the run to today's daily note.
When should I run the reflection?
The author suggests a background task once or twice a day via cron or heartbeat. You can also trigger it by hand after context compaction or when notes have piled up.
Similar skills
All skills for Agent setup: memory, context, orchestration →memory-reflect by other authors comes first.