Tips & Tricks (अपडेट: 3/6/2026)

Claude Code x Obsidian गाइड: Vault संरचना, permissions, templates और link audit

Obsidian Vault को Claude Code से सुरक्षित चलाने का workflow: daily logs, handoff, snippets, content ops और link audit.

Claude Code x Obsidian गाइड: Vault संरचना, permissions, templates और link audit

Obsidian Vault समय के साथ ज्यादा उपयोगी होता है, लेकिन उसकी सफाई भी मुश्किल होती जाती है। Daily notes बढ़ते हैं, project notes पुराने हो जाते हैं, code snippets में version या failure context गायब हो जाता है, और content ideas सही internal links या CTA से नहीं जुड़ते। Claude Code मदद कर सकता है, क्योंकि Vault असल में Markdown files की एक folder tree है।

सुरक्षित तरीका यह नहीं है कि AI से पूरा Vault दोबारा व्यवस्थित करवा दिया जाए। बेहतर workflow सीमित है: साफ folder structure, छोटे permissions, reusable note templates, और हर बदलाव के बाद link audit। शुरुआती लोगों के लिए: Vault नोट्स का folder है, और harness वह काम करने की सीमा है जो agent को बताती है कि वह कहां read, write और verify कर सकता है।

इस guide में चार use case हैं: daily logs, project handoff, code snippets और content operations। साथ में हर बड़ा pitfall और risk भी है, क्योंकि असली नुकसान खराब भाषा से कम और टूटे links, गलत YAML Properties या private notes पढ़े जाने से ज्यादा होता है।

Integration model

Obsidian की official help बताती है कि internal links [[Note name]] जैसे Wikilinks या Markdown links से बनाए जा सकते हैं। Daily notes date-based logs के लिए core plugin है। Templates {{date}} जैसे values डाल सकते हैं, और Properties note के ऊपर YAML metadata रखती हैं। Official pages देखें: internal links, Daily notes, Templates, Properties, और Web Clipper templates

Claude Code में safety boundary settings और permissions से बनती है। CLAUDE.md Vault के नियम सिखाता है। .claude/settings.json तय करता है कि कौन से folders सुरक्षित हैं और कौन से off limits हैं।

flowchart LR
  A["Inbox"] --> B["Claude Code review"]
  B --> C["Daily logs"]
  B --> D["Projects"]
  B --> E["Content ops"]
  C --> F["Obsidian links"]
  D --> F
  E --> F
  F --> G["Link audit"]

Source of truth Obsidian का Markdown ही रहना चाहिए। Claude Code sorting, summary, draft और verification करे; वह Vault का मालिक न बने।

छोटी Vault structure से शुरू करें

बहुत ज्यादा folders शुरू में confusion बढ़ाते हैं। यह structure छोटे team या personal Vault के लिए काफी है।

mkdir -p inbox daily projects content-ops snippets templates scripts archive private
FolderकामClaude Code के लिए safe काम
inbox/raw notes और Web Clipper capturescreate और triage
daily/daily logs और working memorycreate, append, yesterday summary
projects/project handoff और decisionshandoff update
content-ops/article ideas, CTA, publishing notesdrafts और links organize
snippets/commands और code examplescontext और tags जोड़ना
templates/Obsidian templatesपढ़ना safe, edit approval से
archive/completed notesedit नहीं
private/personal या secret dataread नहीं

यह चार practical workflows देता है। Daily logs unfinished tasks आगे ले जाते हैं। Project handoff में goal, current state, next action और risk साफ रहता है। Snippets में runnable command, dependency version और failure example रहता है। Content operations में official links, internal links, /products/ और /training/ की जांच होती है।

Vault root में CLAUDE.md रखें

यह file abstract advice नहीं, काम के नियम होनी चाहिए।

# Obsidian Vault Rules

## Purpose
- This vault stores daily logs, project handoffs, code snippets, and content operations notes.
- Keep notes useful in Obsidian without requiring Claude Code to read private files.

## Directory policy
- `daily/`: create or update daily notes in `YYYY-MM-DD.md`.
- `projects/`: maintain one handoff note per active project.
- `content-ops/`: maintain article plans, CTA checks, and publishing notes.
- `snippets/`: store runnable commands and code examples with context.
- `templates/`: read freely, but ask before editing.
- `archive/` and `private/`: do not edit. Do not summarize private files.

## Note rules
- Use Wikilinks like `[[Project name]]` for internal links.
- Use YAML properties at the top of notes.
- Keep one paragraph under five lines.
- Add a `source:` property when a note comes from a URL.
- Add `status: draft`, `status: active`, or `status: done`.

