/onebrain:reorganizefrom onebrain
Migrates vault folder structure: full 5-folder to 8-folder layout or organizes flat notes into subfolders. High-impact, manual-only restructuring.
Ships in onebrain. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
This skill handles two scenarios:
02-areas/, 04-resources/, 05-agent/, renumbers archive/logs. Run this if your vault was set up before the 8-folder layout.Check vault version: Read onebrain.yml. If the folders.areas key is absent, this vault uses the old structure and needs full migration : run the Full Migration section first. If folders.areas is present, skip to the Subfolder Migration section.
Important: Obsidian wikilinks ([[Note Name]]) resolve by filename regardless of path : moving files does NOT break any existing links in your vault.
Only run if onebrain.yml is missing folders.areas.
02-areas/, 04-resources/, 05-agent/memory/03-archive/ → 06-archive/: move all contents preserving YYYY/MM/ structure04-logs/ → 07-logs/: move all contents preserving YYYY/MM/ structure02-knowledge/ notes:
research, summary, or reference in frontmatter → move to 04-resources/[same subfolder]source: field matching /research, /summarize, or /reading-notes → move to 04-resources/[same subfolder]03-knowledge/ (treat as synthesized content)05-agent/MEMORY-INDEX.md exists; if not, create an empty MEMORY-INDEX.md with the standard frontmatter (total_active: 0, total_needs_review: 0, updated: YYYY-MM-DD)onebrain.yml with all 8 keys:
folders:
inbox: 00-inbox
projects: 01-projects
areas: 02-areas
knowledge: 03-knowledge
resources: 04-resources
agent: 05-agent
archive: 06-archive
logs: 07-logs
04-resources/, files kept in 03-knowledge/, files needing manual reviewMove existing flat notes into category-based subfolders (kebab-case, max 2 levels). Run this once after upgrading to a version of OneBrain that uses subfolders.
Find notes that are directly in a top-level folder (not already in a subfolder):
[projects_folder]/*.md : glob top-level only (not [projects_folder]/**/*.md)[areas_folder]/*.md : glob top-level only[knowledge_folder]/*.md : glob top-level only[resources_folder]/*.md : glob top-level only[logs_folder]/*-session-*.md[logs_folder]/session/YYYY/MM/; /update migration owns the 07-logs structure end-to-end. /reorganize no longer touches [logs_folder]/.Legacy 07-logs structure guard (post-v2.4.0): before scanning anything else, check whether [logs_folder]/YYYY/MM/ contains any of *-session-*.md, *-checkpoint-*.md, or *-update-*.md files. If yes → abort immediately with the message: ⚠️ 07-logs structure outdated — run /update first to migrate, then re-run /reorganize. Do not proceed; do not touch any folder. The /update Step 0 migration owns this structure transition; running /reorganize on a half-migrated vault would leave session logs stranded outside session/.
Also check [archive_folder]/*.md for any flat archive files.
Exclude .gitkeep files.
Report: ────────────────────────────────────────────────────────────── 📁 Proposed Reorganization ────────────────────────────────────────────────────────────── 🗂️ [knowledge_folder]/ ({N} notes) 🗂️ [resources_folder]/ ({N} notes) 🗂️ [areas_folder]/ ({N} notes) 🗂️ [projects_folder]/ ({N} notes) 🗂️ [archive_folder]/ ({N} archive files)
If nothing is found: ✅ Nothing to do — vault already organized into subfolders.
For each note, analyze its content and frontmatter to suggest a subfolder:
For [knowledge_folder]/, [resources_folder]/, [areas_folder]/, and [projects_folder]/ notes:
programming/python, health/fitness)For [archive_folder]/ flat files:
YYYY/MMcreated: frontmatter if present and use that date insteadPresent the full migration plan:
──────────────────────────────────────────────────────────────
📁 Proposed Reorganization
──────────────────────────────────────────────────────────────
🗂️ {folder}/ ({N} notes)
{Note name} → {subfolder}
{Note name} → {subfolder}
🗂️ {folder}/ ({N} notes)
{Note name} → {subfolder}
──────────────────────────────────────────────────────────────
{N} notes total · Proceed?
If more than 40 notes total, show the first 40 and add: (showing 40 of {N} — run /reorganize again to continue)
Say:
Does this look right? You can:
- Approve all : move everything as proposed
- Adjust a note : tell me the note name and where to put it instead
- Skip a note : tell me which ones to leave in place
- Cancel : do nothing
Wait for response. Apply any requested adjustments before proceeding.
For each approved move:
[target_folder]/[subfolder]). Most portable: node -e "require('fs').mkdirSync(process.argv[1], { recursive: true })" -- "[target_folder]/[subfolder]". Native shell forms also work: mkdir -p (Bash), New-Item -ItemType Directory -Force (PowerShell — never mkdir -p here), mkdir (cmd). Existing-directory errors are non-fatal.[source_path] to [target_path]. Use mv on Bash, Move-Item on PowerShell, move on cmd.Process notes by folder (all knowledge, then resources, then areas, then projects, then archive).
Report: ✅ Moved {N} notes into subfolders.
[knowledge_folder]/ into N subfolders[resources_folder]/ into N subfolders[areas_folder]/ into N subfolders[projects_folder]/ into N subfolders[archive_folder]/ into YYYY/MM foldersAll existing wikilinks ([[Note Name]]) still work : Obsidian resolves links by filename, not path.
Want to run /connect to find new connections between your organized notes?
onebrain search reindex
Follow ../_shared/audit-log-format.md (canonical frontmatter, append-per-day algorithm, run-section heading, failure mode) with:
YYYY-MM-DD-reorganize.md — one file per day. Applies whether the run was a Full Migration (5-folder → 8-folder), a Subfolder Migration, or both.[audit-log, reorganize]/reorganizemode: full | subfolder | bothPer-skill body template (canonical ## Run HH:MM heading; metadata in first bullet):
## Run HH:MM
- Mode: subfolder
- Files moved: N
- Folders created: M
### Files moved
- `03-knowledge/ai-thought.md` → `03-knowledge/ai/AI Thought.md`
- `03-knowledge/python.md` → `03-knowledge/dev/Python.md`
... (full list)
### Folders created
- `03-knowledge/ai/`, `03-knowledge/dev/`
### Wikilinks repaired
- N links updated across M notes (preserved targets via Obsidian)
This skill is long-running. Emit a 1-line status update after each major step so the user can see progress in real time.
In-session format:
→ [step N/M] <action being taken>
Examples:
→ [step 1/6] scanning flat notes...
→ [step 2/6] proposing subfolder structure...
→ [step 3/6] showing user diff preview...
→ [step 4/6] (awaiting confirmation)...
→ [step 5/6] moving files in batches...
→ [step 6/6] updating MEMORY-INDEX + wikilinks...
Rules:
→ [step N/M] prefix exactly so they're visually distinct from skill outputWikilinks are path-independent in Obsidian. Moving files does NOT break [[Note Name]] links — Obsidian resolves by filename, not path. The skill already notes this, but it is the most common user concern; reassure proactively before executing moves.
Full migration: classification of old 02-knowledge/ notes into 03-knowledge/ vs 04-resources/ is imperfect. Notes without explicit source frontmatter require judgment. When uncertain, err on the side of keeping notes in 03-knowledge/ — the user can always move them to 04-resources/ later via /consolidate.
40-note batch limit. If the vault has more than 40 flat notes, the skill shows the first 40 and offers to continue on the next run. Inform the user upfront if the vault is large.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub onebrain-ai/onebrain --plugin onebrain32 skills in this plugin
/bookmarkQuick URL bookmark capture : paste a link, AI generates name and description, suggests category, saves to Bookmarks.md in awesome-list format. Invoke when user wants to save a URL for later — bare URL with no other context defaults to this. Do NOT use for: deeply processing or summarizing the URL content now (use summarize), saving a note that is not a URL (use capture), or researching a topic from scratch (use research)./braindumpCapture a stream of raw thoughts : classify them and file to inbox with action items extracted. Use when the user signals a free-form, stream-of-consciousness dump with multiple unrelated threads — 'let me dump everything on my mind'. Do NOT use for: a single titled idea (use capture), saving a URL (use bookmark), or anything structured and focused./captureQuick note capture with automatic wikilink suggestions to related existing notes. Use when the user wants to save a single, specific, titled idea, insight, or piece of information to the vault. Do NOT use for: unstructured multi-thread thought dumps (use braindump), saving a URL for later (use bookmark), deeply summarizing an article or URL (use summarize), processing a book (use reading-notes), or teaching the agent a preference (use learn)./cloneClone your agent's portable context (agent folder including MEMORY.md) to a folder for transfer to another vault. Use only when the user explicitly wants to migrate or copy agent memory to a new vault. Do NOT use for: backing up the whole vault, updating OneBrain (use update), or reviewing memory (use memory-review)./connectFind connections between notes and suggest wikilinks to strengthen the knowledge graph. Use when the user wants to discover how existing notes relate to each other — 'find connections', 'what links to this note', 'strengthen my graph'. Do NOT use for: creating new notes (use capture), processing inbox (use consolidate), or searching for specific content (search directly)./consolidateReview inbox and recent notes, synthesize and merge into the knowledge base. Use when the user wants to process, organize, or clear the inbox regardless of topic — 'clean up my inbox', 'process my notes'. Do NOT use for: capturing new information now (use capture or braindump), synthesizing already-vaulted notes on a specific topic (use distill — consolidate works on the inbox), or finding note connections (use connect).Other plugins' skills for the same job