setup

setup is a command for Claude Code from takashito/claude-obsidian-chronicle. It costs 22 tokens per session (1,668 once invoked), scanned D, original, MIT.

A configuration command for the obsidian-chronicle plugin, which records Claude Code sessions as notes in Obsidian, a note-taking app. It creates an obsidian-chronicle.json file for your user account or one project.

In plain words
What is it for?
Use it to configure the Obsidian vault path and optional session and daily-note folders for obsidian-chronicle.
Why use it?
It avoids editing configuration files by hand and lets you choose where the plugin stores session notes and daily entries. Project settings can override user-level settings.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: names the AskUserQuestion tool; positional $N argument; mentions Claude Code.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the obsidian-chronicle plugin — 2 commands, 1 agent shipped together

Good fit Use it to configure the Obsidian vault path and optional session and daily-note folders for obsidian-chronicle.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add takashito/claude-obsidian-chronicle
Claude Code
/plugin install obsidian-chronicle

Made for: Claude Code.

Or install obsidian-chronicle, the plugin that ships this one along with the rest of its 2 commands, 1 agent.

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 setup

README.md
[![agentmods](https://agentmods.dev/badge/commands/takashito/claude-obsidian-chronicle/setup.svg)](https://agentmods.dev/commands/takashito/claude-obsidian-chronicle/setup)
Your own site
<a href="https://agentmods.dev/commands/takashito/claude-obsidian-chronicle/setup"><img src="https://agentmods.dev/badge/commands/takashito/claude-obsidian-chronicle/setup.svg" alt="Measured on agentmods" height="20"></a>
Per session 22 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,668 The whole file, excluding the scripts and references it only reads on demand.
Security scan D 2 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.00022 $0.01668
Opus 5 $0.00011 $0.00834
Sonnet 5 $0.00004 $0.00334
Haiku 4.5 $0.00002 $0.00167

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

Security

Grade D, and why

setup scanned grade D with 2 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 7d 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.

PLUGIN="${CLAUDE_PLUGIN_ROOT:-$(jq -r '.extraKnownMarketplaces["obsidian-chronicle"].source.path // empty' "$HOME/.claude/settings.json" 2>/dev/null)}"

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

rm -rf "${XDG_STATE_HOME:-$HOME/.local/state}/obsidian-chronicle/config-cache"
commands/setup.md · 114 lines

How it starts

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

The user wants to configure the obsidian-chronicle plugin. Your job: generate an obsidian-chronicle.json file in either the user-level state dir (the machine-wide default) or the current project (applies only when Claude Code runs under that project tree).

Config is JSON only. The shared resolver hooks/resolve-config.sh reads these files; understand its model before writing:

  • Locations (project overrides user, key-by-key):
    • user-level: ${XDG_STATE_HOME:-$HOME/.local/state}/obsidian-chronicle/obsidian-chronicle.json
    • project: nearest .claude/obsidian-chronicle.json found walking up from cwd (not $HOME itself)
  • Merge: built-in defaults ← user JSON ← project JSON.
  • vaultPath: resolved from project → user → obsidian vault CLI → else nothing is written (the hook skips). No silent ~/obsidian fallback.
  • Relative sessionsDir/dailyDir are resolved against vaultPath; a value starting with / or ~ is absolute.

Steps (follow in order, do not skip)

1. Resolve the plugin root and the two candidate destinations

PLUGIN="${CLAUDE_PLUGIN_ROOT:-$(jq -r '.extraKnownMarketplaces["obsidian-chronicle"].source.path // empty' "$HOME/.claude/settings.json" 2>/dev/null)}"
STATE_HOME="${XDG_STATE_HOME:-$HOME/.local/state}"
USER_DEST="$STATE_HOME/obsidian-chronicle/obsidian-chronicle.json"
PROJECT_DEST="$(pwd)/.claude/obsidian-chronicle.json"
echo "plugin=$PLUGIN"; echo "user=$USER_DEST"; echo "project=$PROJECT_DEST"

If $PLUGIN is empty, abort: tell the user to install/register the plugin first.

2. Detect a default vault path

command -v obsidian >/dev/null 2>&1 && obsidian vault 2>/dev/null | awk -F'\t' '$1=="path"{print $2}'

Whatever this prints is the recommended vaultPath. If it prints nothing (no obsidian CLI, or Obsidian not running), fall back to suggesting ~/obsidian and tell the user to confirm/edit it.

3. Ask where to save

Use AskUserQuestion (single-select):

  • User-level (<USER_DEST>) — machine-wide default. Recommended. Used for "one vault per computer".
  • This project (<PROJECT_DEST>) — applies only under this project tree. Overrides the user-level file key-by-key. Used for a project-local vault / project wiki.

Read the full file on GitHub · 114 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. 7d ago First seen · 114 lines · 22 tokens per session scan D f4606e7b45a0

Subscribe to this mod's changes

setup is a command published in the GitHub repository takashito/claude-obsidian-chronicle (1 stars, last pushed 2mo ago), licensed MIT. It adds 22 tokens to every session and 1,668 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it D with 2 findings (reads agent configuration directories, recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.