Repository navigation
Description
Summary
_SKIP_DIRS in graphify/detect.py covers venvs, caches and build output, but not .obsidian/ — the config directory Obsidian creates at the root of every vault. As a result, running graphify on an Obsidian vault ingests the app's own UI state as source code.
Obsidian is a natural corpus for graphify (a folder of Markdown notes is the ideal input), so this hits essentially every vault out of the box.
Files picked up
Every Obsidian vault has these, all detected as code:
.obsidian/graph.json # graph-VIEW settings (node colours, forces, filters)
.obsidian/workspace.json # open panes, window layout, cursor positions
.obsidian/app.json
.obsidian/appearance.json
.obsidian/core-plugins.json
.obsidian/graph.json is worth calling out: it's Obsidian's graph view configuration, not graphify output. The name makes it easy to misread as something graphify itself produced — I did exactly that before checking the path.
On a real vault of ~180 files, 5 of the 7 detected code files were these — i.e. 71% of the "code" corpus was UI state.
Reproduce
mkdir -p /tmp/vault/.obsidian /tmp/vault/notes
printf '{"a":1}' > /tmp/vault/.obsidian/graph.json
printf '{"b":2}' > /tmp/vault/.obsidian/workspace.json
printf '{"c":3}' > /tmp/vault/real-data.json
printf '# Note\nbody\n' > /tmp/vault/notes/note.md
python -c "
from graphify.detect import detect
from pathlib import Path
f = detect(Path('/tmp/vault'))['files']
print({k: len(v) for k, v in f.items() if v})
print('code:', [p.split('/')[-1] for p in f['code']])
"Actual
{'code': 3, 'document': 1}
code: ['graph.json', 'workspace.json', 'real-data.json']
Expected
{'code': 1, 'document': 1}
code: ['real-data.json']
Proposed fix
Add to _SKIP_DIRS in graphify/detect.py:
".obsidian", # Obsidian vault config/UI state — .obsidian/graph.json is the
# graph-VIEW settings file, not graphify output
".trash", # Obsidian's soft-delete folder — deleted notes, still on disk
".smart-env", # Smart Connections plugin embeddings cache.trash/ matters beyond noise: notes the user deleted keep showing up as live nodes in the graph.
Workaround
A root .graphifyignore with .obsidian/, .trash/, .smart-env/ works today and needs no code change — the gitignore support in detect handles it. Verified on the repro above: code drops 3 → 1, real files untouched.
Note for anyone writing that workaround
Do not put graphify-out/ in .graphifyignore. It looks like a sensible belt-and-braces line, but detect already skips that directory via _SKIP_DIRS and deliberately re-includes the sidecars under graphify-out/converted/ — the Markdown extracted from PDFs, i.e. the only path by which a PDF enters the corpus. Adding the line silently drops every PDF-derived document (I lost one this way; document count fell by 1 with no warning, and it only surfaced because I diffed the two file lists).
Possibly worth a line in the docs, or a warning when a user-supplied ignore pattern would match graphify-out/converted/.
Environment
- graphifyy 0.9.6 (installed via
uv tool), Python 3.14, macOS - Also verified against
mainat v0.9.33:.obsidianis still absent from_SKIP_DIRS
Activity
rohit-jsfreaky commentedon Aug 9, 2026
I reproduced this on the current
v8branch. I plan to add the listed Obsidian metadata directories to_SKIP_DIRSand add a regression test that verifies they are excluded while real project JSON remains detected. I will open a focused PR for this.chore: bump to 0.9.40
safishamsi commentedon Aug 11, 2026
Fixed in v0.9.40 (
graphifyy==0.9.40on PyPI)..obsidianand.smart-env(Obsidian vault metadata / plugin caches) are now in the skip-dirs..trashwas intentionally left out as a generic name with over-skip risk. Thanks @rohit-jsfreaky (PR #2572).