PTENES
MODULE 2.4

📦 Generate the Obsidian vault

You already have the graph. Now let's turn it into a markdown vault: one file per node, with wikilinks, plus a graph.canvas from the communities. Everything comes from a flag—and everything is regenerated from scratch with each run.

6
Topics
~40
Minutes
Practical
Level
0%
0 of 6
1

🚩 The flag --obsidian e --obsidian-dir

In module 2.3, you generated the graph.json. Now let’s turn it into a vault in Obsidian. The trigger is a flag: inside Claude Code you run the /graphify in your source with --obsidian, and that enables vault export. The --obsidian-dir says where the files will end up there.

🔰 New here? Skill vs. headless

Graphify has two options. The skill is the slash command /graphify run inside in Claude Code. The headless is the plain terminal, with graphify extract. They're the same engine, but only the skill knows --obsidian.

⚠️ The gotcha many people get wrong

--obsidian doesn't exist in the graphify extract headless. If you try graphify extract . --obsidian in the terminal, it doesn’t recognize the flag. The vault export is skill-only.

⚡ Practical — copy and run

Objective: turn the graph from your docs source into an Obsidian vault, choosing the output folder.

Claude Code (skill /graphify)
/graphify ./claude-code-docs --obsidian --obsidian-dir ~/vault/graphify/claude-code

./claude-code-docs e ~/vault/graphify/claude-code are <isto-voce-troca> — adjust for your source and destination.

How to verify: list the destination folder and check that files appeared.

ls ~/vault/graphify/claude-code | head

✓ Skill /graphify

  • ✓Know --obsidian e --obsidian-dir.
  • ✓Also has --wiki, --update, --watch.
  • ✓No API key — uses the session model.

✗ Headless graphify extract

  • ✗Doesn’t have --obsidian.
  • ✗Generates only graphify-out/, without a vault.
  • ✗Asks ANTHROPIC_API_KEY.

🔑 Key concepts

--obsidian
Connects the export
--obsidian-dir
Where it lands
Skill-only
Not in headless mode
Vault
Notes folder
2

🎯 Choose the vault destination

O --obsidian-dir defines the folder where the vault is created. Without it, the skill creates its own directory—a kind of quarantine isolated, away from your main vault. This is the safest approach, but choosing the destination keeps things organized.

🔰 New here? The "isolated default"

Without --obsidian-dir, the export won’t intrude on your work vault—it goes to a dedicated folder that you can inspect (and delete) safely. Once you’re confident, point it to a fixed destination.

two variants
# destino que VOCÊ escolhe (organizado)
/graphify ./claude-code-docs --obsidian --obsidian-dir ~/vault/graphify/claude-code

# sem --obsidian-dir: a skill cria uma pasta própria (quarentena)
/graphify ./claude-code-docs --obsidian

↑ Both work. The first is predictable (you know where to find it); the second is mess-proof—good for the first test. The path ~/vault/graphify/claude-code é <isto-voce-troca>.

🔑 Key concepts

Destination
--obsidian-dir
Quarantine
Isolated folder
Default
Safe
Organization
You control
3

🧾 What gets generated (md per node + graph.canvas)

The export has two parts. The first: one file .md per node of the graph, each with [[wikilinks]] for the related nodes (which become backlinks). The second: a graph.canvas with the communities grouped. Together, they form the navigable vault.

🔰 New here? What is a "wikilink"

A wikilink is the syntax [[nome-da-nota]] in Obsidian: an internal link from one note to another. When A links to B, Obsidian shows a backlink ("who points to me"). That's how knowledge becomes navigable through relationships.

🔰 New here? What is a "canvas"

A canvas (file .canvas) is an Obsidian visual board where notes become boxes you can arrange freely. The graph.canvas uses this to show each community as a named group — the corpus’s big-picture view.

the graph graph.json source of truth --obsidian one .md per node + 1 canvas context.md hooks.md subagente.md …591 notes graph.canvas

↑ One graph node = one note .md; the relationships become [[wikilinks]]; the communities become groups in the graph.canvas. The numbers (591 nodes) are illustrative — come from running the video.

🔑 Key concepts

md per node
1 note = 1 idea
Wikilink
[[relacionado]]
Backlink
Who points
graph.canvas
Communities
4

