How They Use AI  |  Newest

<< Home  |  Work

Reduced token usage from 169k to 2.9k

AreaWork
AI usedClaude Code
Sourcer/claudeskills
Posted2026-10-25

The move

Create a local AST code map and add a rule to CLAUDE.md to force the AI to query the map before reading project files.

Steps

  1. Install a local AST code mapping tool like graphify in your project directory.
  2. Generate a code map of your project structure.
  3. Add a rule to your CLAUDE.md file instructing the AI to consult the map before reading individual files.
  4. Execute the mapping command whenever the project structure changes.

Prompt for your AI

Analyze my project structure using the provided code map. Before reading any files, identify the specific file paths required to answer this question: [Insert your technical question here].

What happened

The user found that Claude Code was consuming excessive tokens by reading entire project files to locate information. They integrated a local AST code map tool called graphify into a custom skill. By running this map, the AI now references the code structure first, significantly reducing token consumption for complex queries.

Watch out

The code map may become outdated if you do not regenerate it after significant file changes. It does not index documentation files.

Give it to your agent

Read https://howtheyuse.ai/p/reduced-token-usage-from-169k-to-2-9k.md and help me do this.

Sources



Last updated November 26, 2026.