Back to Blog
Claude Code

Claude Code Knowledge Graph Setup (Graphify + Obsidian)

5 min read
Claude Code Knowledge Graph Setup (Graphify + Obsidian)

If you’re using Claude Code and you think it actually knows your business, it’s just pretending to. Every time you start a new session, Claude rereads all your files from scratch. Thousands of tokens wasted just to remember what it already knew.

That’s not intelligence. That’s amnesia with extra steps.

I’m Charles Dove, and I run Charlie Automates. At my agency CC Strategic, we build production AI systems for clients. And this problem, Claude forgetting everything between sessions, was eating our token budget alive.

Then I found Graphify.

What Graphify Actually Does

Graphify takes your entire codebase, your documents, your strategy plans, even your images, and turns them into a persistent knowledge graph. It maps how everything in your business actually connects to one another. And it persists.

Here’s the difference that matters:

Grep (what Claude uses naturally): A flashlight on your database. Linear search across the codebase. Quick, but stateless. You have to know exactly what you’re searching for.

Graphify: A satellite view of your codebase with a 5G connection. (And I’m talking Verizon, not T-Mobile.) It reveals relationships between every item in your codebase. Persistent memory that costs close to nothing when it comes to tokens.

Grep tells you where something is. Graphify tells you why it actually matters.

We’re talking 70x fewer tokens per search. One-time build. Persistent memory. Semantic relationships, not just file names.

The Solo Leveling Analogy (For My Anime Fam)

If you’re an anime lover, think about it in terms of Solo Leveling. The main character has an army of shadow soldiers, and each of their brains are connected instantaneously. The intel is shared throughout the battlefield all at once.

That’s what Graphify does for Claude Code. Now Claude sees the whole map, not just the small room you’re hanging out in.

Where Obsidian Fits In

Obsidian takes all the data that Graphify has structured together in a JSON file and creates a visual graph for you. You can actually see how your digital assets connect to other parts of your codebase.

But here’s the thing most people miss: Claude Code is not pulling data from Obsidian. It’s pulling from the Graphify output (the JSON and HTML files). Obsidian is just the visual layer so YOU can see what Claude already knows.

What I Found When I Ran Graphify on My Business

I asked Claude: “What kind of meaningful relationships with my data have you found via the Graphify JSON?”

It found about 137 community clusters. Here’s what it mapped:

Business Revenue Architecture: How C&C Strategic connects to agency done-for-you work, brand deals, the Skool community, and the future inner circle group. It mapped the relationship to proposals, playbooks, PDFs. My entire business model as a graph.

Content Pipeline: My workflow called Go Viral Pro got mapped as a content aggregation pipeline. It identified all the tools within that sector of the codebase.

People Network: It referenced all the people I’ve spoken about with Claude and created a whole cluster for just people. The more I chat with Claude about these relationships, the better the graph gets over time.

How to Set Up Graphify (Step by Step)

Step 1: Install Graphify

Head to the Graphify GitHub repo (16,000+ stars in less than 2 days, inspired by Andrej Karpathy).

pip install graphify-ai

Or clone the repo and install from source if you want the latest.

Step 2: Build Your Knowledge Graph

Point Graphify at your project directory:

graphify build /path/to/your/project

This is a one-time operation. It scans your codebase, documents, images, and builds the relationship map. Outputs a JSON file and an HTML visualization.

Step 3: Tell Claude Code About It

Add a reference to the Graphify output in your CLAUDE.md file so Claude knows to check the knowledge graph:

## Knowledge Graph
Graphify knowledge graph available at: graphify-output/knowledge-graph.json
Consult this for relationship context between project assets.

Step 4: Visualize in Obsidian

Download Obsidian and open the Graphify output folder as a vault. The graph view shows you all the clusters and connections visually.

This part is optional but it’s powerful for understanding your own business at a glance.

Why This Matters for Your Token Budget

The whole inspiration came from Andrej Karpathy, one of the founding members of OpenAI. His recommendation is keeping a raw folder where you drop all of your assets and let Claude sift through the mess. Within 24 hours of that recommendation, Graphify was built.

The math is simple:

  • Without Graphify: Claude greps through 300+ files every session. Thousands of tokens burned on context loading.
  • With Graphify: One-time build. Claude reads the graph. 70x fewer tokens per search. It already has the map.

That’s not a small optimization. That’s the difference between burning $50/month on token overhead and spending pennies.

Key Takeaways

  • Graphify builds a persistent knowledge graph from your codebase (one-time operation)
  • 70x fewer tokens per search compared to native grep
  • Maps semantic relationships, not just file locations
  • Obsidian gives you the visual layer to see what Claude already knows
  • Works with code, docs, strategy notes, PDFs, even images
  • Inspired by Andrej Karpathy’s recommendation for AI-assisted development

Watch the Full Walkthrough

I walked through the entire setup process, live demo, and token comparison on the Charlie Automates YouTube channel. The video above covers everything from install to your first query.

Ready to Level Up Your Claude Code Setup?

If you’re burning tokens every session and want to build AI systems that actually remember your business:

FAQ

What is Graphify for Claude Code?

Graphify is an open-source tool that converts your codebase into a persistent knowledge graph. Instead of Claude doing a linear grep search every session, it reads the graph and understands semantic relationships between your files, documents, and business assets. 70x fewer tokens per search.

Do I need Obsidian to use Graphify?

No. Obsidian is optional. It’s a visualization tool that lets you see the knowledge graph as an interactive node map. Claude Code reads directly from the Graphify JSON output, not from Obsidian. But Obsidian is great for understanding your own business connections at a glance.

How much does Graphify cost?

Graphify is free and open-source. The repo is on GitHub with 16,000+ stars. The real savings come from the token reduction, which can cut your Claude Code costs significantly depending on your usage.

Does the knowledge graph update automatically?

The initial build is a one-time operation. When you make significant changes to your codebase, you can rebuild the graph. The key benefit is that once built, Claude doesn’t need to rescan your entire project every session.