How to cut Claude Code token usage

Knowledge Videos

Short animated explainers, organised by subject.

How to cut Claude Code token usage

A workflow that saves tokens: index the codebase once with graphify and share it with the team, plan from the graph and requirements, confirm the plan, delegate to subagents, then validate.

Transcript

When Claude Code explores a codebase by reading files, every file lands in the context window, and every token costs money.

On a big repo, most of those tokens go to code that has nothing to do with the task.

So index the code once with graphify. It turns your source into a knowledge graph of files, functions and how they connect.

Commit the graph, and the whole team shares it. Nobody pays to re-explore the same repo.

Now the agent queries the graph through the graphify M C P server, instead of loading the big JSON file, and reads only the few files that matter.

Next, the agent queries the graph over M C P, reads your requirements, and writes an execution plan.

You confirm the plan before any code changes. If something is off, it refines the plan and asks again.

Fixing a plan costs a few lines. Fixing code costs a rewrite.

Once approved, the main agent delegates each step to a subagent.

Each subagent starts with a small, clean context, works on its own slice, and returns only a short summary.

At the end, validate: run the tests, and check the result against the requirements.

Anything missing goes back to a subagent for a fix.

Index once, plan first, delegate small, validate last.

More in this series