obsidian-llm-wiki: Skill for Claude Code

.claude/skills/query/SKILL.md

query is a skill for Claude Code from levi-qiao/obsidian-llm-wiki. It costs 70 tokens per session (2,115 once invoked), scanned A, original, MIT.

A search tool for answering questions from a local wiki, meaning a folder of linked notes maintained on your computer. It first uses the wiki index to find relevant pages, then answers with links back to those pages.

In plain words
What is it for?
Use `/query` for precise questions, `/query --explore` to investigate a topic, or `/query --relate` to compare two concepts in the local knowledge base.
Why use it?
It reduces the chance of answering from memory when the information is already in your notes. Different modes support focused questions, broader topic exploration, and finding relationships between concepts.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter. Also seen: mentions CLAUDE.md; mentions Claude Code.

This is levi-qiao/obsidian-llm-wiki's own configuration. It tells Claude Code how to work on obsidian-llm-wiki 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-llm-wiki configures →

Reuse

Borrowing it

Nothing to install: this file belongs to levi-qiao/obsidian-llm-wiki. 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/levi-qiao/obsidian-llm-wiki/main/.claude/skills/query/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/levi-qiao/obsidian-llm-wiki

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 query

README.md
[![agentmods](https://agentmods.dev/badge/skills/levi-qiao/obsidian-llm-wiki/query/github.svg)](https://agentmods.dev/skills/levi-qiao/obsidian-llm-wiki/query)
Your own site
<a href="https://agentmods.dev/skills/levi-qiao/obsidian-llm-wiki/query"><img src="https://agentmods.dev/badge/skills/levi-qiao/obsidian-llm-wiki/query/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 query

Your own site · 80×15
<a href="https://agentmods.dev/skills/levi-qiao/obsidian-llm-wiki/query"><img src="https://agentmods.dev/badge/skills/levi-qiao/obsidian-llm-wiki/query.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 70 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,115 The whole file, excluding the scripts and references it only reads on demand.
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.00070 $0.02115
Opus 5 $0.00035 $0.01058
Sonnet 5 $0.00014 $0.00423
Haiku 4.5 $0.00007 $0.00212

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

Security

Grade A, and why

query 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 10d 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/skills/query/SKILL.md · 264 lines

How it starts

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

Query 技能

核心目标

将用户的提问转化为对本地 Wiki 的深度检索。支持三种查询模式,根据问题类型自动选择或手动指定。通过索引系统精准定位相关页面,提取信息,综合出带有明确引用来源的双链回答。

触发条件

  • 用户输入 /query <问题> — 精准查询模式
  • 用户输入 /query --explore <主题> — 探索查询模式
  • 用户输入 /query --relate <概念A> <概念B> — 关系查询模式
  • 用户用自然语言询问:"我的笔记里关于 X 是怎么说的""过去我对 Y 的决策是什么""查询 Z 相关的知识"

降级策略

如果问题属于纯通用知识(如"太阳系有几颗行星"),且 wiki/index.md 中无相关内容:

本地知识库中未找到相关内容,以下为通用知识回答:[直接回答]


模式 1:精准查询(默认)

适用场景:具体问题,如"什么是 Transformer?"、"Claude Code 的核心功能是什么?"

步骤 1:索引导航

永远的第一步:读取 wiki/index.md

这是总索引,按 domain 和 type 双维度列出所有页面。根据问题关键词,定位到 5-10 个最相关的页面。

判断逻辑

  • 如果问题明确涉及某些实体或概念,直接定位到对应页面
  • 如果问题较宽泛,选择多个可能相关的页面
  • 如果索引中页面数量过多(> 100),先按 domain 或 type 筛选

关键优化

  • 只读取 wiki/index.md(通常 < 200 行)
  • 精准定位到 5-10 个页面,不要全量扫描

步骤 2:深度阅读

只读取定位到的 5-10 个页面

Read wiki/{type}/{page}.md

获取完整内容,提取与问题相关的信息。

关键优化

  • 只读取步骤 1 定位到的页面,不要额外读取
  • 如果 5-10 个页面不足以回答问题,返回步骤 1 重新定位

步骤 3:综合与回答

综合信息,回答用户问题。

双链引用规范

  • 每当引用某个 Wiki 页面的信息,在文本中使用 [[页面名称]] 标注
  • 整段引用同一页面:段落首尾各引用一次
  • 引用特定原文:使用 Markdown 块引用 > 引用内容

回答格式

根据知识库中的信息:

[回答内容,使用 [[wikilink]] 标注引用]

## 参考页面
- [[type/页面1]] — 简短说明
- [[type/页面2]] — 简短说明

步骤 4:高价值内容固化

如果满足以下条件,主动询问用户是否保存为 synthesis:

  • 回答超过 2 个段落
  • 内容具有分析对比性或总结性
  • 综合了多个页面的信息

询问话术:

这是一个有价值的总结,是否需要我将其保存到 wiki/syntheses/ 目录?

用户同意后,按照 CLAUDE.md 规范创建文件:

---
title: "页面标题"
type: synthesis
domain: AI | 财务 | 健康 | 未分类
tags: [标签1, 标签2, 标签3]
sources: []
last_updated: YYYY-MM-DD
backlinks_count: 0
---

# 总结内容
[回答内容]

## 关联连接
- [[页面1]] — 引用来源
- [[页面2]] — 引用来源

并在 wiki/index.md 的对应 domain 和 Syntheses 分类下注册。

步骤 5:记录操作日志

无论是否生成 synthesis 页面,查询结束后必须在 wiki/log.md 末尾追加:

## [YYYY-MM-DD] query | <操作简述>
- **模式**: 精准查询
- **输出**: <引用页面列表或"即时回答未保存">
- **引用页面**: N 个

模式 2:探索查询(/query --explore <主题>

适用场景:广度优先探索,如"我对 AI 了解多少?"、"知识库中有哪些关于 LLM 的内容?"

步骤 1:广度扫描

读取 wiki/index.md,找到所有与主题相关的页面(不限数量)

只读取每个页面的 frontmatter + 第一段(摘要),不读取完整内容

步骤 2:生成知识地图

Read the full file on GitHub · 264 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. 10d ago First seen · 264 lines · 70 tokens per session scan A 346c3180c8d4

Subscribe to this mod's changes

query is a skill published in the GitHub repository levi-qiao/obsidian-llm-wiki (10 stars, last pushed 27d ago), licensed MIT. It adds 70 tokens to every session and 2,115 once invoked, about $0.0003 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 skills, from other repositories

llm-wiki

Build and maintain a persistent, interlinked Obsidian-compatible markdown wiki using Karpathy's LLM Wiki pattern. Extension-backed with auto-generated metadata, guardrails, and 14 custom tools (+3 opt-in agent-trajectory tools).

zosmaai/pi-llm-wiki · 52 tokens

kb-lint

Health check for the PARA Knowledge Base. Detects orphan documents, broken links, index drift, tag issues, and stale content. Run periodically or as part of weekly review.

ernestolee13/para-knowledge-base · 39 tokens

kb-index

Update Knowledge Base indexes. Smart mode detects changes and updates only what's needed. Full rebuild available with --full flag. Use after adding/moving documents or when indexes feel stale.

ernestolee13/para-knowledge-base · 38 tokens

ObsidianDataWeave: NotebookLM, Atomization, and LLM Wiki

Use when the user wants to control NotebookLM programmatically, import .docx into an Obsidian vault as atomic Zettelkasten notes, build a compiled LLM Wiki layer, or full-text-search the whole vault. Claude Code and Codex both supported.

howdeploy/deploychan_mcp · 72 tokens

wiki-ingest

File a new source into the LLM Wiki — create its Sources page, append a log entry, apply the proposed cross-reference edits. Use when the user says "ingest this", "file this source", "add this to the wiki", drops a URL/PDF/clipped article, or pastes notes they want captured. Never auto-applies cross-refs without…

bezata/kObsidian · 82 tokens

wiki-lint

Health-check the LLM Wiki and offer fixes for each category of finding. Use when the user says "lint the wiki", "audit the wiki", "check wiki health", "clean up the wiki", or after a batch of ingests. Categories covered - orphans, broken links, stale sources, missing pages, tag drift, index parity.

bezata/kObsidian · 74 tokens