Teixido Inhibition Gate for codebases. Compresses LLM context by 80-95% using Domination Roots. Native MCP server for Claude Code.
Project description
Teixido-Code-Manifold (TIG) v3.4
Stop sending your entire codebase to Claude. It's causing structural hallucinations and burning your usage limit.
TIG is a Teixido Inhibition Gate for codebases. It intercepts LLM context requests, analyzes your Abstract Syntax Tree, and applies Topological Analytical Homeostasis (TAH) to compress your project down to its "Teixido Skeleton" — the 3-5% of functions that hold the actual structural load of your application.
The result: 80-95% fewer tokens sent to Claude per session, which directly stretches your Claude Code usage limit by the same factor.
Why TIG Beats Basic Codebase Indexers
Standard tools (like codeindex) map everything with regex and give you a "blast score" — still drowning the AI in noise.
TIG applies Weighted Topological Strain to mathematically isolate the Domination Roots:
strain(f) = log1p((in_degree × 0.6 + normalized_complexity × 0.4) × 100)
Then applies Adaptive TIG Gate (Topological Inhibitory Gating) using dynamic thresholding:
threshold = mean(strain) + ε × std_dev(strain)
Only nodes above this threshold are fed to Claude. Everything else is structural noise.
| Metric | codeindex | TIG |
|---|---|---|
| Parsing | Regex | Python AST + robust regex |
| Algorithm | Raw BFS count | Weighted topological strain |
| Context compression | ❌ No | ✅ 80-95% |
| MCP server | ✅ | ✅ |
| PyPI | ❌ | ✅ |
| Tests | ❌ | ✅ CI on every push |
| Languages | 12 (regex only) | 13+ (AST for Python) |
Installation
pip install teixido-code-manifold
Or from source:
git clone https://github.com/johnvteixido/TIG.git
cd TIG
pip install -e ".[dev]"
Usage
CLI
# Analyze a single file
teixido-extract --file src/main.py
# Analyze a whole project
teixido-extract --dir ./my-project
# Output raw JSON
teixido-extract --file app.py --json
# Adjust TIG sensitivity (higher = fewer roots)
teixido-extract --dir . --epsilon 1.5
Python API
from core.manifold import TeixidoEngine
# Analyze source code string
result = TeixidoEngine.analyze(source_code, language="python")
print(result["domination_roots"]) # ['main', 'process_data', 'connect_sql']
print(result["compression_ratio"]) # 87.5 (%)
print(result["token_savings"]) # {'token_savings_pct': 91.2, ...}
# Analyze a whole directory
result = TeixidoEngine.analyze_directory("./my-project")
print(result["files_analyzed"]) # 47
print(result["domination_roots"]) # top load-bearing functions across all files
FastAPI (Vercel)
teixido-serve # starts on http://localhost:8000
# or deploy to Vercel: link this repo, vercel.json handles routing
Endpoints:
GET /— Health checkGET /api/info— Capabilities + supported languagesPOST /api/extract— Analyze source code stringPOST /api/compress— Analyze a local directory
🤖 Claude Code MCP Integration
This is the killer feature. Add TIG as a native MCP server so Claude Code can call it directly during every session — automatically compressing context before Claude reads your code.
Step 1: Install TIG
pip install teixido-code-manifold
Step 2: Add to Claude Code MCP config
Edit ~/.claude/claude_desktop_config.json (or equivalent):
{
"mcpServers": {
"teixido": {
"command": "teixido-mcp",
"args": []
}
}
}
Step 3: Use in Claude Code
Once configured, Claude Code has access to three tools:
| Tool | What it does |
|---|---|
extract_manifold |
Analyze a source code string → Domination Roots |
compress_codebase |
Analyze your whole project → architectural skeleton |
get_token_savings |
Show exactly how many tokens + % you're saving |
store_memory (Pro) |
Save a durable fact/decision to project-scoped long-term memory |
search_memory (Pro) |
Recall stored facts across sessions (survives context compaction) |
delete_memory (Pro) |
Prune outdated memories by id |
Example Claude Code prompt:
"Before we start, run
compress_codebaseon./srcand tell me the Domination Roots."
Claude will call TIG, get back the 3-5 structurally critical functions, and work only from those — using a fraction of your hourly token budget.
Token Savings & Usage Limit Impact
| Source Size | Without TIG | With TIG | Savings |
|---|---|---|---|
| 500-line file | ~2,000 tokens | ~80 tokens | 96% |
| 2,000-line file | ~8,000 tokens | ~120 tokens | 98.5% |
| 50-file project | ~80,000 tokens | ~1,000 tokens | 98.75% |
If Claude Code limits you to, say, 50,000 tokens/hour — with TIG, that same budget covers the equivalent of 1,000,000+ tokens of raw codebase, effectively making the hourly limit invisible for normal development workflows.
Supported Languages
| Language | Parsing Method |
|---|---|
| Python | ✅ stdlib ast (full AST, exact line numbers) |
| JavaScript | Robust multi-pattern regex |
| TypeScript | Robust multi-pattern regex + /// references |
| Go | Multi-line import block regex |
| Rust | use, mod, extern crate patterns |
| Java | import statement regex |
| Kotlin | import statement regex |
| Swift | import statement regex |
| C / C++ | #include directive regex |
| PHP | require, use, namespace regex |
| Ruby | require, require_relative regex |
| C# | using directive regex |
Architecture
teixido-code-manifold/
├── core/
│ ├── languages.py # Multi-language parser (AST + regex)
│ ├── manifold.py # Weighted Topological Strain engine
│ └── mcp_server.py # MCP stdio server (Claude Code integration)
├── api/
│ └── index.py # FastAPI serverless entry point (Vercel)
├── cli.py # Console entry points
├── tests/ # pytest suite
├── pyproject.toml # PyPI packaging config
└── vercel.json # Vercel deployment config
License
Proprietary Software - All Rights Reserved.
Architect & Creator: John V. Teixido © 2026 tigcode.app Unauthorized copying, reverse-engineering, distribution, or commercial use of this file or any part of the TIG codebase (including the client engine and the server nodes) is strictly prohibited.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file teixido_code_manifold-3.4.2.tar.gz.
File metadata
- Download URL: teixido_code_manifold-3.4.2.tar.gz
- Upload date:
- Size: 58.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d43fb85a35058176d78a682a7c0574e776207eba857da930c03b811e06ccea1c
|
|
| MD5 |
a8b18dc8b1af6334dcde599a73f7ae75
|
|
| BLAKE2b-256 |
8cbe13eb90be2d3242a8483479abd14d33eed65859c7b82f0906033adaf06722
|
File details
Details for the file teixido_code_manifold-3.4.2-py3-none-any.whl.
File metadata
- Download URL: teixido_code_manifold-3.4.2-py3-none-any.whl
- Upload date:
- Size: 52.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
654063e583ef06808bc32d4b22fbf4ee5d5bc070c3e0bcb63d9f485abf1eceff
|
|
| MD5 |
1ee9484fcded6ce9b1083a339bea8ee8
|
|
| BLAKE2b-256 |
7ad5f15f1495296be89a948df3e4b74f2cd0c2a7c8c43b958f9df99913fd7c45
|