obsidian-update-agentmd
Skill0 starsChanged 4 months agoMITView on GitHub
Scan the Obsidian vault's current folder/file structure and regenerate CLAUDE.md to reflect it accurately. Use when the user says "update CLAUDE.md", "sync the vault structure", "I've added new notes/folders", "update the agent context", or "run obsidian-update-agentmd". Also run after any bulk note reorganisation.
In this repository10 other files it gives its agents.
- article-improveSkill
- check-sentenceSkill
- event-radarSkill
- food-checkSkill
- mobi-to-markdownSkill
- obsidian-notes-from-imagesSkill
- vault-syncSkill
- vps-health-checkSkill
- webcheckinSkill
- youtube-transcriptSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. About 0 are common, 8 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 18
Look up "obsidian_vault_path" in ~/.claude/skills-user-config.json.
- Very specific: line 31
Run a recursive directory listing (max depth 4, exclude .obsidian/, .git/, .stfolder, plugin dirs).
- Very specific: line 38
Use Bash with find (if your agent exposes Bash under a different tool name, use that):
- Distinctive: line 52
Read these files to extract the current "active projects" snapshot (adapt the names to the vault's own):
- Distinctive: line 59
Do NOT read every project file.
- Distinctive: line 65
Read CLAUDE.md (same vault root).
- Distinctive: line 67
New folders/files: not listed → add to the structure diagram.
- Very specific: line 114
Use ← annotation comments for important files/folders.
- Distinctive: line 116
Keep the tree at max 3 levels deep unless a subfolder is particularly rich.
- Very specific: line 117
Don't enumerate every file in Reference/, Clippings/, or Templates/ — just note the folder.
- Distinctive: line 123
After editing, output a short summary (under 10 lines):
- Distinctive: line 133
Don't narrate the process.
- Distinctive: line 142
If CLAUDE.md doesn't exist yet, create it from scratch using the structure above.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Obsidian Update CLAUDE.md
Scan the live vault, diff against the current CLAUDE.md, and rewrite it to be
accurate. The goal is a tight, agent-useful document — not a changelog. Be surgical.
Vault root path
Look up "obsidian_vault_path" in ~/.claude/skills-user-config.json.
- If present, use it directly.
- If missing, ask the user for their vault root path once (it may be a local
folder, a Google Drive / cloud-synced folder, or — under OpenClaw / Claude Code
on a remote host — the current working directory of a synced checkout), then
write it to
~/.claude/skills-user-config.jsonunder that key so future runs don't need to ask.
Step 1 — Map the vault structure
Run a recursive directory listing (max depth 4, exclude .obsidian/, .git/,
.stfolder, plugin dirs). Collect:
- All folders — note new ones not in current CLAUDE.md.
- All top-level
.mdfiles in each folder — note additions and deletions. - Total file count per top-level section (whatever top-level folders the vault uses).
Use Bash with find (if your agent exposes Bash under a different tool name, use that):
find <vault_root> -maxdepth 4 \
-not -path "*/.obsidian/*" \
-not -path "*/.git/*" \
-not -path "*/.stfolder/*" \
| sortStep 2 — Read key state files
Read these files to extract the current "active projects" snapshot (adapt the names to the vault's own):
- a status note (e.g.
Now.md) — active/paused projects table - a priorities note (e.g.
Priorities.md) — current focus areas - a project index note (e.g. a top-level project list) — project index
Do NOT read every project file. Extract project names and statuses from Now.md only.
Step 3 — Diff against current CLAUDE.md
Read CLAUDE.md (same vault root). Compare:
- New folders/files not listed → add to the structure diagram.
- Removed folders/files still listed → remove them.
- Renamed sections — update names.
- Active projects table — replace entirely from Now.md data.
- Last updated date — always update to today's date.
Things to NOT change unless clearly wrong:
- The "What this is" intro paragraph.
- The "Note on Play" callout.
- Conventions section (unless a new convention is observed).
- Agent key file descriptions (unless a file was renamed/removed).
Step 4 — Rewrite CLAUDE.md
Edit CLAUDE.md in place using the Edit tool. Maintain this structure:
# CLAUDE.md
This file provides guidance to AI agents (Claude, etc.) working in this vault.
> **Last updated:** YYYY-MM-DD
## What this is
...
## Vault Structure
\`\`\`
obsidian/
├── <accurate tree>
\`\`\`
## Active Projects (as of last sync)
| Project | Status | Notes |
|---|---|---|
| <from Now.md> | ... | ... |
## Key Files for Agents
- <list of critical files with one-line descriptions>
## Conventions
...Rules for the structure tree:
- Use
←annotation comments for important files/folders. - List files inside folders only when individually notable (e.g. specific project files in a projects folder).
- Keep the tree at max 3 levels deep unless a subfolder is particularly rich.
- Don't enumerate every file in
Reference/,Clippings/, orTemplates/— just note the folder.
Step 5 — Report what changed
After editing, output a short summary (under 10 lines):
CLAUDE.md updated (YYYY-MM-DD)
Added: <new folders/files>
Removed: <stale entries>
Updated: Active projects table from Now.md; Last updated dateDon't narrate the process. Just the delta.
Guardrails
- Never delete
## Conventionsor## Key Files for Agentsunless explicitly told to. - Never commit to Git as part of this skill — that's a separate step.
- Never expose secrets — if you spot API keys, passwords, or tokens while reading files, do not include them in CLAUDE.md. Flag them in the summary.
- If CLAUDE.md doesn't exist yet, create it from scratch using the structure above.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

