Examples¶
Copy-pasteable agent-button blocks for common setups. Adjust prompt:, agent:, and model: to match your own vault and Settings.
A sufficiency-check workflow, output written into the note¶
```agent-button
text: Run Sufficiency Check
prompt: Run features/learning-artefacts/teacher-artefact-sufficiency-check.md on {{file.path}}
autoApprove: true
agent: ClaudeCode
agentOutput: file
append: belowButton
showTerminal: false
completion: responseEnd
```
A prompt that branches on frontmatter status¶
Requires Allow JavaScript expressions in prompts turned on (see Context and Templating):
```agent-button
text: Draft or review
prompt: {{= file.frontmatter.status === "draft" ? "Finish drafting " + file.basename : "Review " + file.basename }}
agent: ClaudeCode
```
A fast local pass with a mapped Ollama model¶
Assumes an OpenCode ollama provider is configured (see opencode.ai/docs/providers) and a mapping named local-fast is set up in Settings pointing at it — see Model Mappings:
```agent-button
text: Quick local summary
prompt: Summarize the open action items in {{file.path}} as a short bulleted list.
agent: OpenCode
model: local-fast
showTerminal: true
completion: manual
```
A literal model string, no mapping configured¶
Useful for a one-off test before you've set up a mapping — pastes straight from a dropdown's copy button:
```agent-button
text: Try a specific model
prompt: Summarize {{file.basename}}.
agent: OpenCode
model: ollama/qwen3.8:27b-mlx
showTerminal: true
completion: manual
```
An auto-approved background run, result appended to the note¶
```agent-button
text: File a follow-up (background)
prompt: Check {{file.path}} for anything marked TODO and list them.
agent: ClaudeCode
autoApprove: true
agentOutput: file
append: belowButton
showTerminal: false
completion: responseEnd
```
Result, once the underlying session eventually closes:

Multiple buttons, different agents, on the same note¶
Nothing stops different buttons on the same note from routing to different agents or models — a fast pass and a thorough pass side by side:
```agent-button
text: Draft this week's report
prompt: Draft a weekly report for {{file.basename}}, using the notes tagged #weekly-log from the last 7 days.
agent: ClaudeCode
model: myMainModel
showTerminal: true
completion: manual
```
```agent-button
text: Summarize with OpenCode
prompt: Summarize the open action items in {{file.path}} as a short bulleted list.
agent: OpenCode
showTerminal: true
completion: manual
```

Hand a button off to an OpenClaw hook¶
Requires an OpenClaw instance at http://127.0.0.1:18789 with its hook enabled, allowRequestSessionKey: true and "inline:" allowed in allowedSessionKeyPrefixes — see Agent Runtimes — and a runtime named openclaw configured in Settings:
```agent-button
text: Run weekly review
prompt: Run the weekly review on {{file.path}}
target: openclaw
```
Clicking it shows "Sending to openclaw…", then "Sent to openclaw ↗" — the thread keeps running on OpenClaw even after the note or Obsidian closes.
Hand a button off to a Hermes Agent (OpenAI-compatible chat)¶
Requires a Hermes Agent API server at http://127.0.0.1:8642/v1 with API_SERVER_KEY set, and a runtime named hermes (kind OpenAI-compatible chat) configured in Settings with Send session id as X-Hermes-Session-Id on and Thread-URL template hermes://open/{sessionId} — see Agent Runtimes:
```agent-button
text: Summarize today's notes
prompt: Summarize today's journal entries into three bullet points.
target: hermes
open: true
```
Clicking it shows "Sending to hermes…", then after about 5 seconds "Sent to hermes ↗", and the Hermes desktop app opens on that chat, where the reply lands when the run finishes. See Opening the Hermes chat from the thread link for what the link depends on. The run lasts only as long as Obsidian stays open.
open: false sends the prompt without opening the chat — the button still shows "Sent to hermes ↗", and clicking the ↗ opens it later, for as long as the note stays rendered. Without the session id toggle and the template the button shows plain "Sent to hermes", with no link.
Ask for text when the button is clicked¶
A button that asks for a topic before it runs:
```agent-button
text: Summarize a topic
prompt: Summarize what this note says about {{ input }} in three bullet points.
input: Which topic?
```
Clicking it swaps the button for a text field showing "Which topic?", with Submit and Cancel. Type Obsidian Atlas dark mode and press Enter, and the terminal opens with the prompt Summarize what this note says about Obsidian Atlas dark mode in three bullet points. Esc or Cancel brings the button back and runs nothing. See input for the full rules.