Skip to main content

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

PyPI Tests License: Proprietary

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 check
  • GET /api/info — Capabilities + supported languages
  • POST /api/extract — Analyze source code string
  • POST /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_codebase on ./src and 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

teixido_code_manifold-3.4.1.tar.gz (58.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

teixido_code_manifold-3.4.1-py3-none-any.whl (52.0 kB view details)

Uploaded Python 3

File details

Details for the file teixido_code_manifold-3.4.1.tar.gz.

File metadata

  • Download URL: teixido_code_manifold-3.4.1.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

Hashes for teixido_code_manifold-3.4.1.tar.gz
Algorithm Hash digest
SHA256 52c0c12ba2e0cd643f105c088a115f3eade2b96ebff6068397dcf6d7a1065a98
MD5 9f4a2171d61d3b8754c4fd459a438975
BLAKE2b-256 221a355e888b8803c8f07d03ab089d4a9bc8487f0d1b5e261c9d4635ef1dc1ff

See more details on using hashes here.

File details

Details for the file teixido_code_manifold-3.4.1-py3-none-any.whl.

File metadata

File hashes

Hashes for teixido_code_manifold-3.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a55bd70f238944d41b0717c7f12c43dfe73bc050f690cb2ae55096fb04234adb
MD5 8c1e55b3c687997d2375d49c0915a2ff
BLAKE2b-256 79a584aef34cc51eb02c7b2effa47126aaf8dccaf7f2e562a8e17bb9e6bfba23

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page