<< Home | Tech
40-60% fewer tokens used per session
| Area | Tech |
| AI used | Claude Code |
| Source | r/mcp |
| Posted | 2026-03-14 |
The move
Use an MCP server to provide a structured graph of your codebase instead of relying on grep.Steps
- Install the code-graph-mcp server via the provided GitHub repository.
- Configure your AI editor or Claude Code to connect to the MCP server.
- Allow the server to index your codebase into the SQLite graph.
- Query the graph for function callers or architecture overviews instead of grepping files.
Prompt for your AI
Analyze the codebase using the code-graph-mcp tool to identify all callers of [function_name] and list the files that would be affected by a change.
What happened
The developer was frustrated by Claude Code's inefficient process of grepping files to understand code relationships. They built an MCP server that uses Tree-sitter to index functions and classes into a SQLite graph. This allows the AI to query the codebase structure directly, reducing token usage and improving accuracy.Watch out
Performance on massive monorepos is untested. The tool requires initial indexing time for the codebase.Give it to your agent
Read https://howtheyuse.ai/p/40-60-fewer-tokens-used-per-session.md and help me do this.