~3m9:3494% Fewer Tokens? I Tested Gortex With Claude Code
Nov 28, 2026
Read: ~4m · You save: 6 min
94% fewer tokens? I tested Gortex with Claude Code
Gortex promises to cut AI agent token usage by 94%. We test how a code graph works with Claude Code and whether it's worth a developer's attention.
AI-powered coding assistants often spend thousands of tokens just trying to understand the code. For a simple question, such as which functions call a given function, the agent starts reading files, searching for references, opening new files, and quickly fills up the context window.
Gortex, a free open-source tool, solves this problem. In one example published by the project's authors, the task required 11,500 tokens without the tool and 688 tokens with it. That is 94% fewer.
How Gortex Works
Gortex builds a knowledge graph of the codebase. The graph reflects functions, dependencies, calling functions, interfaces, and the relationships between them. Instead of searching through files, the agent requests the needed relationships directly from the graph.
According to its developers, Gortex supports about 257 programming languages, works with multiple repositories at the same time, and updates the graph when code changes. The tool also estimates how many tokens it has saved.
To determine code structure, Gortex uses Tree-sitter, which parses source code and extracts functions, classes, and imports. For major languages, deeper analysis methods are applied, in particular integration with language servers (Language Server Protocol). They help determine how code elements are related to each other. These relationships are stored in the knowledge graph.
The agent accesses the graph through MCP (Model Context Protocol) tools. Available tools include, among others, tools for analyzing call chains, dependencies, the impact of changes, and data flows.
A background process (daemon) monitors file changes and updates only the affected parts of the graph. A full reindexing on every change is not required. Indexing is performed locally, so the entire codebase is not transmitted to a cloud service. However, the agent may still send code fragments to the model provider.
Installation and Setup
To install on macOS, perform the following steps:
- Run the installer, which downloads all components.
- Open a new terminal so that the binary appears in the PATH variable.
- Run
gortex installto configure integrations with agents. - Start the background process with the command
gortex daemon start --detach.
Installation does not require Docker, a virtual environment, or a separate database.
Next, connect the repository:
- Clone the repository.
- Add it to tracking with the command
gortex track. - Go to the project directory and run
gortexwith theanalyzeflag. The command creates an initial index and project configuration for the agent. - Check the daemon status to make sure the repository has been indexed.
Usage Example: Analyzing a Function Change
A typical task: you need to change a function, but you don't know which parts of the code depend on it.
In this example, the Claude agent was asked to trace the call chain of the process_payment function, show what a change to its signature would affect, and find the tests that cover the affected code. The agent was instructed to use the Gortex graph tools first.
Without Gortex, the agent finds the function, reads the file, follows references, and keeps going until it has gathered enough context. With Gortex, the agent gets the relationships directly. It determines which functions call the target, which parts of the code depend on it, and which tests may be relevant, without loading entire files into context.
The existence of a relationship does not mean the tests will necessarily fail. They still need to be run. However, the graph narrows the search area and speeds up verification.
Пример использования: несколько репозиториев
Во втором примере к проекту добавили второй репозиторий: фронтенд и бэкенд. Фронтенд обращается к эндпоинту платежей, предоставляемому бэкендом.
Второй репозиторий подключили через gortex track. Затем агент проверил контракты API между репозиториями, нашел несоответствующие и неиспользуемые эндпоинты и показал, где фронтенд к ним обращается.
Граф отслеживает связи между обоими репозиториями. Агенту не требуется вручную искать соответствия в коде фронтенда и бэкенда. Это особенно полезно, когда небольшое изменение может затронуть другой сервис.
Comparison with Similar Tools
Gortex is not the first tool of its kind. Among its analogues:
- Graphify connects code with other project information: documentation, PDF files, and supporting materials. It is suited to understanding the project as a whole, not just the source code.
- GitNexus provides a browser-based graph explorer, call chain analysis, change impact analysis, and MCP support. It also supports analysis of multiple repositories.
Gortex's distinction lies in its combination of capabilities: a single native binary, a shared daemon for multiple repositories, real-time graph updates, API contract analysis, change impact assessment tools, and a panel tracking saved tokens.
Gortex is not unconditionally the best solution. The choice depends on the task. For day-to-day agent work, especially across multiple repositories, it is a good fit.
Limitations
Token savings estimation. The savings figures are an estimated calculation. Gortex compares its graph queries with the typical volume of data read when opening files. The tool does not determine the exact number of tokens the model would have used without it. The accounting panel should not be regarded as strict proof of savings.
Memory consumption. On very large repositories, memory usage during indexing can be high. The project's benchmarks on the Linux kernel suggest usage of several gigabytes of memory.
Depth of analysis. Support for 257 languages does not mean the same depth of analysis for each of them. The quality of analysis should be verified separately for the languages you need.
Project maturity. The project is relatively new and has about two thousand stars on GitHub. Issues related to Git worktrees and integration with agents have been recorded.
Agent ignoring the tool. The agent may not use Gortex and may fall back to reading files and searching the code. You need to check which tools the agent actually calls and monitor adherence to this order.
Conclusions
The main value of Gortex lies not only in saving tokens. The tool delivers the context the agent needs without filling the window with code that is not required to solve the task. This matters when analyzing complex changes.
For small projects, such a tool is excessive. For work across several services and repositories, it may be useful. Before adopting it, it is recommended to test the tool on your own project and compare it with alternatives.
Problem and Introduction
Problem: AI agents spend a lot of tokens on code search (grep, reading files). Gortex offers a knowledge graph as an alternative.
- Gortex is a free open-source tool
- In the project example, the task dropped from 11,500 to 688 tokens (a 94% reduction)
- The agent spends context on reading files, grep, and searching for references
How Gortex Works
Gortex builds a dependency graph: functions, calls, interfaces, relationships. It supports around 257 languages, multiple repositories, and updates when code changes.
- The graph includes functions, dependencies, callers, interfaces
- Support for around 257 programming languages is claimed
- Works with multiple repositories and updates the graph when code changes
- The tool itself estimates saved tokens
Installation and Indexing
Installation on Mac is simple: run the installer, open a new terminal, run the commands that install agent integrations, and start the background daemon. Docker, a virtual environment, and a separate database are not needed.
- The command
gortex installconfigures integrations with agents - The command
gortex daemon start --detachstarts the background daemon - Docker, a virtual environment, and a separate database are not required
- For a repository,
gortex trackandgortex analyzeare run, creating a project configuration for the agent
Practical Example with a Single Repository
Example: you need to change the function `process_payment`. Claude uses the Gortex graph to find the calls, dependent parts of the code, and relevant tests without loading entire files into the context.
- Task: trace the call chain of
process_paymentand find the affected tests - The agent requests relationships directly through the graph's tools
- Tests may not break, but the scope of places to check is narrowed
Multiple Repositories and API Contracts
Second repository (frontend and backend). Gortex checks API contracts between repositories, finds mismatched endpoints and call sites from the frontend.
- The frontend calls a payments endpoint provided by the backend
- API contract checking between two repositories
- Gortex finds mismatched or unpaired endpoints
How Gortex Understands Relationships
Gortex uses tree-sitter to parse code and deep methods (language server) for major languages. Relationships are stored in a graph; MCP tools: call chain, dependencies, change impact, data flow analysis.
- Tree-sitter extracts functions, classes, imports
- For major languages, language server integration is used
- MCP tools: call chain, dependencies, change impact, data flow
- The daemon watches files and updates only the changed parts of the graph
- Indexing is local, but code may be sent to the agent's model provider
Comparison with Alternatives
Comparison: Graphify links code with documentation and PDFs; GitNexus has a convenient browser-based graph explorer and supports cross-repo analysis. Gortex stands out with a single binary, a shared daemon, live updates, API contract analysis, and a token dashboard.
- Graphify combines code with documentation, PDFs, and auxiliary files
- GitNexus has a browser-based graph explorer, supports call graphs, and MCP
- Gortex: one native binary, a shared daemon for multiple repositories, API contracts, token savings dashboard
- The author does not consider Gortex definitively better than other tools
Limitations and Pitfalls
Drawbacks and limitations: token savings are an estimate, not an exact fact; high memory consumption on large repositories (Linux kernel benchmarks run to several gigabytes); the project is relatively new; possible issues with git worktrees; the agent may ignore Gortex.
- Token savings are an estimate, compared against typical file reading
- On large repositories memory use can be substantial; the Linux kernel benchmark uses several GB
- The project is new, with roughly a couple thousand stars on GitHub
- There are issues related to git worktrees and agent integration
- The agent may ignore Gortex and fall back to grep and file reading