obsidian-organizer

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Obsidian Organizer

Obsidian 库整理工具

Keep a large Obsidian vault tidy over time by (1) filing new notes into the best-fit folder and (2) auditing/reorganizing existing structure. Both modes lean on one shared idea: a plain-markdown map of "what goes where" that lives inside the vault so it never drifts out of sync with reality.
This skill drives the
obsidian
CLI (from the separate
obsidian-cli
skill), which talks to the live, running Obsidian desktop app. The app must be open. If a command fails with a connection/vault error, tell the user to open Obsidian rather than guessing.
通过以下两种方式长期保持大型Obsidian库整洁:(1) 将新笔记归档到最适合的文件夹;(2) 审核/重组现有结构。两种模式都基于同一个核心思路:一份存放在库内的纯Markdown格式“内容归属映射”,确保它永远不会与实际库结构脱节。
此功能依赖
obsidian
CLI(来自独立的
obsidian-cli
技能),该CLI与运行中的Obsidian桌面应用通信。应用必须处于打开状态。如果命令因连接/库错误失败,请告知用户打开Obsidian,而非自行猜测。

Why the map lives in the vault (read this first)

为何映射文件要存放在库内(请先阅读此部分)

Deciding a folder for every new note by re-listing ~650 folders is expensive and guesses drift. Copying the folder taxonomy into Claude's private memory creates a worse problem: a stale copy that silently disagrees with the real vault.
The fix is one file,
00_Index/Folder_Map.md
, checked into the vault itself. It is the single source of truth for filing decisions. Read it with one cheap call before you file or reorganize — do not re-run a full
obsidian folders
traversal unless the map is missing or the user asks you to rebuild it.
bash
obsidian read path="00_Index/Folder_Map.md"
It is deliberately plain markdown (headers + bullets, no required frontmatter) so both you and the human can append to it by hand as new categories emerge. When you create a new folder/category, add a line to this file so the next filing decision remembers it.
If the map does not exist (deleted, or a fresh vault), rebuild it from the live vault, not from a copy stashed in this skill — a bundled copy would drift from reality, which is the whole failure this file exists to prevent. List the real structure with
obsidian vault="MyVault" folders
(and
folders folder=...
for depth), draft a plain-markdown map grouped by top-level PARA folder with a short "what goes here" note per folder plus a filing rule-of-thumb, confirm the groupings with the user, then create it:
obsidian vault="MyVault" create path="00_Index/Folder_Map.md" content="..."
.
为每条新笔记决定文件夹时,重新列出约650个文件夹成本很高,且猜测结果会逐渐偏离实际。将文件夹分类体系复制到Claude的私有内存中会引发更严重的问题:出现与真实库结构不一致的过期副本。
解决方案是使用库内的单个文件
00_Index/Folder_Map.md
,它是归档决策的唯一事实来源。在执行归档或重组操作前,只需通过一次简单调用读取该文件——除非映射文件缺失或用户要求重建,否则不要重新执行完整的
obsidian folders
遍历
bash
obsidian read path="00_Index/Folder_Map.md"
它特意采用纯Markdown格式(标题+项目符号,无必填前置元数据),以便你和用户都能手动添加新分类。当你创建新文件夹/分类时,需在该文件中添加一行描述,以便后续归档决策能识别它。
如果映射文件不存在(已删除或为全新库),请从运行中的库重建,而非使用此技能中存储的副本——捆绑的副本会与实际情况脱节,而这正是该文件要避免的核心问题。使用
obsidian vault="MyVault" folders
(以及
folders folder=...
指定深度)列出真实结构,草拟一份按顶级PARA文件夹分组的纯Markdown映射,每个文件夹附带简短的“内容归属说明”及归档经验法则,与用户确认分组后再创建该文件:
obsidian vault="MyVault" create path="00_Index/Folder_Map.md" content="..."

Vault targeting

库定位

MyVault
above is a placeholder — substitute the user's actual vault name everywhere. If the user has more than one vault, target the intended one explicitly on every command so a stray "most recently focused vault" default cannot misfile a note:
bash
obsidian vault="MyVault" read path="00_Index/Folder_Map.md"
vault=
must be the first parameter. This is the only vault-specific value in the skill — everything else comes from the vault's own
Folder_Map.md
.
上述
MyVault
是占位符——请在所有位置替换为用户的实际库名称。如果用户有多个库,请在每个命令中明确指定目标库,避免因“最近聚焦的库”默认设置错误归档笔记:
bash
obsidian vault="MyVault" read path="00_Index/Folder_Map.md"
vault=
必须是第一个参数。这是技能中唯一与库相关的固定值——其他所有信息均来自库自身的
Folder_Map.md

