swarm: Command for Claude Code

.claude/commands/obsidian.md

obsidian is a command for Claude Code from swarm-ai-research/swarm. It costs 0 tokens per session (602 once invoked), scanned A, original, MIT.

A command that opens an Obsidian note or vault from the command line. Obsidian is an app for storing linked notes in a local folder called a vault.

In plain words
What is it for?
Use it to open the current vault's root or a specific note by path, including notes whose filenames end in .md.
Why use it?
It avoids manually finding the right vault and note before opening them. The command can detect the vault associated with the current working directory and build the appropriate Obsidian link.

Command for Claude Code

Written for Claude Code: installed under .claude/.

This is swarm-ai-research/swarm's own configuration. It tells Claude Code how to work on swarm itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything swarm configures →

Not installable: its command points at a path on the author’s own machine, so it runs nowhere else. The line is /Users/raelisavitt/swarm-artifacts.

Reuse

Borrowing it

Nothing to install: this file belongs to swarm-ai-research/swarm. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/swarm-ai-research/swarm/main/.claude/commands/obsidian.md
Clone the repo
git clone --depth 1 https://github.com/swarm-ai-research/swarm

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for obsidian

README.md
[![agentmods](https://agentmods.dev/badge/commands/swarm-ai-research/swarm/obsidian/github.svg)](https://agentmods.dev/commands/swarm-ai-research/swarm/obsidian)
Your own site
<a href="https://agentmods.dev/commands/swarm-ai-research/swarm/obsidian"><img src="https://agentmods.dev/badge/commands/swarm-ai-research/swarm/obsidian/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for obsidian

Your own site · 80×15
<a href="https://agentmods.dev/commands/swarm-ai-research/swarm/obsidian"><img src="https://agentmods.dev/badge/commands/swarm-ai-research/swarm/obsidian.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 602 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00000 $0.00602
Opus 5 $0.00000 $0.00301
Sonnet 5 $0.00000 $0.00120
Haiku 4.5 $0.00000 $0.00060

Measured 9d ago against content hash e7809bab55fd, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

obsidian 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 9d 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.

.claude/commands/obsidian.md · 70 lines

How it starts

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

/obsidian

Open a file or vault in Obsidian from the CLI, with auto-detected vault name.

Usage

/obsidian [file-path]

Examples:

  • /obsidian (opens the vault root)
  • /obsidian vault/dashboards/suggestions (opens a specific note)
  • /obsidian vault/claims/claim-tax-welfare-tradeoff (opens a claim card)

Behavior

1. Find the Obsidian vault registry

cat ~/Library/Application\ Support/obsidian/obsidian.json

Parse the JSON to get the list of registered vaults. Each vault has a path and open status.

2. Match the vault

  • If the current working directory (or a parent) matches a registered vault path, use that vault.
  • If working in swarm-artifacts/, match the vault registered at /Users/raelisavitt/swarm-artifacts (or wherever it lives).
  • If no match is found, report: "No Obsidian vault registered for this directory. Open Obsidian and add it as a vault first."

Extract the vault directory name from the path (e.g. /Users/raelisavitt/swarm-artifactsswarm-artifacts). This is the vault name Obsidian uses in URLs.

3. Build the URL

If a file path argument was provided:

  • Resolve it relative to the vault root
  • Strip .md extension if present
  • URL-encode the path (replace / with %2F, spaces with %20)
  • Build: obsidian://open?vault=<vault-name>&file=<encoded-path>

If no file path:

  • Build: obsidian://open?vault=<vault-name>

4. Open

open "<url>"

If the open command fails with "no application knows how to open", report: "Obsidian is not installed. Install from https://obsidian.md or brew install --cask obsidian."

5. Report

Opened in Obsidian:
  Vault: <vault-name>
  File:  <file-path> (or "vault root")

Edge Cases

  • If the user provides a full absolute path (e.g. /Users/.../vault/claims/foo.md), convert it to a vault-relative path.
  • If the file doesn't exist, warn but still attempt to open (Obsidian will create a new note).
  • If multiple vaults match, prefer the one marked "open": true.

Read the full file on GitHub · 70 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. 9d ago First seen · 70 lines · 0 tokens per session scan A e7809bab55fd

Subscribe to this mod's changes

obsidian is a command published in the GitHub repository swarm-ai-research/swarm (42 stars, last pushed today), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 602 tokens. 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.