basic-memory-pi-setup
Set up Basic Memory for a Pi workspace. Use when Basic Memory is not configured, /bm-status shows no project, recall returns…
Defragment a Basic Memory project: split bloated notes, consolidate scattered facts, resolve contradictions, retire stale content. Plans first; deletes only when told. Run weekly or on demand.
Claude Code
$ npx -y skills add basicmachines-co/basic-memory --skill memory-defrag --agent claude-code
Codex
$ npx skills add basicmachines-co/basic-memory --skill memory-defrag -a codex -y
Cursor
$ npx skills add basicmachines-co/basic-memory --skill memory-defrag -a cursor -y
Gemini CLI
$ npx skills add basicmachines-co/basic-memory --skill memory-defrag -a gemini-cli -y
GitHub Copilot
$ npx skills add basicmachines-co/basic-memory --skill memory-defrag -a github-copilot -y
OpenCode
$ npx skills add basicmachines-co/basic-memory --skill memory-defrag -a opencode -y
Windsurf
$ npx skills add basicmachines-co/basic-memory --skill memory-defrag -a windsurf -y
name: memory-defrag description: "Defragment a Basic Memory project: split bloated notes, consolidate scattered facts, resolve contradictions, retire stale content. Plans first; deletes only when told. Run weekly or on demand."
Reorganize a project's notes so each topic has one clear, current home. Over time notes grow past their topic, the same fact lands in several places, old facts contradict new ones, and finished work lingers. Defrag fixes the content; **memory-curate** handles links, relations, and tags.
If the project is unknown, discover it with `bm_project_list()`. Pass a nonempty `project` on every note, folder, context and schema call, even with one project or a qualified `memory://` URL. Use the chosen project's name, `workspace/project`, or external ID; `<project>` below is a placeholder for it. Recent activity also requires `project`. Search accepts `project` for one project, `projects` for selected projects, or `all_projects=True` explicitly. Discovery and bundled manuals need no project. Keep the same scope when following returned paths, paginating, or recovering from a refusal.
the same topic
Walk the whole project, not just recent changes. Stale content is usually in notes nobody touched lately.
# Every folder and note within depth 10. Page until has_more is false; # descend into deeper folders separately if the project has them. bm_find(path="/", depth=10, page_size=100, project="<project>") # Recently busy notes, to look at first bm_recent(since="30d", output_format="json", page_size=50, project="<project>") # Notes on one topic, to spot overlap bm_search(query="launch plan", project="<project>") # Commitments due on or before today: finished work that lingers, or overdue items bm_search(time_kind="due", valid_overlaps="(,2026-10-14]", project="<project>")
Read every note you might change, in full. For each, note its topic, size, last change, and anything that looks stale or contradicted.
| Problem | Signal | Fix | |---|---|---| | **Bloated note** | Covers several topics, hundreds of lines | Split into focused notes | | **Scattered facts** | One topic's facts spread over several notes | Consolidate into the topic's note | | **Contradiction** | Two notes disagree | Date the change, or propose for review (below) | | **Stale content** | Finished work, past dates, resolved issues | Retire: close the fact's range, update status, or archive | | **Duplicate notes** | Same topic, different titles | Merge (see memory-curate) |
Two statements that disagree are often both true, at different times: the launch was Friday, then moved to Thursday. Observations can say when a claim holds (see **memory-notes**), so a change over time can be recorded without losing either statement:
- [decision] @effective[2026-09-01,2026-10-14) Launch on Friday - [decision] @effective:2026-10-14 Launch on Thursday (moved in [[2026-10-14 Launch Sync]])
Which statement is newer is not evidence on its own. An old meeting note imported today is new to the project and still wrong. Resolve a contradiction directly only when a source says when the change happened and what replaced what, and cite that source. Otherwise list both statements in the plan as `[contradiction]`, with their sources, and leave it for review.
Write the plan as a note before changing anything, so a person can review it. Title it with the date and time, so two runs on one day get separate plans:
--- title: Defrag Plan 2026-10-14 0830 type: defrag-plan status: proposed --- # Defrag Plan 2026-10-14 0830 ## Observations - [split] Launch Plan → Launch Plan, Launch Checklist (checklist is 200 lines of its own) - [consolidate] Owner facts from 3 meeting notes → Launch Plan, Owners section - [date-change] Launch Plan: Friday → Thursday, effective 2026-10-14 per 2026-10-14 Launch Sync - [contradiction] Pricing Notes says $20/seat, Q4 Plan says $25/seat; no source dates the change (review needed) - [retire] Beta Signup Tasks: all done since September → status: done, move to archive/ - [keep] Old Pricing Ideas: looks stale but is still linked from Q4 Plan (review needed)
while leaving the sources in place, dating a change a source documents (closing the old range keeps the old statement), updating a status.
evidence: deleting a note, merging one note into another, dropping facts, resolving an undated contradiction. If your instructions don't say to apply these, leave them in the plan with `status: proposed` and stop.
its checksum as `expected_checksum`, so the edit applies only to the revision you read; on a checksum conflict, read again and recheck the plan line. Keep relations pointing at the right note after a split or move (`bm_move` keeps links working; a new note needs links added).
Update the plan note: mark each line done, skipped, or left for review, and set `status: applied` or `status: partly-applied`.
the note it belongs to, or keep it. Prefer closing a fact's range to deleting it.
record other notes cite.
propose it.
AI conversations that actually remember. Never re-explain your project to your AI again. Join our Discord: https://discord.gg/tyvKNccgqN
Set up Basic Memory for a Pi workspace. Use when Basic Memory is not configured, /bm-status shows no project, recall returns…
Use Basic Memory from Pi for durable continuity. Capture checkpoints with bm_capture, recall prior Pi checkpoints with bm_recall,…
Guide Basic Memory setup in Tau. Use when a user wants to install or configure the Tau memory extension, choose a memory…
Save a deliberate work checkpoint to Basic Memory with the story, changed files, verification, decisions, blockers, and the next…
Capture a durable engineering decision in Basic Memory with rationale, alternatives, consequences, and affected work. Use when…
Orient Claude from Basic Memory before substantial repo work by reading active tasks, open decisions, recent checkpoints, and…
Believable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude…
Keep a durable record of work passed between Bots in the shared Hindsight memory bank. Use when handing work to another Bot, when…
Install, configure, and operate MemPalace, including a private local palace, a shared-brain hub, or a client joining an existing…
Install, configure, and operate MemPalace, including a private local palace, a shared-brain hub, or a client joining an existing…