The one hard safety rule: never touch vault files with raw shell

唯一硬性安全规则:永远不要用原生Shell操作库文件

When you relocate or rename a file, always use the CLI's own
move
/
rename
commands. These go through Obsidian's API, so Obsidian's built-in "automatically update internal links" behavior rewrites every wikilink and backlink across the vault to follow the moved file. A raw
mv
,
rm
,
rmdir
, or
find -delete
on a path inside the vault skips that repair and silently leaves broken links pointing at the old location.
So, for anything under the vault directory:
  • Move/rename →
    obsidian move ...
    or
    obsidian rename ...
  • Delete →
    obsidian delete ...
    (sends to trash unless
    permanent
    )
  • Never use Bash
    mv
    /
    rm
    /
    rmdir
    /
    find -delete
    on vault-internal paths.
Reading a file's bytes with a non-mutating tool is fine; mutating vault files is CLI-only.

当你移动或重命名文件时,务必使用CLI自带的
move
/
rename
命令
。这些命令通过Obsidian的API执行,因此Obsidian内置的“自动更新内部链接”功能会重写库中所有维基链接和反向链接,使其指向移动后的文件。直接使用原生Shell的
mv
rm
rmdir
find -delete
操作库内路径会跳过此修复步骤,导致链接静默指向旧位置并失效。
因此,对于库目录下的所有操作:
  • 移动/重命名 → 使用
    obsidian move ...
    obsidian rename ...
  • 删除 → 使用
    obsidian delete ...
    (除非指定
    permanent
    ,否则会移至回收站)
  • 绝对不要对库内路径使用Bash的
    mv
    /
    rm
    /
    rmdir
    /
    find -delete
    命令。
使用非修改工具读取文件内容是允许的;修改库文件必须通过CLI执行。

Mode 1 — File a note

模式1 — 归档笔记

Goal: given a note (an existing path, or a title + content you're about to write), put it in the single best-fit folder.
  1. Read the map once:
    obsidian vault="MyVault" read path="00_Index/Folder_Map.md"
    .
  2. Match the note's topic to a destination using the map's filing rules. Favor an existing specific subfolder over a general one (e.g. a Seurat how-to goes to
    03_Research_Knowledge/Bioinformatics/seurat/
    , not a generic bucket).
  3. Act on the best fit:
    • A clearly matching folder exists → file it there.
      • New note:
        obsidian vault="MyVault" create path="03_Research_Knowledge/Bioinformatics/seurat/My Note.md" content="..." silent
      • Existing note to relocate:
        obsidian vault="MyVault" move path="00_Inbox/My Note.md" to="03_Research_Knowledge/Bioinformatics/seurat"
        (
        to
        may be a folder or a full path).
    • A rough-but-imperfect fit exists (e.g. a tool with no dedicated subfolder) → use the map's catch-all convention (e.g.
      Bioinformatics/misc/
      ) and tell the user where it went.
    • No category fits wellstop and ask the user before inventing a folder. Propose a name and location; don't silently create new taxonomy.
  4. Remember new categories. When the user approves a new folder, append a line describing it under the right section of
    00_Index/Folder_Map.md
    (
    obsidian append path="00_Index/Folder_Map.md" content="..."
    ) so future filing decisions know about it.
  5. Briefly report the final path.
Notes on the CLI:
create
makes intermediate folders as needed; add
silent
so it doesn't steal focus by opening the note.
move
's
to
accepts a destination folder or a full path; use
rename name="New Title"
to change a title in place.

