PTENES
MODULE 3.4

🛠️ Maintenance, updates, and troubleshooting

Keep the graph and vault healthy over time—and know exactly what to do when something goes wrong. Every issue comes with its cause and a fix ready to copy and run.

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

🔄 Rerun when the source changes (incremental)

Your project doesn't stand still: the documentation changes, the code grows, files come and go. The graph needs to keep up — but rebuilding everything from scratch with every commit would be slow and expensive. The answer is the incremental: graphify update . reprocesses only what changed and reuse the rest of the cache.

🔰 New here? What is "incremental"

Incremental means “only the difference.” Graphify stores a per-file cache (a hash of the content) in graphify-out/cache/. If the file hasn't changed, it doesn't call the LLM again — saving time and money. Only new or changed files are reprocessed.

The maintenance cycle has two steps. First, update the graph (graphify-out/graph.json is the source of truth). Then, if you use the Obsidian vault, export again with --obsidian to regenerate the notes. Remember: the export is derived of the graph — updating the graph doesn’t update the vault by itself.

fix · update the graph

Objective: keep the current graph after the source changes, without rebuilding everything.

# headless (terminal puro): só reprocessa o que mudou
graphify update .

# usando a skill dentro do Claude Code, e já re-exportando o vault:
# /graphify . --update --obsidian --obsidian-dir ~/vault/graphify/meu-projeto

Verify: the log shows "N files changed" (not the total), and the graph.json gets a mtime new. Untouched files appear as "cache hit".

incremental cycle ① the source changes ② graphify update . ③ re-export --obsidian ④ current vault ✓

↑ The cycle closes: every time the source changes, you run update and re-exports. The graph is the source of truth; the vault is derived from it—which is why you need both steps.

🔑 Key concepts

update
Only what changed
cache
Hash per file
re-export
Derived vault
incremental
Fast and cheap
2

🧯 Regenerated vault vs. your edits

Here’s the pitfall that hurts the most: the Obsidian export is regenerated from scratch with each run. If you opened a generated note, wrote your own reflection in it, and then ran the export again, that edit is overwritten. Graphify doesn’t merge your changes—it recreates the file.

✓ Secure vault

  • ✓Notes generated in a Graphify-only folder (e.g., /imports).
  • ✓Your reflections in a separate folder (e.g., /minhas-notas).
  • ✓You links from your notes to the generated ones—it never edits the generated ones.

✗ Vault at risk

  • ✗Edit the notes generated by the export directly.
  • ✗Mix your notes with the imports in the same folder.
  • ✗Re-export over the top and lose hours of work.

🔰 Golden rule

Treat the imports folder as read-only: it's a projection of the graph, not your notebook. If you always export to --obsidian-dir ~/vault/graphify/<projeto>, your personal notes stay outside it and are never touched by the re-export.

🔑 Key concepts

Regeneration
Recreates, doesn't merge
Separation
Imports ≠ your notes
Read-only
Don’t edit imports
Link
Connect, don’t copy
3

🐛 "graphify: command not found" (PATH)

You installed with uv tool install graphifyy, but the terminal responds command not found. No worries: the package was installed; it just isn’t in the PATH of your shell. The uv has a command that fixes this in one step.

🔰 New here? What is "PATH"

O PATH is the list of folders where the shell looks for programs when you type a command. If the binary for graphify is in a folder that isn’t on this list, the shell won’t find it—even though it exists. uv tool update-shell add the right folder and reopen the terminal.

fix · PATH

Objective: run the command graphify be found.

# adiciona o diretório de tools do uv ao PATH do shell
uv tool update-shell

# feche e reabra o terminal (ou recarregue o perfil), depois confirme:
graphify --help

Verify: graphify --help lists the subcommands. If it still fails, open a new terminal—the PATH only reloads in a new session.

This isn’t the only common pitfall during installation and everyday use. The table below is your “symptom → cause → fix” map:

Symptom Likely cause Correction
graphify: command not found Binary outside PATH uv tool update-shell + reopening the terminal
/graphify doesn't appear in Claude Code Skill not registered graphify install and check ~/.claude/skills/graphify/SKILL.md
Key error outside Claude Code Headless without an API key Export ANTHROPIC_API_KEY (see topic 4)
--obsidian "doesn't exist" Tried in headless mode Use the skill /graphify … --obsidian inside Claude Code

🔑 Key concepts

PATH
Where the shell looks
shell
Reloads when reopened
uv
update-shell
install
Registers the skill
4

🔑 API key errors (headless only)

An API key error almost always means one thing: you’re running Graphify headless (in the plain terminal) to extract documents, and semantic extraction requires a model. Inside Claude Code, via /graphify, the session already provides the model—you no doesn’t need any key.

