/learner:install-obsidian [path/to/vault]from learner
Set up Obsidian plugins for Claude Code integration — installs BRAT, obsidian-terminal, and obsidian-claude-selection, then enables them and adds a CMD+J terminal hotkey.
Ships in learner. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Automates the full Obsidian + Claude Code plugin setup. Safe to run multiple times — every step is idempotent.
Installs:
Configures:
CMD+J hotkey to open the integrated terminal.claude/hooks/inject-selection.py in the vault.claude/settings.json with the UserPromptSubmit hookIf $ARGUMENTS is provided, treat it as the vault path and verify that a .obsidian/ directory exists inside it.
If no argument is given, search for .obsidian/ using Glob in the following locations (stop at first match):
.obsidian)../.obsidian, ../../.obsidian, ../../../.obsidian)~/Documents/**/.obsidian (depth 2)~/.obsidianIf multiple vaults are found, use the first one and tell the user which vault was selected.
If no vault is found → abort immediately with this message:
No Obsidian vault detected.
Run `/install-obsidian path/to/vault` to specify your vault path.
Set VAULT to the resolved vault root for all subsequent steps.
Plugin directory: $VAULT/.obsidian/plugins/obsidian42-brat/
Idempotency check: If $VAULT/.obsidian/plugins/obsidian42-brat/main.js already exists, skip this step and report "BRAT already installed."
Otherwise:
curl -s https://api.github.com/repos/TfTHacker/obsidian42-brat/releases/latest
browser_download_url for main.js, manifest.json, and styles.css from the assets array.mkdir -p $VAULT/.obsidian/plugins/obsidian42-bratcurl -sL <url> -o <destination>.File: $VAULT/.obsidian/plugins/obsidian42-brat/data.json
Idempotency: Read the file if it exists. If ivorscott/obsidian-claude-selection is already in pluginList, skip writing and report "BRAT already configured."
Start from this default if the file does not exist:
{
"pluginList": [],
"pluginSubListFrozenVersion": [],
"themesList": [],
"updateAtStartup": true,
"updateThemesAtStartup": true,
"enableAfterInstall": true,
"loggingEnabled": false,
"loggingPath": "BRAT-log",
"loggingVerboseEnabled": false,
"debuggingMode": false,
"notificationsEnabled": true,
"globalTokenName": "",
"personalAccessToken": "",
"selectLatestPluginVersionByDefault": false,
"allowIncompatiblePlugins": false
}
Merge the following, preserving all other existing fields:
"ivorscott/obsidian-claude-selection" to pluginList (if not already present){"repo": "ivorscott/obsidian-claude-selection", "version": ""} to pluginSubListFrozenVersion (if the repo isn't already listed)enableAfterInstall: trueupdateAtStartup: trueWrite the merged result back with the Write tool.
Plugin directory: $VAULT/.obsidian/plugins/claude-selection/
Idempotency check: If $VAULT/.obsidian/plugins/claude-selection/main.js already exists, skip and report "obsidian-claude-selection already installed."
Otherwise:
curl -s https://api.github.com/repos/ivorscott/obsidian-claude-selection/releases/latest
browser_download_url for main.js and manifest.json from the assets array.mkdir -p $VAULT/.obsidian/plugins/claude-selectioncurl -sL <url> -o <destination>.Why direct install instead of relying on BRAT? BRAT's
enableAfterInstallflag only fires during the interactive modal flow (addPlugin()). When BRAT auto-downloads frompluginListon Obsidian startup, it uses a different code path that does not callplugins.enablePlugin(). Direct install avoids the ~1 min wait and the extra restart.
Plugin directory: $VAULT/.obsidian/plugins/terminal/
Idempotency check: If $VAULT/.obsidian/plugins/terminal/main.js already exists, skip and report "obsidian-terminal already installed."
Otherwise:
curl -s https://api.github.com/repos/polyipseity/obsidian-terminal/releases/latest
browser_download_url for main.js and manifest.json from the assets array. Also download styles.css if present.mkdir -p $VAULT/.obsidian/plugins/terminalcurl -sL <url> -o <destination>.File: $VAULT/.obsidian/community-plugins.json
Idempotency: Read the existing array (or start with []). Add only the IDs that are not already present:
"obsidian42-brat""terminal""claude-selection"Write back only if the array changed.
File: $VAULT/.obsidian/hotkeys.json
Idempotency: Read the existing object (or start with {}). Only add the following entry if "terminal:open-terminal.integrated.root" is not already a key:
"terminal:open-terminal.integrated.root": [
{
"modifiers": ["Mod"],
"key": "J"
}
]
Never modify or remove existing hotkey bindings. Write back only if changed.
These two files wire up the Obsidian selection to Claude Code.
$VAULT/.claude/hooks/inject-selection.pyIdempotency: Skip if the file already exists.
Otherwise create it with this exact content:
#!/usr/bin/env python3
import sys, os
root = os.environ.get('CLAUDE_PROJECT_DIR', os.getcwd())
selection_file = os.path.join(root, '.claude-selection')
if not os.path.isfile(selection_file):
sys.exit(0)
try:
with open(selection_file, 'r', encoding='utf-8') as f:
content = f.read().strip()
except Exception as e:
print(f'claude-selection hook error: {e}', file=sys.stderr)
sys.exit(0)
if not content:
sys.exit(0)
parts = content.split('---\n', 1)
selected_text = parts[1].strip() if len(parts) > 1 else content
line_count = len(selected_text.splitlines())
sys.stderr.write(f'> {line_count} line{"s" if line_count != 1 else ""} of Obsidian context\n')
print(f'The user has selected the following text from their Obsidian notes:\n\n{content}')
Use mkdir -p $VAULT/.claude/hooks before writing.
$VAULT/.claude/settings.jsonIdempotency: Read the file if it exists. Skip writing if a UserPromptSubmit hook is already present.
Otherwise write:
{
"hooks": {
"UserPromptSubmit": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "python3 \"$CLAUDE_PROJECT_DIR\"/.claude/hooks/inject-selection.py"
}
]
}
]
}
}
If settings.json already exists but has no UserPromptSubmit key, merge the hook in rather than overwriting the file.
Print a table showing what was installed vs. skipped, for example:
Obsidian setup complete for: /path/to/vault
BRAT installed
obsidian-claude-selection installed
obsidian-terminal already installed (skipped)
community-plugins.json updated
hotkeys.json already configured (skipped)
inject-selection.py created
.claude/settings.json already configured (skipped)
Restart Obsidian once. All three plugins will be active immediately.
BRAT will keep obsidian-claude-selection up to date automatically.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub ivorscott/cc-marketplace --plugin learner6 skills in this plugin
/analogyGenerate an analogy for highlighted/selected text and insert it below the selection in the markdown file. Use when the user selects text and asks for an analogy./asciiRenders an ASCII diagram below selected or described content in a markdown file. Triggered when the user says "ascii", "diagram", "render", or asks to render an ASCII diagram from highlighted text or a description./book<Book Topic>: <Chapter Title>Summarize each chapter of the bookOther plugins' skills for the same job