目标:给定一条笔记(现有路径,或你即将写入的标题+内容),将其放入唯一最合适的文件夹。
  1. 读取映射文件一次:
    obsidian vault="MyVault" read path="00_Index/Folder_Map.md"
  2. 匹配笔记主题与映射文件中的归档规则对应的目标文件夹。优先选择现有的特定子文件夹而非通用文件夹(例如,Seurat操作指南应放入
    03_Research_Knowledge/Bioinformatics/seurat/
    ,而非通用分类)。
  3. 根据最佳匹配执行操作
    • 存在明确匹配的文件夹 → 将笔记归档至该文件夹。
      • 新笔记:
        obsidian vault="MyVault" create path="03_Research_Knowledge/Bioinformatics/seurat/My Note.md" content="..." silent
      • 需迁移的现有笔记:
        obsidian vault="MyVault" move path="00_Inbox/My Note.md" to="03_Research_Knowledge/Bioinformatics/seurat"
        to
        可以是文件夹路径或完整文件路径)。
    • 存在大致匹配但不够精准的文件夹(例如,某工具无专用子文件夹) → 使用映射文件中的兜底规则(例如
      Bioinformatics/misc/
      ),并告知用户笔记存放位置。
    • 无合适分类停止操作并询问用户,不要自行创建文件夹。建议文件夹名称和位置;不要静默创建新分类体系。
  4. 记录新分类。当用户批准新文件夹后,在
    00_Index/Folder_Map.md
    的对应章节添加一行描述(
    obsidian append path="00_Index/Folder_Map.md" content="..."
    ),以便后续归档决策能识别它。
  5. 简要报告最终路径。
CLI使用说明:
create
命令会自动创建所需的中间文件夹;添加
silent
参数可避免打开笔记而占用焦点。
move
命令的
to
参数接受目标文件夹或完整路径;使用
rename name="New Title"
可原地修改标题。

Mode 2 — Audit / reorganize

模式2 — 审核/重组

Goal: given a scope (a folder path, "recent inbox notes", or an explicit request like "clean up the cellchat notes"), find problems, propose a plan, get explicit confirmation, then execute. Never move, merge, or delete in bulk silently.
目标:给定范围(文件夹路径、“最近的收件箱笔记”或明确请求如“整理CellChat相关笔记”),找出问题,提出计划,获取明确确认后再执行。永远不要静默批量移动、合并或删除文件。

Step 1 — Gather signals for the scope

步骤1 — 收集范围内的信号

Read the map first for context, then use the structural commands. Scope every list to the folder in question where the command supports it.
  • obsidian vault="MyVault" files folder="<scope>"
    — inventory + spot near-duplicate titles (e.g. "CellChat analysis" vs "CellChat Analysis v2").
  • obsidian vault="MyVault" orphans
    — notes with no incoming links (nothing links to them; candidates for filing/merging/archiving).
  • obsidian vault="MyVault" deadends
    — notes with no outgoing links (often stubs or captures that were never developed).
  • obsidian vault="MyVault" search:context query="<topic>" path="<scope>"
    — compare content of suspected near-duplicates before proposing a merge.
  • obsidian vault="MyVault" backlinks path="<file>"
    — before merging or deleting a note, see what links to it so you don't strand references.
There is no dedicated "duplicates" command; detect duplicates by comparing the titles from
files
and confirming with
search:context
/
read
.
先读取映射文件获取上下文,再使用结构命令。在命令支持的情况下,将所有列表限定在指定范围内。
  • obsidian vault="MyVault" files folder="<scope>"
    — 列出文件清单并识别标题近似重复的笔记(例如“CellChat analysis”与“CellChat Analysis v2”)。
  • obsidian vault="MyVault" orphans
    — 无 incoming链接的笔记(没有任何内容链接到它们;可作为归档/合并/存档的候选对象)。
  • obsidian vault="MyVault" deadends
    — 无 outgoing链接的笔记(通常是未完善的草稿或临时记录)。
  • obsidian vault="MyVault" search:context query="<topic>" path="<scope>"
    — 在提出合并建议前,对比疑似近似重复笔记的内容。
  • obsidian vault="MyVault" backlinks path="<file>"
    — 在合并或删除笔记前,查看哪些内容链接到它,避免失效引用。
没有专门的“重复项”检测命令;需通过
files
命令获取标题并结合
search:context
/
read
命令确认来检测重复项。

Step 2 — Propose a plan (and wait)

步骤2 — 提出计划(等待确认)

Present a concrete, itemized plan and stop for confirmation. Group by action:
Proposed reorganization for Bioinformatics/cellchat/ (7 notes):

MERGE
- "CellChat analysis.md" + "CellChat analysis (1).md" → keep "CellChat analysis.md",
  fold unique content from the duplicate in, then delete the duplicate.

MOVE
- "Spatial CellChat.md" → Single_Cell/Spatial_Omics/ (topic is spatial, not the tool)