♻️ Regeneration: run it again, redo everything

The export is regenerated from scratch with each run, always starting from the graph.json. There’s no manual merge: the graph is the source of truth, and the vault is just a reflection of it. That’s why the operation is idempotent — running it twice in a row produces the same result.

🔰 New here? "Regeneration" and "idempotent"

Regeneration = the vault is recreated in full on every run, not partially updated. Idempotent = repeating the operation doesn't change the result after the first time. In return, you don't need to think about “previous state”—rerun it whenever you like.

⚠️ Don’t manually edit the generated notes

How the export is rebuilt from scratch, any manual edits to the generated notes are lost on the next run. Want to change the vault content? Change the source (the docs) or the graph.json and rerun it—never the output markdown.

✓ Safe

  • ✓Rerun as many times as you want.
  • ✓The vault always reflects the current graph.
  • ✓No inconsistent intermediate states.

✗ Gets lost

  • ✗Manually edited notes are overwritten.
  • ✗Notes inside generated notes disappear.
  • ✗There’s no merge: it’s all or nothing.
graph.json source of truth run again --obsidian new vault (from scratch) discards the previous one old vault + edits manual—lost always = to the graph idempotent

↑ Each run rebuilds the entire vault from the graph. The upside: it never gets “out of date.” Keep in mind: manual edits don’t survive—the source is the graph, not the markdown.

🔑 Key concepts

Regeneration
Starts over from scratch
Idempotent
Same result
Source of truth
It’s the graph
No merge
All or nothing
5

📚 --wiki as an alternative

In addition to the node-by-node vault, there’s a second format: --wiki. Instead of one note per node, it generates articles by community with a index.md as an entry point—a Wikipedia-style read, good for anyone (human or agent) who prefers reading continuous text to navigating boxes.

⚡ Practical — copy and run

Objective: generate the wiki version (articles by community) from the same source, to compare with the vault.

Claude Code (skill /graphify)
/graphify ./claude-code-docs --wiki

./claude-code-docs é <isto-voce-troca> — point to your source.

How to verify: look for the index.md and the articles in the output folder.

ls ~/vault/graphify/claude-code | head

🔰 Vault or wiki — which should you use?

Use the vault (--obsidian) when you want to browse relationships within Obsidian. Use the wiki (--wiki) when you want to read thematic articles. They’re not exclusive—you can generate both and choose later.

🔑 Key concepts

--wiki
Another export
index.md
Input
Article
By community
Reading
Wiki style
6

👀 Check the generated vault

Before opening Obsidian, do a quick check of the file system: look at the destination folder, count the files .md and confirm that the graph.canvas is there. This catches empty or truncated exports early, before you invest time in the tool.

⚡ Practical — copy and run

Objective: confirm that the export produced the notes and canvas in the right destination.

terminal
ls ~/vault/graphify/claude-code | head
ls ~/vault/graphify/claude-code/*.canvas

~/vault/graphify/claude-code é <isto-voce-troca> — use the destination you passed to --obsidian-dir.

How to verify: the first command should list several files .md; the second should find exactly one graph.canvas. An empty list means the export failed; rerun the step from topic 1.

1

Count the notes

ls … | head shows that there are many .md — one per node.

2

Find the canvas

O *.canvas confirm that the community map was generated.

3

Open in Obsidian

With the vault checked, the next module points Obsidian to it and navigates the nodes.

🔑 Key concepts

Count
How many notes
Canvas
Is it there?
Verification
Catches failures early
Next step
Open in Obsidian

✋ Self-recovery (optional, non-blocking): in which execution mode does the flag exist --obsidian?

📌 Module summary

✓
--obsidian is skill-only: exists in the /graphify in Claude Code, not in the graphify extract headless.
✓
--obsidian-dir chooses the destination: without it, the skill uses an isolated folder (secure quarantine).
✓
The export is one .md per node + graph.canvas: wikilinks between notes, communities on the canvas.
✓
Everything is regenerated from scratch: manual edits to generated notes are lost—change the source, not the markdown.
✓
--wiki is the reading alternative: articles by community with an index.md; check the vault before opening.

Next module

2.5 · Open in Obsidian and connect the sources — point to the vault, navigate nodes through backlinks, and link each concept to its source document.