setup

A setup command for connecting the Vault PKM plugin to an Obsidian vault, which is a folder containing Markdown notes. It configures the vault location, optionally enables semantic search, and checks the connection.

In plain words
What is it for?
Use it when installing or repairing Vault PKM, setting the vault path, enabling semantic search, and verifying that the connection works.
Why use it?
It avoids manual configuration mistakes and keeps sensitive API keys out of the chat history.

Command

Part of the vault-pkm plugin — 6 skills, 2 commands, 3 agents, 2 hooks shipped together

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/adrianv101/obsidian-pkm-plugin/setup
Clone the repo
git clone --depth 1 https://github.com/AdrianV101/obsidian-pkm-plugin

Or install vault-pkm, the plugin that ships this one along with the rest of its 6 skills, 2 commands, 3 agents, 2 hooks.

Per session 18 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,012 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.00018 $0.01012
Opus 5 $0.00009 $0.00506
Sonnet 5 $0.00004 $0.00202
Haiku 4.5 $0.00002 $0.00101

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

Security

Grade B, and why

setup 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 3d 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.

If the path is valid, add it to `~/.claude/settings.json` under the `env` block:
commands/setup.md · 91 lines

How it starts

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

Vault PKM Setup

You are configuring the Vault PKM plugin. Walk the user through these steps:

Step 1: Vault Path

Ask the user for their Obsidian vault path. Validate that:

  • The path exists and is a directory
  • It contains at least one .md file
  • Suggest ~/Documents/PKM as a default

If the path is valid, add it to ~/.claude/settings.json under the env block:

{
  "env": {
    "VAULT_PATH": "/absolute/path/to/vault"
  }
}

Read the file first, merge with existing env vars (don't overwrite other settings), and write back. Verify the MCP server can connect after setting it.

Step 2: OpenAI API Key (Optional)

Ask if they want semantic search features (vault_semantic_search, vault_suggest_links). If yes:

  • NEVER ask the user to type their API key in the chat — it would be stored in conversation history
  • Tell them to open ~/.claude/settings.json in their text editor (outside of Claude Code) and add VAULT_PKM_OPENAI_KEY to the env block:
    {
      "env": {
        "VAULT_PATH": "/path/to/vault",
        "VAULT_PKM_OPENAI_KEY": "sk-your-key-here"
      }
    }
    
  • Explain the variable is named VAULT_PKM_OPENAI_KEY (not OPENAI_API_KEY) to avoid conflicts with project-scoped OpenAI keys. Users upgrading from earlier releases can keep OBSIDIAN_PKM_OPENAI_KEY — it still works as a deprecated fallback — but should rename it at their convenience.
  • Explain they can get a key from https://platform.openai.com/api-keys
  • Explain this enables 2 additional tools (semantic search + link suggestions) but is completely optional
  • Tell them to restart Claude Code after saving the file

Step 3: Tool Permissions

Ask the user if they want to auto-approve all PKM vault tools (so they don't get prompted for each tool call). If yes, add this to the permissions.allow array in ~/.claude/settings.json:

mcp__plugin_vault-pkm_vault-pkm__*

Read the file first, merge with existing permissions (don't overwrite), and write back. This allows all vault_read, vault_write, vault_search, etc. tools to run without per-call confirmation.

Read the full file on GitHub · 91 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. 3d ago First seen · 91 lines · 18 tokens per session scan B eb57e76f64e4

Subscribe to this mod's changes

setup is a command published in the GitHub repository AdrianV101/obsidian-pkm-plugin (13 stars, last pushed 1mo ago), licensed MIT. It adds 18 tokens to every session and 1,012 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-30.