RENAME
- "untitled cellchat.md" → "CellChat LR database notes.md"

No change: 3 notes look fine.

Proceed? I won't move/merge/delete anything until you confirm.
Keep the plan honest about uncertainty — flag guesses so the user can veto them.
呈现具体的分项计划并等待确认。按操作类型分组:
针对Bioinformatics/cellchat/的重组建议(共7条笔记):

合并
- "CellChat analysis.md" + "CellChat analysis (1).md" → 保留"CellChat analysis.md",将重复笔记中的独特内容合并进去,然后删除重复笔记。

移动
- "Spatial CellChat.md" → Single_Cell/Spatial_Omics/(主题是空间组学,而非工具本身)

重命名
- "untitled cellchat.md" → "CellChat LR数据库笔记.md"

无变动:3条笔记状态良好。

是否执行?在你确认前,我不会进行任何移动/合并/删除操作。
如实说明计划中的不确定之处——标记猜测内容,以便用户可以否决。

Step 3 — Execute only after "yes"

步骤3 — 仅在用户确认“是”后执行

On confirmation, run the moves/renames/deletes through the CLI in the order that keeps links intact (usually: merge content first, then delete the emptied duplicate; move before rename if both apply). Use
move
,
rename
,
delete
,
append
/
read
for merges — never raw shell. Report what changed, and append any new folders/categories you created to
00_Index/Folder_Map.md
.
获得确认后,通过CLI按保持链接有效的顺序执行移动/重命名/删除操作(通常:先合并内容,再删除已清空的重复笔记;若同时需要移动和重命名,先移动后重命名)。使用
move
rename
delete
append
/
read
命令执行合并操作——永远不要使用原生Shell。报告已更改的内容,并将创建的任何新文件夹/分类添加到
00_Index/Folder_Map.md
中。

Known standing reorg candidates

已知待重组候选对象

If the vault's
Folder_Map.md
calls out known problem areas (legacy folders that overlap a newer one, a subfolder with accumulated near-duplicate titles, etc.), surface them when they're in scope — but still propose-and-confirm before touching anything.

如果库的
Folder_Map.md
指出了已知问题区域(与新分类重叠的旧文件夹、积累了大量近似重复标题的子文件夹等),当这些区域在范围内时需指出——但仍需先提出计划并获得确认,再进行任何操作。

Command quick reference

命令速查

NeedCommand
Read the map
obsidian vault="MyVault" read path="00_Index/Folder_Map.md"
Create/file a new note
obsidian vault="MyVault" create path="Folder/Note.md" content="..." silent
Move/relocate a note
obsidian vault="MyVault" move path="Old/Note.md" to="New/Folder"
Rename in place
obsidian vault="MyVault" rename path="Folder/Note.md" name="New Title"
Delete (to trash)
obsidian vault="MyVault" delete path="Folder/Note.md"
List files in a folder
obsidian vault="MyVault" files folder="<scope>"
Orphans / dead-ends
obsidian vault="MyVault" orphans
·
... deadends
Search with context
obsidian vault="MyVault" search:context query="..." path="<scope>"
Backlinks to a note
obsidian vault="MyVault" backlinks path="Folder/Note.md"
Append to the map
obsidian vault="MyVault" append path="00_Index/Folder_Map.md" content="- ..."
Run
obsidian help <command>
to confirm exact params — the CLI is the ground truth.
需求命令
读取映射文件
obsidian vault="MyVault" read path="00_Index/Folder_Map.md"
创建/归档新笔记
obsidian vault="MyVault" create path="Folder/Note.md" content="..." silent
移动/迁移笔记
obsidian vault="MyVault" move path="Old/Note.md" to="New/Folder"
原地重命名
obsidian vault="MyVault" rename path="Folder/Note.md" name="New Title"
删除(移至回收站)
obsidian vault="MyVault" delete path="Folder/Note.md"
列出文件夹内的文件
obsidian vault="MyVault" files folder="<scope>"
孤立笔记/无后续链接笔记
obsidian vault="MyVault" orphans
·
... deadends
带上下文的搜索
obsidian vault="MyVault" search:context query="..." path="<scope>"
笔记的反向链接
obsidian vault="MyVault" backlinks path="Folder/Note.md"
追加内容到映射文件
obsidian vault="MyVault" append path="00_Index/Folder_Map.md" content="- ..."
运行
obsidian help <command>
确认准确参数——CLI是最终依据。