obsidian-knowledge-mcp: Instructions file for Claude Code

CLAUDE.md

obsidian-knowledge-mcp CLAUDE.md is an instructions file for Claude Code from nekottyo/obsidian-knowledge-mcp. It costs 1,905 tokens per session, scanned A, original, MIT.

A project-specific instruction guide for Claude Code, an AI coding assistant, working on a knowledge-search software project. It documents commands, architecture, fragile connections, and known search behavior.

In plain words
What is it for?
Building and testing the project, checking code style with Biome, running individual tests, and preparing the environment for data loading and searches.
Why use it?
It helps the assistant avoid stale builds, run the right tests, and change parts of the project without breaking related behavior.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions CLAUDE.md; mentions Claude Code.

This is nekottyo/obsidian-knowledge-mcp's own configuration. It tells Claude Code how to work on obsidian-knowledge-mcp itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything obsidian-knowledge-mcp configures →

Reuse

Borrowing it

Nothing to install: this file belongs to nekottyo/obsidian-knowledge-mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/nekottyo/obsidian-knowledge-mcp/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/nekottyo/obsidian-knowledge-mcp

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 obsidian-knowledge-mcp CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/nekottyo/obsidian-knowledge-mcp/claude-md/github.svg)](https://agentmods.dev/instructions/nekottyo/obsidian-knowledge-mcp/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/nekottyo/obsidian-knowledge-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/nekottyo/obsidian-knowledge-mcp/claude-md/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 obsidian-knowledge-mcp CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/nekottyo/obsidian-knowledge-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/nekottyo/obsidian-knowledge-mcp/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,905 This file is loaded in full into every session.
When invoked 1,905 The same file — it is already loaded in full.
Security scan A 0 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.01905 $0.01905
Opus 5 $0.00953 $0.00953
Sonnet 5 $0.00381 $0.00381
Haiku 4.5 $0.00191 $0.00191

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

Security

Grade A, and why

obsidian-knowledge-mcp CLAUDE.md scanned grade A with 0 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 8d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

CLAUDE.md · 71 lines

How it starts

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

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

コマンド

npm run build                                   # tsc
npm test                                        # tsc してから dist/test/*.test.js を node --test で実行
node --test dist/test/chunker.test.js           # 単一ファイル (先に npm run build が必要)
node --test --test-name-pattern "containment" dist/test/*.test.js   # 単一テスト

npm run check                                   # Biome の lint + format 検査 (書き込みなし)
npm run check:fix                               # 検査して安全な自動修正を適用
npm run format                                  # format のみ適用
npm run lint                                    # lint のみ

テストは src/ ではなく dist/ のビルド出力を実行する。npm test は毎回 tsc を挟むが、node --test を直接叩くときはビルドが古いままにならないよう注意する。

lint / format は Biome (biome.json) に集約している。vcs.useIgnoreFile を有効にしてあるので対象範囲は .gitignore に従う (dist/node_modules/ は自動で外れる)。check:fix で消えない指摘には --unsafe でしか直せないものが混ざる。当てるなら npx biome check --write --unsafe の後に必ず npm test まで通すこと。

動作確認とデータ投入には VAULT_ROOT / KNOWLEDGE_DIR と起動済みの ollama が要る (環境変数の一覧は README.md)。

VAULT_ROOT=/path/to/vault KNOWLEDGE_DIR=knowledge npm run dev-search -- "クエリ" --top-k 5
VAULT_ROOT=/path/to/vault KNOWLEDGE_DIR=knowledge npm run eval

アーキテクチャ

エントリポイントは 3 つ (src/index.ts の MCP サーバー、src/dev-search.ts の CLI、eval/run-eval.ts) あるが、いずれも src/search.tssearchKnowledge() を共有する。検索ロジックを変えるときはこの 1 箇所を見ればよい。

searchKnowledge() は冒頭で必ず syncIndex() を呼ぶ。これが「検索した瞬間に必ず最新」を担保する設計の中核であり、インデックス更新は独立したバックグラウンド処理ではなく検索パスに埋め込まれている。同期は mtime/size の突合なので、変化が無ければ stat のコストしかかからない。

データの流れは chunker.ts (markdown → チャンク + frontmatter) → ollama.ts (チャンク → embedding) → store.ts (sqlite へ投入) の一方向。indexer.ts がこの 3 つを束ねてファイル走査と差分検知を担う。

変更時に壊しやすい結合

embedding 次元ollama.tsEMBEDDING_DIM (1024) が store.tsvec0 テーブル定義に文字列展開されている。EMBED_MODEL を次元の違うモデルへ変えるなら、この定数と既存 DB の両方を作り直す必要がある。次元不一致は投入時ではなく embedBatch() の検証で先に落ちる。

Read the full file on GitHub · 71 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. 8d ago First seen · 71 lines · 1,905 tokens per session scan A b2b9aeabc367

Subscribe to this mod's changes

obsidian-knowledge-mcp CLAUDE.md is an instructions file published in the GitHub repository nekottyo/obsidian-knowledge-mcp (0 stars, last pushed 1mo ago), licensed MIT. It adds 1,905 tokens to every session, about $0.0095 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other instructions, from other repositories

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,153 tokens

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,469 tokens

deepseek-harness AGENTS.md

AGENTS.md instructions for deepseek-ai/deepseek-harness, covering agents.md, pre-stable apis and released session data, repository layout, commands and host sandbox failures.

deepseek-ai/deepseek-harness · 3,735 tokens