AI Decision System
Replayable, offline-verifiable records for AI-assisted go/no-go decisions: experiment promotions, typed model answers and human-approved actions.
Cut LLM context ingestion by up to 95%. 37 Autonomous MCP tools. 4D Causal Graph & PBFT Swarm Consensus. 100% Zero-Leak security.
Translation pending
Developer toolsPython · JavaScriptGitHub @toprakahmetaydogmusOnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
High-performance AST Context Pruner & 14-Tool Autonomous MCP Server for Cursor, Claude Code & Windsurf — Up to 94.9% Token Reduction, 100% Zero-Leak Security (TDQS Grade A)
Taken from the repository README
Loading the full README.
Read the full README ↗High-performance AST context pruner & MCP server for AI coding assistants.
Reduces codebase prompt tokens by up to 94.9% while preserving complete class contracts, typed signatures, and cross-file dependencies.
Why T-Zero • Quickstart • Benchmarks • Tools Reference • Architecture • Türkçe
When an AI coding assistant (Cursor, Claude Code, Antigravity IDE, Windsurf, Cline) reads your codebase, feeding full source files wastes 80% to 95% of your context window on internal loop bodies, routine calculations, and local variables. The model needs to know what your modules expose and call, not 100 lines of boilerplate implementation inside each method.
T-Zero acts like an on-the-fly .pyi / .d.ts declaration generator for your AI context window:
┌─────────────────────────────────┐
│ Full Source Codebase │ (166,996 raw tokens — $0.50/query, 18s latency)
└────────────────┬────────────────┘
│
▼ [ T-Zero Native AST Parser ]
│ Strips routine bodies, preserves signatures, types & docs
▼
┌─────────────────────────────────┐
│ T-Zero AST Skeleton Tree │ (8,465 tokens — $0.025/query, 2.1s latency)
└─────────────────────────────────┘
# BEFORE: Raw source file (1,240 tokens)
class PaymentGateway:
def __init__(self, api_key: str, timeout: int = 30):
# 30 lines of connection pooling, socket configuration, SSL contexts...
self.session = requests.Session()
self.timeout = timeout
...
def process_charge(self, user_id: str, amount_cents: int, currency: str = "USD") -> TransactionResult:
"""Charges a customer card with automated retry and idempotency."""
# 60 lines of payload hashing, error handling, database locking, telemetry...
if not user_id:
raise ValueError("user_id required")
...
# AFTER: T-Zero AST Skeleton (64 tokens — 94.8% reduction)
class PaymentGateway:
def __init__(self, api_key: str, timeout: int = 30): ...
def process_charge(self, user_id: str, amount_cents: int, currency: str = "USD") -> TransactionResult:
"""Charges a customer card with automated retry and idempotency."""
...
The AI assistant retains full access to class names, typed parameters, docstrings, and return types — with zero semantic loss, at a fraction of the token cost, and with drastically faster Time-To-First-Token (TTFT).
Automatically detect and configure Cursor, Claude Desktop, Antigravity IDE, Windsurf, Cline, and VS Code in 5 seconds with zero manual JSON editing:
uvx tzero-mcp --add-mcp
# or using pipx
pipx run tzero-mcp --add-mcp
# Launch MCP server stdio transport instantly:
uvx tzero-mcp
# or:
pipx run tzero-mcp
pip install tzero-mcp
Add the following to your claude_desktop_config.json or Cursor Settings (Features → MCP):
{
"mcpServers": {
"tzero": {
"command": "uvx",
"args": ["tzero-mcp"]
}
}
}
Or using local python:
{
"mcpServers": {
"tzero": {
"command": "python",
"args": ["-m", "tzero_mcp"]
}
}
}
claude mcp add --scope user tzero uvx tzero-mcp
tzero --dashboard
Opens the local browser dashboard on http://localhost:8421 featuring interactive dependency graphs and the live AST pruner sandbox.
Prevent accidental credential leaks and token bloat before code ever leaves developer machines. Add to your .pre-commit-config.yaml:
repos:
- repo: https://github.com/toprakahmetaydogmus/TZeroAlgorithm
rev: v8.0.1
hooks:
- id: tzero-guard
- id: tzero-audit
Automatically audit repositories for zero hardcoded secrets and generate token optimization summaries on every commit and PR:
# .github/workflows/tzero.yml
name: T-Zero Codebase Guard
on: [push, pull_request]
jobs:
tzero-audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: toprakahmetaydogmus/TZeroAlgorithm@main
with:
workspace-dir: '.'
audit-level: 'strict'
If your repository, library, or framework is optimized for AI coding assistants using T-Zero, embed our official badge in your README.md. This signals to developers and AI coding agents that your repository can be ingested with 90%+ less token overhead:
[-blue?style=flat-square&logo=python)](https://github.com/toprakahmetaydogmus/TZeroAlgorithm)
Dark Mode / Slate variant:
[-38bdf8?style=flat-square&logo=python&labelColor=0f172a)](https://github.com/toprakahmetaydogmus/TZeroAlgorithm)
| Dimension | Raw Codebase Ingestion | T-Zero AST Context Architecture | Impact / Developer Advantage |
|---|---|---|---|
| Context Window Consumption | 166,996 tokens (90%+ routine bodies) | 8,465 tokens (pure typed signatures) | 🔥 94.9% Token Reduction |
| API Cost per Pass (Claude 3.7 / GPT-4o) | $0.501 per query | $0.025 per query | 💰 20x Cost Savings |
| Response Latency (TTFT) | 18.4s slow time-to-first-token | 2.1s instant response | ⚡ 8.7x Faster Generation |
| Hallucination Risk (Ghost Imports/Params) | High (phantom packages & invented args) | 0% (Blocked by 5-Tier AST Guard) | 🛡️ 100% Deterministic |
| Helper Function Reusability | Poor (AI constantly reinvents wheels) | Auto-Surfaced (suggest_reusable_helpers) | ♻️ Zero Logic Duplication |
| Security Leak Vulnerability | High (.env secrets & tokens leaked to API) | 0 Leaks (100% Offline Zero-Leak AST) | 🔒 100% Zero-Leak Certified |
| Tool Definition Quality (TDQS) | Untested / Ad-hoc | Anchor-5 Certified (Grade A 5.0/5.0) | ⭐ 0 Notes / 0 Warnings |
| Analysis Target | Raw Codebase Tokens | T-Zero AST Payload | Token Savings | Cost per Query (Claude 3.7 / GPT-4o) | Latency (TTFT) |
|---|---|---|---|---|---|
| Full Repository Scan (38K LOC) | 166,996 tokens | 8,465 tokens | -94.9% | $0.501 → $0.025 | 18.4s → 2.1s |
| Large Backend Service | 42,180 tokens | 2,410 tokens | -94.3% | $0.126 → $0.007 | 6.2s → 0.9s |
| Git PR Diff Stream | 18,450 tokens | 1,120 tokens | -93.9% | $0.055 → $0.003 | 2.8s → 0.4s |
Verify locally on your machine with zero cloud cost:
python tzero.py --savings
Strips internal routine execution bodies while preserving every class definition, typed signature, docstring, and return type. Zero heuristic line cutting — 100% deterministic language parsing.
Zero external compiler dependencies. Supports:
ast parser)Before refactoring a class or function, T-Zero calculates its exact downstream dependency impact (0–100 score), identifying every file, import, and symbol that could break.
Guaranteed 100% offline execution. Includes pre-commit hooks and real-time scanners that block .env secrets, private tokens, and credentials from ever being sent to LLM APIs.
Natively integrates the Superdesign UI methodology into Claude Code and Cursor with 5 tools to generate design systems, component specifications, and interactive browser preview galleries.
Eliminates AI coding hallucinations before changes touch files. Statically intercepts ghost dependencies, validates workspace symbol tables and keyword arguments, enforces class schema fields, and checks return type contracts, backed by an automated self-healing AST transformer (repair_code) and immutable grounding contract generation.
Automatically surfaces reusable existing utility helpers across the repository AST (suggest_reusable_helpers / --helpers), injecting ready-to-use imports into focus skeletons so AI models never duplicate code already written in your project.
execute_codebase_workflowExecute any codebase workflow, multi-stage audit, or specific T-Zero engine in a single unified MCP command:
// Full autonomous pipeline: Security Audit + Architecture Blueprint + Token ROI + Code Quality
{
"name": "execute_codebase_workflow",
"arguments": {
"action": "auto",
"target": "."
}
}
Or execute targeted operations on demand:
"action": "security" — 100% Zero-Leak secret scan across workspace"action": "context" — Hierarchical AST context tree generation"action": "blueprint" — Mermaid system architecture & component topologies"action": "impact" — Change blast radius analysis for a class or function"action": "heal" — Automated AST diagnostic diagnosis & self-healing patch"action": "search" — Local BM25 hybrid semantic searchTool Architecture: By default, T-Zero exposes the 15 TDQS-certified Canonical & Omni Tools to prevent context bloat and ensure 5/5 tool coherence. The full 49-tool suite is available on-demand via
tzero-mcp --allorTZERO_MCP_TOOL_MODE=all(and all 49 tools remain dynamically callable viacall_tool()in both modes).
T-Zero tools grouped by functional category:
get_project_context_tree: Multi-tier hierarchical AST context tree (T-1 to T-4).prune_code_snippet: Strips implementation bodies from in-memory snippets or diff streams.prune_schema_definition: Compresses database schemas, OpenAPI specs, and protobuf definitions.get_smart_skeleton_context: Focus-file implementation with 1st-degree caller/callee skeletons.get_incremental_diff_context: Git diff context pruned with AST signatures.generate_zero_waste_prompt_context: Token-optimized prompt preamble for coding agents.suggest_reusable_helpers: Discovers and surfaces existing reusable helpers across AST to prevent reinventing wheels.query_module_dependencies: Analyzes import/export graphs across 10+ programming languages.analyze_code_dependencies: Deep dependency mapping, call chains, PageRank, and dead code.analyze_change_impact: Calculates change blast radius (0-100) and downstream dependents.rank_repository_pagerank: Identifies architectural backbone files by network centrality.trace_symbol_call_chain: Traces cross-file execution flow from caller to callee.find_dead_code: Detects unreferenced, unreachable, or orphaned functions.verify_security_guard: 100% Zero-Leak scan for hardcoded credentials and secrets.verify_zero_leak_security: Validates that files adhere to the Zero-Leak security policy.install_git_security_guard: Installs pre-commit hooks preventing credential leaks.audit_code_quality: Static AST analysis, cyclomatic complexity, and code smell audits.audit_codebase_quality: Static code audit across workspace files.verify_hallucination_guard: Ground-truth verifier detecting hallucinated imports and types.superdesign_generate: Structured specifications for UI, wireframe, component, logo, and icon creation.superdesign_iterate: Surgical iteration instructions to refine existing design files with feedback.superdesign_extract_system: Extracts structured design token JSON schemas.superdesign_list: Enumerates all design iterations and systems in workspace.superdesign_gallery: Builds interactive HTML gallery with live previews and modal zoom.query_architecture_boundaries: Inspects active T-4 architectural layer constraints.enforce_architecture_boundaries: Validates import boundaries defined in tzero.rules.json.generate_architecture_blueprint: Synthesizes complete system specification with live Mermaid diagrams.generate_repo_map: Ultra-compact AST symbol token map for chat context windows.export_agent_rules: Exports AI rule specifications (.cursorrules, .clinerules, .cursor/rules/*.mdc).query_memory_store: Queries semantic triples, causal graphs, and MinHash entity clusters.manage_memory_store: Consolidates, exports, lists, resets, or compresses memory stores.jarvis_query_knowledge_graph: Graph query engine for entity-relationship triples.jarvis_consolidate_memory: Consolidates short-term episodic memory into long-term memory.jarvis_compress_semantic_memory: Compresses text into semantic triples.jarvis_decompress_semantic_memory: Reconstitutes compressed triples into coherent context.jarvis_compress_document: Compresses long documents while preserving critical facts.jarvis_export_memory_store: Exports agent knowledge stores to JSON or HTML visualizations.orchestrate_agent_swarm: Coordinates multi-agent workflows, PBFT consensus, and self-healing.jarvis_orchestrate_goal: Decomposes high-level objectives into phased execution plans.jarvis_swarm_orchestrate: Coordinates collaborative multi-agent execution.jarvis_bft_swarm_consensus: Byzantine fault-tolerant voting with 3f+1 quorum.jarvis_self_healing_execute: Runs shell commands with automated AST failure healing.generate_smart_micro_patch: Generates surgical git-compatible diff patches.estimate_token_cost: Real-time cost comparisons across OpenAI, Anthropic, Gemini, and DeepSeek.get_token_savings_metrics: Quantitative token compression metrics and monthly ROI savings.compress_stream_tokens: Compresses live text streams using localized codebooks.search_codebase: Local BM25 hybrid semantic and lexical code search.search_codebase_semantic: 100% private semantic search without cloud embedding APIs.flowchart TD
subgraph Input ["Input Layer"]
REPO["Source Code Repository"]
end
subgraph Parser ["AST Engine"]
AST["Language AST Visitor"]
SIG["Signature & Type Extractor"]
DEP["Import & Call Graph Analyzer"]
end
subgraph Core ["T-Zero Engine"]
PRUNER["AST Skeleton Pruner (-94.9% Tokens)"]
GUARD["100% Zero-Leak Security Guard"]
SUPER["Superdesign UI Engine"]
end
subgraph Delivery ["MCP Delivery"]
MCP["tzero_mcp.py (Stdio Server)"]
DASH["tzero --dashboard (localhost:8421)"]
end
subgraph Clients ["AI Clients"]
CURSOR["Cursor IDE"]
CLAUDE["Claude Code / Desktop"]
AGY["Antigravity IDE"]
WINDSURF["Windsurf / Cline"]
end
REPO --> AST
AST --> SIG
AST --> DEP
SIG --> PRUNER
DEP --> PRUNER
PRUNER --> GUARD
GUARD --> MCP
SUPER --> MCP
PRUNER --> DASH
MCP --> CURSOR
MCP --> CLAUDE
MCP --> AGY
MCP --> WINDSURF
100% Zero-Leak Guarantee: T-Zero contains ZERO hardcoded, personal, or public API keys. All AST parsing, BM25 indexing, and blast radius calculations run 100% locally on your machine with zero external network telemetry.
T-Zero, yapay zeka kodlama ajanları (Cursor, Claude Code, Antigravity IDE, Windsurf, Cline) için geliştirilmiş, kod tabanı bağlamını yapısal olarak koruyarak token tüketimini %94.9'a kadar azaltan açık kaynaklı bir bağlam motoru ve Model Context Protocol (MCP) sunucusudur.
Bir AI asistanına binlerce satırlık ham kod dosyaları verildiğinde, fonksiyonların içindeki döngüler ve rutin işlemler bağlam penceresini gereksiz yere doldurur. T-Zero, kod tabanını derleyici seviyesinde AST ile ayrıştırarak fonksiyon gövdelerini çıkarır; yalnızca sınıf yapılarını, tip imzalarını, docstring'leri ve bağımlılıkları korur.
# Kurulum yapmadan doğrudan çalıştırmak için (uvx):
uvx tzero-mcp
# veya pip ile kurun:
pip install tzero-mcp
# Yerel görsel paneli açın:
tzero --dashboard