Inside Claude Code /graphify ./docs the session provides the model ✓ no API key here live --obsidian, --mode deep, --update Headless (terminal only) graphify extract ./docs semantic extraction via LLM ⚠ requires ANTHROPIC_API_KEY code only (tree-sitter/AST) doesn’t require the key

↑ The key only enters the path for right (headless + documents). Extracting code uses tree-sitter (AST) and doesn't need a key even on this path.

fix · headless API key

Objective: run document extraction in a plain terminal without a key error.

# defina a chave na sessão (troque pelo seu valor real)
export ANTHROPIC_API_KEY=<sua-chave>

# agora a extração semântica de documentos funciona headless
graphify extract ./docs

Verify: echo $ANTHROPIC_API_KEY shows the key and extraction starts without complaint. Inside Claude Code, skip this entirely—it isn’t needed.

✓ No key required

  • ✓Run /graphify within Claude Code.
  • ✓Extract code (tree-sitter/AST), on any path.

✗ Requires a key

  • ✗Extract documents/PDF via LLM…
  • ✗…in the plain terminal (CI, headless scripts).

🔑 Key concepts

headless
Terminal only
skill
Session model
API key
Headless docs only
AST
Code without a key
5

🧹 Noisy or shallow graph

Sometimes the graph comes out noisy (too many entities, many irrelevant) or shallow (few relationships, nothing connects). Most of the time, Graphify isn't to blame—it's the corpus: the graph's quality mirrors the source's quality. "Garbage in, garbage out." The fix starts at the source, not with the command.

🔰 Three levers, in this order

  • 1.Clean the source: remove changelogs, auto-generated files, boilerplate, and duplicates — they clutter the graph with noise.
  • 2.Rescope: point to the relevant subfolder (graphify extract ./src) instead of the entire repository.
  • 3.Increase the depth: --mode deep performs a more thorough extraction when the graph is too shallow.
fix · depth

Objective: re-extract with greater depth when the graph is too shallow.

# dentro do Claude Code — extração minuciosa (--mode deep é da skill)
/graphify ./docs --mode deep

# alternativa: re-escopar para a parte que importa (headless)
# graphify extract ./src

Verify: compare the GRAPH_REPORT.md before/after — more relationships per entity and god nodes that make sense point to a deeper graph.

Always read the GRAPH_REPORT.md: it lists god nodes, connections between communities, and suggested questions — it's your gauge for "did the graph turn out well?".

🔑 Key concepts

corpus
Source = quality
scope
Point to ./src
--mode deep
More thorough
REPORT
Thermometer
6

📦 Version and export the journey

You built a second brain — now don't miss it. Two fronts: version the Graphify artifacts in git (so the graph is reproducible and you can go back in time), and export your reading progress here in the course (the .json of “My journey”). A backup is what separates “I had it” from “I have it.”

1

Commit the graph

Version graphify-out/ (or at least the graph.json) in git — it’s the source of truth from which everything derives.

2

Back up the vault

The Obsidian vault can be regenerated from the graph, but your personal notes no — keep their folder versioned separately from the imports.

3

Export your journey

In the panel My journey from this course, export the .json with readings, questions, and notes — and reimport them on another device.

fix · version the graph

Objective: save the graph in git so you never lose it and can reproduce it.

# versione os artefatos do Graphify (o cache pode ficar fora)
echo "graphify-out/cache/" >> .gitignore
git add graphify-out/ .gitignore
git commit -m "chore: snapshot do segundo cérebro (graphify-out)"

Verify: git log --stat shows the graph.json committed. In a fresh clone, the graph is there — no re-extraction needed.

🔑 Key concepts

git
Version the graph
backup
Vault + notes
export
.journey JSON
reproducible
Go back in time

✋ Self-recovery (optional, non-blocking): the flag --obsidian exists in the headless subcommands (graphify extract / update)?

📌 Module summary

✓
Incremental: graphify update . reprocesses only what changed; re-export the vault afterward.
✓
Vault regenerates: never edit the imports—keep your notes in a separate folder.
✓
command not found: uv tool update-shell and reopen the terminal.
✓
API key: only in headless mode with documents; inside the /graphify doesn't need to.
✓
Shallow graph: clean up the corpus, rescope, or move up to --mode deep.
✓
Don’t miss: version graphify-out/ in git and export your journey.
🎉

You completed the course!

From the theory of a second brain (Path 1), through the practical step-by-step guide (Path 2), to real-world use and maintenance (Path 3)—you now know how to build, query, and maintain a second brain you can query with Claude Code. Version it, export it, and keep building.