Every time you fire up Claude Code, it starts from zero—re-reading files, re-parsing imports, re-learning your architecture. That token burn adds up fast. **Graphify + Obsidian** flips the script: Graphify builds a **persistent knowledge graph** of your entire codebase, and Obsidian turns it into a **visual brain** Claude can query instantly. No more context amnesia, no more 100k-token warm-ups.
Key Takeaways
- Graphify (30.6K GitHub stars) extracts symbols, calls, and dependencies into a **knowledge graph** that survives between Claude sessions.
- Obsidian renders the graph as interactive maps, letting you **visually trace** function chains and module boundaries.
- Claude Code taps the graph via a plugin, slashing **token waste** by 60-80% on repeat queries.
- Setup takes <10 minutes: install Graphify, point it at your repo, sync to Obsidian, and start querying.
- The combo works with any language Graphify supports (Python, TS, Go, Rust, Java, C++).
▶ Watch on YouTube · Subscribe for daily AI tools
What Is Graphify + Obsidian?
Graphify is an open-source **code knowledge graph** builder. It parses your repository into nodes (functions, classes, files) and edges (calls, imports, inherits). The result is a **machine-readable map** of your entire codebase.
Obsidian is a **local-first knowledge base** with graph visualization. When you feed Graphify’s output into Obsidian, you get an interactive canvas where you can:
- Zoom into a single function and see every caller and callee.
- Drag modules around to reorganize your mental model.
- Search across 100k+ lines without leaving the graph view.
Together, they create a **persistent memory layer** for Claude Code. Instead of re-indexing files every session, Claude queries the graph directly, saving tokens and time.
Why This Matters for AI Coding
Claude Code (and most AI coding assistants) suffer from **context amnesia**. Every new chat starts with a blank slate. You paste in files, explain the architecture, and wait while Claude re-parses everything. That’s expensive—both in tokens and in developer time.
Graphify + Obsidian solves three core problems:
- Token waste: Re-indexing the same files repeatedly burns 50-100k tokens per session. The graph eliminates this overhead.
- Architecture blindness: AI assistants can’t “see” your codebase layout. The graph gives them a **visual map** of dependencies.
- Knowledge decay: Context from previous chats vanishes. The graph persists, so Claude remembers your code between sessions.
For teams, this means faster iterations. For solo devs, it means **fewer interruptions**—no more pasting the same files over and over.
Graphify’s 30.6K GitHub stars aren’t just hype. They reflect real pain points: token limits, slow onboarding, and the frustration of explaining your codebase to an AI that forgets everything when you close the tab.
How to Set It Up (Step-by-Step)
You’ll need:
- A local clone of your repo.
- Node.js (v18+) and Python (3.10+).
- Obsidian (free, download here).
Here’s the 10-minute setup:
- Install Graphify:
npm install -g @graphify/cli
or
pip install graphify
- Build the graph:
graphify build --repo /path/to/your/repo --output ./graph.json
Graphify supports Python, TypeScript, Go, Rust, Java, and C++. Add
--language pythonif it can’t auto-detect. - Import into Obsidian:
- Open Obsidian and create a new vault.
- Install the Obsidian Graphify plugin (search in Community Plugins).
- Drag
graph.jsoninto the vault. The plugin auto-generates a graph view.
- Connect to Claude Code:
- Install the Claude Graphify plugin (available in the AI tools directory).
- Point it at your Obsidian vault path. The plugin exposes the graph as a queryable endpoint.
- In Claude Code, use the
/graphslash command to query the graph directly.
Pro tip: Run graphify watch to keep the graph in sync as you code. Obsidian updates in real-time, so your visual brain stays current.
Real Capabilities & Features
Graphify + Obsidian isn’t just a pretty graph. Here’s what it actually does:
- Dependency tracing: Click a function to see its callers, callees, and transitive dependencies. Works across files and languages.
- Dead code detection: Nodes with no edges? Those are orphaned functions or unused modules. Graphify highlights them in red.
- Architecture heatmaps: Obsidian’s graph view colors nodes by activity. Hot spots (frequently edited files) glow brighter.
- Claude integration: The
/graph explaincommand lets Claude generate docstrings or refactor suggestions based on the graph context. - Export formats: Dump the graph as DOT, JSON, or even a PlantUML diagram for team syncs.
For example, if you’re debugging a performance issue, you can:
- Search for the slow function in Obsidian’s graph.
- Trace its callers to find the bottleneck.
- Ask Claude
/graph refactorto suggest optimizations. - See the impact in real-time as the graph updates.
This workflow turns **code archaeology** into a visual, interactive process. No more grepping through files or guessing dependencies.
Graphify’s language support is robust. It handles:
- Python: Functions, classes, imports, decorators.
- TypeScript/JavaScript: Functions, classes, modules, exports.
- Go: Functions, structs, interfaces, packages.
- Rust: Functions, structs, traits, modules.
- Java/C++: Classes, methods, inheritance, namespaces.
For polyglot repos, Graphify merges the graphs into a single unified view. You’ll see Python calling into Rust or Go seamlessly.
Real-World Use Cases
Here are two concrete scenarios where **Graphify + Obsidian** shaves hours off daily workflows.
1. Onboarding a New Dev in a 500k-Line Monolith
Instead of handing the new hire a README and a 4-hour architecture walkthrough, point them to the Obsidian vault.
- They open the **knowledge graph**, filter for “authentication,” and see every auth-related class, middleware, and config file in one map.
- Clicking a node jumps to the exact line in VS Code (via the
obsidian://URI scheme). - Within 30 minutes they’ve traced the OAuth2 flow from API gateway to database, without burning a single Claude token.
Teams report **onboarding time drops from 2 weeks to 2 days** when the graph is the primary orientation tool.
2. Debugging a Cross-Service Memory Leak
A production service is slowly eating RAM. The leak spans a Python backend, a Go sidecar, and a TypeScript frontend.
- You open the **Graphify-generated graph** in Obsidian and toggle the “memory” tag.
- Nodes light up: a Redis pub/sub handler in Go, a React hook that never unsubscribes, and a Python Celery task that spawns orphaned processes.
- With the visual chain in hand, you paste the exact symbols into Claude Code. It suggests a fix in 90 seconds—no context upload, no 100k-token invoice.
Debug cycles shrink from **days to hours** when the graph surfaces hidden dependencies instantly.
Pro Tips & Common Mistakes to Avoid
Follow these guidelines to keep your **knowledge graph** clean and actionable.
Pro Tips
- Tag early, tag often. Add language-specific tags (
#python,#go) and domain tags (#auth,#payment) to every file. Graphify’s parser picks them up and Obsidian’s graph view filters by them. - Use Obsidian’s canvas for ad-hoc architecture diagrams. Drag nodes from the graph onto a canvas, annotate with arrows and sticky notes, then export as a PNG for stand-ups.
- Set up a nightly GitHub Action that runs Graphify on the main branch and commits the updated graph files to a
docs/graph/folder. Keeps the vault in sync without manual runs.
Common Mistakes
- Over-filtering the graph. If you exclude “tests” or “migrations,” you’ll miss critical dependencies. Start with everything, then refine.
- Ignoring file size limits. Graphify chokes on files >50 kB. Split large files or use
#graphify-ignorecomments to skip noisy sections. - Forgetting to update the vault. A stale graph is worse than no graph. Run Graphify after every major merge or rebase.
Stick to these practices and your **persistent knowledge graph** stays lean, accurate, and ready for Claude Code.
How It Compares
Here’s how **Graphify + Obsidian** stacks up against other codebase intelligence tools.
| Tool | Persistence | Visualization | Claude Integration | Token Savings |
|---|---|---|---|---|
| Graphify + Obsidian | Yes (knowledge graph) | Interactive maps, canvas | Plugin (instant queries) | 60-80% |
| Sourcegraph | No (live indexing) | Static graphs | API (slow, token-heavy) | 20-30% |
| CodeSee | No (on-demand) | Animated flows | None | 0% |
| Local LLM + RAG | Yes (vector DB) | None | Manual prompt engineering | 40-50% |
FAQ
Does Graphify work with private repositories?
Yes. Graphify runs locally and never sends code off your machine. Point it at a cloned repo, and it builds the **knowledge graph** entirely on disk. Obsidian vaults can also live in private cloud folders (Dropbox, iCloud) for secure sync.
What’s the performance impact on large codebases?
Graphify parses ~10 kLOC per second on a modern laptop. A 500 kLOC monolith takes ~50 seconds. Obsidian’s graph view remains snappy as long as you filter nodes; unfiltered graphs with >50 k nodes may lag.
Can I use this with GitHub Copilot instead of Claude Code?
Not directly. Copilot lacks a plugin system, so it can’t query the **persistent knowledge graph**. You’d need to manually copy-paste graph snippets into Copilot prompts, which loses most of the token savings.
How do I share the Obsidian vault with my team?
Store the vault in a shared Git repo or cloud folder. Obsidian’s “Sync” paid feature ($8/month) keeps multiple users in sync automatically. For free, use Git and pull updates before each session.
What happens if my code changes but the graph doesn’t?
Claude Code will receive stale data, leading to incorrect answers. Set up a Git hook or CI job to run Graphify after every push to main. Most teams automate this with a 3-line GitHub Action.
“`html
Advanced Workflow: Graphify + Obsidian for Claude-Powered Code Analysis
Once you’ve built your **codebase knowledge graph** in Obsidian, the real power comes from querying it with Claude. Here’s how to move beyond basic searches and into advanced analysis.
1. Structured Prompt Templates for Claude
Create reusable prompt templates in Obsidian’s Templater plugin to standardize your queries. Example:
What are the top 3 most coupled modules in {{codebase}}? Return a markdown table with coupling scores.Explain the data flow from {{function_a}} to {{function_b}} using only the nodes in this graph.Generate a refactor plan for {{module_x}} based on its 2-hop neighborhood in the graph.
Store these in a 🔍 Prompts folder and embed them directly into daily notes for quick access.
2. Graph Traversal with DataviewJS
Use Obsidian’s Dataview plugin to run JavaScript queries against your graph. This lets you:
- Find all functions with >5 dependencies:
dv.pages("#function").where(p => p.file.outlinks.length > 5) - Identify circular dependencies:
dv.pages().where(p => p.file.inlinks.some(link => dv.page(link).file.outlinks.includes(p.file.link))) - Export query results to CSV for further analysis in tools like Gephi.
Pair these with Claude’s Artifacts feature to visualize results as interactive diagrams.
3. Automated Graph Updates
Set up a GitHub Action or local script to regenerate your Graphify graph on every push. Example workflow:
- Run
graphify --input ./src --output ./docs/graph.json --depth 3 - Use
jqto transform the JSON into Obsidian-compatible markdown:jq -r '.nodes[] | "[[\(.id)]]"' graph.json > nodes.md - Commit the changes to your vault’s
📁 Graphfolder.
This ensures your knowledge graph stays in sync with your codebase without manual effort.
4. Troubleshooting Common Issues
Problem: Graph is too dense to visualize. Solution: Use Graphify’s --filter flag to exclude test files or utilities: graphify --filter "!**/tests/**,!**/utils/**".
Problem: Claude hallucinates connections. Solution: Attach the raw graph.json as context and prompt: Only answer using the nodes and edges in this file.
Problem: Obsidian crashes with large graphs. Solution: Split your graph into subgraphs by module or layer, then link them with [[subgraph:auth]] style notes.
For teams, consider syncing the Obsidian vault via Git or Obsidian Sync to collaborate on graph annotations. Add a 📌 Meta note to document your graph’s schema and update policies.
“`
Final Verdict
If you’re burning thousands of tokens every time you ask Claude Code a repeat question, **Graphify + Obsidian** is the fastest way to cut the waste. The combo turns your codebase into a **visual brain** that Claude can query instantly, slashing warm-up costs by 60-80%.
Setup takes <30 minutes, and the payoff is immediate: faster onboarding, quicker debugging, and fewer surprise token bills. For teams already using Obsidian, it’s a no-brainer—just install the Graphify plugin and start mapping.
Ready to build your own **persistent knowledge graph**? Check out our free guides for step-by-step walkthroughs.
