migrate

A command for copying an existing Obsidian vault into SuperBrain's category structure. Obsidian is a note-taking app that stores notes in a folder, and the migration leaves the source unchanged.

In plain words
What is it for?
Finding an Obsidian vault, copying notes into SuperBrain, handling name collisions, skipping already migrated notes, and performing a dry run.
Why use it?
It reduces the risk of damaging notes, overwriting existing destinations, or creating duplicates when the migration is repeated.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/m3talux/superbrain/migrate
Clone the repo
git clone --depth 1 https://github.com/m3talux/superbrain
Per session 39 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,950 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00039 $0.01950
Opus 5 $0.00019 $0.00975
Sonnet 5 $0.00008 $0.00390
Haiku 4.5 $0.00004 $0.00195

Measured 2d ago against content hash 11cfc771c095, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

migrate scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/migrate.md · 141 lines

How it starts

The opening of the file, as written. The whole thing — 141 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are running the SuperBrain /superbrain:migrate command. Your job is to fold the user's existing Obsidian vault into SuperBrain's category structure non-destructively.

The user may have passed an argument: $ARGUMENTS.

Hard invariants — must never be violated

  1. The source vault is READ-ONLY. Never Write, Edit, rm, mv, or otherwise modify any file inside the source vault. Use the Read tool only. No git operations on the source.
  2. Never overwrite a destination note. If a destination note already exists for a different source path, write the copy to <basename>-<8-char-hash>.md and record the collision in the final report.
  3. Idempotent on re-run. A destination note whose frontmatter migrated_from matches the current source path counts as already migrated — skip it. So re-running this command on the same source produces no duplicates and resumes cleanly after an interruption.

Step 1 — Locate the source vault

Determine the source vault path in this priority order:

  1. If $ARGUMENTS is a non-empty path:

    • If it's --dry-run (no path), set DRY_RUN=true and continue without a path.
    • Otherwise: resolve it; if it's an existing directory containing an .obsidian/ folder OR at least one .md file at depth ≤ 2, accept it as the source. If --dry-run is also in $ARGUMENTS, set DRY_RUN=true.
  2. Otherwise, auto-detect by reading Obsidian's vault registry. The location depends on host OS:

    • macOS: ~/Library/Application Support/obsidian/obsidian.json
    • Linux: $XDG_CONFIG_HOME/obsidian/obsidian.json if set, else ~/.config/obsidian/obsidian.json
    • Windows: %APPDATA%\obsidian\obsidian.json (typically ~/AppData/Roaming/obsidian/obsidian.json)

    The file's vaults object lists vaults the user has opened, each with a path. Filter to entries whose path exists on disk.

  3. If the registry produces 0 candidates, scan these common defaults (existence check only):

    • All platforms: ~/Obsidian, ~/Documents/Obsidian, ~/Documents/Obsidian Vault
    • macOS only: ~/Library/Mobile Documents/iCloud~md~obsidian/Documents/* (iCloud)
  4. Decision:

    • 0 candidates → ask the user: "I couldn't auto-detect an Obsidian vault. Could you give me the absolute path?" Wait for a reply; validate it (directory, contains markdown).
    • 1 candidate → confirm with the user: "I found <path> — proceed with that?". Wait.
    • >1 candidate → present the list with brief identifiers and ask the user to pick.

Read the full file on GitHub · 141 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 141 lines · 39 tokens per session scan A 11cfc771c095

Subscribe to this mod's changes

migrate is a command published in the GitHub repository m3talux/superbrain (41 stars, last pushed 22d ago), licensed MIT. It adds 39 tokens to every session and 1,950 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.