## Safety rules
- Never rename existing notes without asking first.
- Never rewrite `.obsidian/` settings.
- Before bulk edits, list the target files and wait for approval.
- After changes, run `node scripts/audit-wikilinks.cjs .`.

सबसे common pitfall है “मेरे Vault को साफ कर दो” जैसा prompt। Claude Code folders, headings और tags guess करेगा। Guessing से notes सुंदर दिख सकते हैं, लेकिन search और backlinks खराब हो सकते हैं।

Permissions को narrow रखें

Vault में .claude/settings.json बनाएं।

{
  "$schema": "https://json.schemastore.org/claude-code-settings.json",
  "permissions": {
    "allow": [
      "Read(./CLAUDE.md)",
      "Read(./daily/**)",
      "Read(./projects/**)",
      "Read(./content-ops/**)",
      "Read(./snippets/**)",
      "Read(./templates/**)",
      "Read(./scripts/**)",
      "Edit(./daily/**)",
      "Edit(./projects/**)",
      "Edit(./content-ops/**)",
      "Edit(./snippets/**)",
      "Write(./inbox/**)",
      "Write(./daily/**)",
      "Write(./projects/**)",
      "Write(./content-ops/**)",
      "Write(./snippets/**)",
      "Bash(node scripts/audit-wikilinks.cjs .)"
    ],
    "ask": [
      "Edit(./templates/**)",
      "Bash(git *)",
      "WebFetch"
    ],
    "deny": [
      "Read(./private/**)",
      "Read(./**/.env)",
      "Read(./**/.env.*)",
      "Edit(./.obsidian/**)",
      "Edit(./archive/**)",
      "Write(./archive/**)",
      "Bash(rm *)",
      "Bash(del *)"
    ]
  }
}

यह config routine note work allow करता है, लेकिन templates, git और web access पर पूछता है। Real Vault में broad bypass mode avoid करें; उसे सिर्फ disposable test Vault या isolated environment में रखें।

तीन templates बनाएं

Daily template हल्की होनी चाहिए।

---
date: "{{date:YYYY-MM-DD}}"
status: active
tags:
  - daily
---

# {{date:YYYY-MM-DD}}

## Today
- [ ]

## Learned
-

## Questions
-

## Links
- [[Weekly review]]

Project handoff template next action को सबसे साफ रखती है।

---
status: active
owner: Masa
tags:
  - project
  - handoff
updated: "{{date:YYYY-MM-DD}}"
---

# Project handoff: {{title}}

## Goal

## Current state

## Next action
- [ ]

## Decisions
-

## Risks and pitfall
-

## Links
- [[Daily note]]
- [[Related snippet]]

Content operations template में monetization path शुरू से रखें।

---
status: draft
channel: blog
source:
target_cta:
  - /products/
  - /training/
tags:
  - content-ops
---

# Content ops note: {{title}}

## Search intent

## Reader problem

## Outline

## Internal links
- [[Claude Code approval sandbox guide]]
- [[Claude Code documentation generation]]

## Monetization CTA
- Product CTA:
- Training CTA:

## Publish checklist
- [ ] Official links checked
- [ ] Code examples tested
- [ ] Broken internal links audited

Related reading के लिए approval और sandbox, documentation generation, और content funnel audit देखें। Reusable templates के लिए products और team rollout के लिए training use करें।

इसे scripts/audit-wikilinks.cjs में save करें।

#!/usr/bin/env node
const fs = require("node:fs");
const path = require("node:path");

const vaultRoot = path.resolve(process.argv[2] || ".");
const ignoredDirs = new Set([".git", ".obsidian", ".trash", "node_modules"]);
const allFiles = [];
const markdownFiles = [];

function walk(dir) {
  for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
    if (ignoredDirs.has(entry.name)) continue;
    const full = path.join(dir, entry.name);
    if (entry.isDirectory()) {
      walk(full);
    } else if (entry.isFile()) {
      allFiles.push(full);
      if (entry.name.toLowerCase().endsWith(".md")) markdownFiles.push(full);
    }
  }
}

function toPosix(filePath) {
  return filePath.split(path.sep).join("/");
}

function withoutMd(value) {
  return value.replace(/\.md$/i, "");
}

function stripTarget(raw) {
  return raw.split("|")[0].split("#")[0].split("^")[0].trim();
}

function safeDecode(value) {
  try {
    return decodeURIComponent(value);
  } catch {
    return value;
  }
}

