switch-brain

A command for changing the active Obsidian workspace by updating configuration files. Obsidian is a note-taking application, and a workspace is the folder containing its settings.

In plain words
What is it for?
For switching the configured Obsidian workspace path in Claude settings and MCP configuration, where MCP refers to connected tools.
Why use it?
It reduces the risk of editing the wrong workspace by checking that the supplied path is absolute and contains Obsidian configuration files.

Command for Claude Code

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/vybe/project_cornelius/switch-brain
Clone the repo
git clone --depth 1 https://github.com/vybe/project_cornelius

Made for: Claude Code.

Per session 12 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 664 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. 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.00012 $0.00664
Opus 5 $0.00006 $0.00332
Sonnet 5 $0.00002 $0.00133
Haiku 4.5 $0.00001 $0.00066

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

Security

Grade B, and why

switch-brain scanned grade B with 1 finding 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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

- Read the file at `/Users/eugene/Dropbox/Coding/project_cornelius/.claude/settings.md`
.claude/commands/switch-brain.md · 63 lines

How it starts

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

Switch Brain Command

Switch the active Obsidian workspace by updating all configuration files to point to a new workspace path.

IMPORTANT: This should point to your Obsidian workspace folder (containing .obsidian/ directory), NOT individual vault subfolders.

New Workspace Path

$ARGUMENTS

Instructions

  1. Validate the path format:

    • Ensure $ARGUMENTS is a full absolute path
    • CRITICAL: Verify the path points to a workspace folder (should contain .obsidian/ directory), NOT a vault subfolder
    • If the path looks like it's pointing to a vault subfolder (e.g., /path/Brain), warn the user and ask them to provide the parent workspace path instead
    • If the path looks invalid or incomplete, ask the user to provide the full path
  2. Update .claude/settings.md:

    • Read the file at /Users/eugene/Dropbox/Coding/project_cornelius/.claude/settings.md
    • Replace the VAULT_BASE_PATH= value with: VAULT_BASE_PATH=$ARGUMENTS
    • Use the Edit tool to make this change
  3. Update .mcp.json:

    • Read the file at /Users/eugene/Dropbox/Coding/project_cornelius/.mcp.json
    • Find all workspace path references in both the obsidian-mcp and smart-connections server configurations
    • Replace all old workspace paths with: $ARGUMENTS
    • Use the Edit tool to update all occurrences:
      • Line for obsidian-mcp args (should be just $ARGUMENTS)
      • Line for smart-connections SMART_VAULT_PATH environment variable (should be $ARGUMENTS)
  4. Confirm completion:

    • Display a summary of what was changed
    • Show the new workspace path that's now configured
    • IMPORTANT: Display this final message to the user:
✅ Workspace configuration updated successfully!

New workspace path: $ARGUMENTS

⚠️  RESTART REQUIRED: You must restart Claude Code for these changes to take effect.

The MCP servers (obsidian-mcp and smart-connections) will connect to the new workspace after restart.

💡 TIP: This workspace folder should contain your .obsidian/ directory. If you have multiple vaults, they should be subfolders within this workspace.

Read the full file on GitHub · 63 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 · 63 lines · 12 tokens per session scan B 053fd19a26f0

Subscribe to this mod's changes

switch-brain is a command published in the GitHub repository vybe/project_cornelius (5 stars, last pushed 10mo ago), licensed MIT. It adds 12 tokens to every session and 664 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.