init-vault

init-vault is a command for Claude Code from franciszhangkk/claude-obsidian-multi-repo-tracker. It costs 48 tokens per session (1,025 once invoked), scanned B, original, MIT.

A setup command that creates the folder structure and starter Markdown files for an Obsidian vault used to track multiple code projects.

In plain words
What is it for?
Use it to start a new project-tracking vault, reset its structure, or add the standard files to an existing empty vault.
Why use it?
It removes the manual work of creating the vault folders and copying the initial templates.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: reads .claude/ paths; mentions CLAUDE.md; names the AskUserQuestion tool.

Good fit Use it to start a new project-tracking vault, reset its structure, or add the standard files to an existing empty vault.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/franciszhangkk/claude-obsidian-multi-repo-tracker/init-vault
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.

Clone the repo
git clone --depth 1 https://github.com/franciszhangkk/claude-obsidian-multi-repo-tracker

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 init-vault

README.md
[![agentmods](https://agentmods.dev/badge/commands/franciszhangkk/claude-obsidian-multi-repo-tracker/init-vault/github.svg)](https://agentmods.dev/commands/franciszhangkk/claude-obsidian-multi-repo-tracker/init-vault)
Your own site
<a href="https://agentmods.dev/commands/franciszhangkk/claude-obsidian-multi-repo-tracker/init-vault"><img src="https://agentmods.dev/badge/commands/franciszhangkk/claude-obsidian-multi-repo-tracker/init-vault/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 init-vault

Your own site · 80×15
<a href="https://agentmods.dev/commands/franciszhangkk/claude-obsidian-multi-repo-tracker/init-vault"><img src="https://agentmods.dev/badge/commands/franciszhangkk/claude-obsidian-multi-repo-tracker/init-vault.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 48 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,025 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. 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.00048 $0.01025
Opus 5 $0.00024 $0.00513
Sonnet 5 $0.00010 $0.00205
Haiku 4.5 $0.00005 $0.00103

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

Security

Grade B, and why

init-vault 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 11d 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.

提醒用户在 `~/.claude/settings.json` 加:
commands/init-vault.md · 125 lines

What it actually says

/init-vault — 初始化 Obsidian vault

通常不需要单独调用/add-project 检测到 vault 不存在时会自动 inline 运行本命令。 直接使用的场景:重置已有 vault 结构、或想先建 vault 再逐步添加项目。

你的任务:把 templates/vault/ 下的模板复制到用户指定的 vault 路径,建立"多项目跟踪知识库"的基础结构。

执行流程

1. 确定 vault 路径

按这个优先级找:

  1. 用户在命令后传的路径参数(例如 /init-vault ~/Documents/MyVault
  2. 环境变量 $OBSIDIAN_VAULT_PATH
  3. 都没有 → 用 AskUserQuestion 问用户,给出常见候选:
    • ~/Documents/Obsidian Vault
    • ~/Desktop/Obsidian Vault
    • 让用户输入自定义路径

2. 检查目标路径状态

ls -la "<vault_path>" 2>&1
  • 不存在 → 直接创建
  • 存在但为空 → 直接初始化
  • 存在且非空 → 用 AskUserQuestion 问用户:
    • 在现有 vault 上叠加(仅写不存在的文件,已有的不覆盖)
    • 换个路径
    • 取消

3. 找到本 skill 的安装路径

# 通常是 ~/.claude/skills/claude-obsidian-multi-repo-tracker/
# 通过查找 templates/vault/首页.md 验证
SKILL_DIR="$HOME/.claude/skills/claude-obsidian-multi-repo-tracker"
[ -f "$SKILL_DIR/templates/vault/首页.md" ] || echo "skill 安装位置异常,请检查"

4. 创建目录结构

mkdir -p "<vault>/项目"
mkdir -p "<vault>/日记/claude-log"
mkdir -p "<vault>/教程"
mkdir -p "<vault>/学习笔记"

5. 复制 vault 模板

$SKILL_DIR/templates/vault/ 下的四个文件复制到 vault 根目录:

  • 首页.md
  • 开发工作流指南.md
  • CLAUDE.md
  • AGENTS.md(用户问起再说,默认也复制——不影响 Claude Code)

重要

  • 如果目标文件已存在,不要覆盖,跳过并在最后报告
  • 复制后用 Read 检查是否有 {{占位符}},目前模板里没有但未来可能加

6. 设置环境变量提醒

提醒用户在 ~/.claude/settings.json 加:

{
  "env": {
    "OBSIDIAN_VAULT_PATH": "<刚才用户选的 vault 路径>"
  }
}

或者临时(当前 shell):

export OBSIDIAN_VAULT_PATH="<vault_path>"

7. 输出总结

格式:

✅ Vault 初始化完成

路径:<vault_path>
新建文件:
  - 首页.md
  - 开发工作流指南.md
  - CLAUDE.md
  - AGENTS.md
新建目录:
  - 项目/
  - 日记/claude-log/
  - 教程/
  - 学习笔记/
跳过(已存在):
  - <如有>

下一步:
  - 设置 $OBSIDIAN_VAULT_PATH 环境变量(见上)
  - 运行 /add-project <项目名> <代码路径> 添加你的第一个项目

错误处理

  • 路径不可写 → 报错,建议用户检查权限
  • skill 安装路径找不到模板 → 报错,告诉用户重新 clone
  • 用户中途取消 → 友好退出,不留半成品(如果创建了空目录就删掉)

注意

  • 不要硬编码 frank 的路径(~/Desktop/Obsidian Vault),那只是默认候选之一
  • 不要绑定语言或技术栈
  • 不要假设用户已经在用 Obsidian 应用——纯文件操作,Obsidian 装不装都能跑
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. 11d ago First seen · 125 lines · 48 tokens per session scan B 6be074d6f93e

Subscribe to this mod's changes

init-vault is a command published in the GitHub repository franciszhangkk/claude-obsidian-multi-repo-tracker (2 stars, last pushed 4mo ago), licensed MIT. It adds 48 tokens to every session and 1,025 once invoked, about $0.0002 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-31.