function isExternal(target) {
  return /^(https?:|mailto:|obsidian:|#|\/)/i.test(target);
}

function candidateKeys(target, fromFile) {
  const clean = safeDecode(stripTarget(target));
  if (!clean) return [];
  const keys = new Set();
  const normalized = toPosix(path.normalize(clean));
  keys.add(normalized);
  keys.add(withoutMd(normalized));

  if (clean.includes("/") || clean.includes("\\")) {
    const fromDir = path.dirname(toPosix(path.relative(vaultRoot, fromFile)));
    const relative = toPosix(path.normalize(path.join(fromDir, clean)));
    keys.add(relative);
    keys.add(withoutMd(relative));
  } else {
    keys.add(withoutMd(path.posix.basename(normalized)));
    keys.add(path.posix.basename(normalized));
  }

  return [...keys].filter(Boolean);
}

walk(vaultRoot);

const byPath = new Map();
const byBase = new Map();

for (const file of allFiles) {
  const rel = toPosix(path.relative(vaultRoot, file));
  const lowerRel = rel.toLowerCase();
  byPath.set(lowerRel, file);
  if (rel.toLowerCase().endsWith(".md")) byPath.set(withoutMd(lowerRel), file);

  const base = rel.toLowerCase().endsWith(".md")
    ? withoutMd(path.posix.basename(rel)).toLowerCase()
    : path.posix.basename(rel).toLowerCase();
  const list = byBase.get(base) || [];
  list.push(file);
  byBase.set(base, list);
}

const problems = [];
const wikilink = /!?\[\[([^\]]+)\]\]/g;
const markdownLink = /!?\[[^\]]*\]\(([^)]+)\)/g;

for (const file of markdownFiles) {
  const text = fs.readFileSync(file, "utf8");
  const rel = toPosix(path.relative(vaultRoot, file));
  const targets = [];
  let match;

  while ((match = wikilink.exec(text))) targets.push(match[1]);
  while ((match = markdownLink.exec(text))) {
    const target = match[1].replace(/^<|>$/g, "").trim();
    if (!isExternal(target)) targets.push(target);
  }

  for (const target of targets) {
    const clean = stripTarget(target);
    if (!clean || isExternal(clean)) continue;
    const keys = candidateKeys(clean, file);
    const pathHit = keys.some((key) => byPath.has(key.toLowerCase()));
    const baseHits = keys.flatMap((key) => byBase.get(path.posix.basename(key).toLowerCase()) || []);

    if (!pathHit && baseHits.length === 0) {
      problems.push(`${rel} -> missing [[${clean}]]`);
    } else if (!pathHit && baseHits.length > 1) {
      problems.push(`${rel} -> ambiguous [[${clean}]] (${baseHits.length} matches)`);
    }
  }
}

if (problems.length) {
  console.error("Broken or ambiguous internal links:");
  for (const problem of problems) console.error(`- ${problem}`);
  process.exit(1);
}

console.log(`OK: checked ${markdownFiles.length} Markdown files in ${vaultRoot}`);

Run करें:

node scripts/audit-wikilinks.cjs .

Bounded prompt:

Read `daily/2026-06-02.md` and `projects/site-refresh.md`.
Create `daily/2026-06-03.md` from `templates/daily.md`.
Carry over unfinished tasks only when they still have an owner.
Do not edit `.obsidian/`, `archive/`, or `private/`.
After editing, run `node scripts/audit-wikilinks.cjs .` and report the result.

Common pitfalls

पहला pitfall है .obsidian/ edit करवाना। Plugin settings, themes और hotkeys normal notes नहीं हैं।

दूसरा है Obsidian के बाहर bulk rename करना। इससे backlinks टूट सकते हैं।

तीसरा है YAML Properties में unquoted Wikilink। Safe format है related: "[[Project name]]".

चौथा है बहुत भारी daily note। जो template रोज नहीं भरा जा सकता, वह useful नहीं है।

पांचवां है content operations को सिर्फ writing समझना। Public article को official links, internal links, CTA और verification चाहिए।

Masa ने क्या test किया

Masa के test Vault में सबसे अच्छा return दो workflows से मिला: yesterday की unfinished tasks को today’s daily log में ले जाना, और publishing से पहले link audit चलाना। सबसे कमजोर experiment था “पूरा Vault clean करो”; Claude Code ने बहुत सारे tags और headings बना दिए। Narrow permissions, हल्के templates और Node audit से workflow ज्यादा stable रहा।

#claude-code #obsidian #pkm #markdown #automation #second-brain
मुफ़्त

मुफ़्त PDF: Claude Code cheatsheet

Email डालें और commands, review habits तथा safe workflow वाली एक-page PDF पाएँ.

हम आपका data सुरक्षित रखते हैं और spam नहीं भेजते.

Masa

लेखक के बारे में

Masa

Claude Code workflow और team adoption पर काम करने वाला engineer.