Skip to content

About

Deterministic AST Context Compressor & MCP Server for Cursor, Claude & Local LLMs. Cuts prompt tokens by 85–95% with 100% Zero-Leak security.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

128 stars

Watchers

1 watching

Forks

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Latest commit

 

History

516 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Siber Akademi — T-Zero

T-Zero: Deterministic AST Context Compressor, MCP Server & 180-Tier Anti-REA

AST Context Compression Engine, 21 Canonical MCP Tools (58 Runtime Tools), 180-Tier Anti-REA Sovereign Armor, Real BPE Benchmarks & Pre-Flight Reality-Lock.

English | Türkçe | 日本語 | 简体中文 | Privacy Policy | Interactive Colab | Hugging Face Space | Benchmark Hub

GitHub Release PyPI npm VS Code Open VSX Downloads Stars

Engine Anti-REA CI TDQS CodeQL Dependabot License


Road to 500 GitHub Stars: Help Keep T-Zero 100% Free & Open-Source

Empirically proven token optimization engine for Cursor, Claude Code, Windsurf & Antigravity IDE.

Star on GitHub Product Hunt Interactive Colab Hugging Face Spaces Live Vercel Hub

Find us on Product Hunt   Listed on VibeShelf

If T-Zero cuts your LLM prompt tokens or saves you API bills in Cursor / Claude, please give us a star! ⭐
Every star supports an independent developer maintaining this open-source project.


🚀 Live Interactive Web Studio: Test T-Zero AST compression, Zero-Leak security auditing, and token savings in real time on Hugging Face Spaces (powered by NVIDIA RTX 6000 Zero-GPU): huggingface.co/spaces/toprakke4/tzero-token-reducer | Live Vercel Hub

T-Zero Autonomous Benchmark Terminal Recording (macOS HUD)

Quickstart

# Option B: Python PyPI Package:
pip install --upgrade tzero-mcp

# Option C: 1-Line Native Shell Installers:
# Linux / macOS / WSL:
curl -fsSL https://raw.githubusercontent.com/toprakahmetaydogmus/TZeroAlgorithm/main/install.sh | bash
# Windows (PowerShell):
irm https://raw.githubusercontent.com/toprakahmetaydogmus/TZeroAlgorithm/main/install.ps1 | iex

# Option E: Git Clone & Source Checkout:
git clone https://github.com/toprakahmetaydogmus/TZeroAlgorithm.git
cd TZeroAlgorithm
python scripts/welcome.py    # Community welcome (does not modify Git hooks)
pip install -e .             # Editable dev install (does not modify Git hooks)

# Optional: explicitly install star reminders (skips existing hooks/managers):
python scripts/welcome.py --install-star-hooks

# 1-Click Configure MCP in Cursor, Claude, Antigravity, Windsurf:
tzero init

# 1-Click Viral Community Share Hub (Twitter, Reddit, Hacker News):
tzero share

# Option D: Standalone Windows 64-Bit Executable Suite (Zero Dependencies):
# Download all-in-one suite (.ZIP) with GUI, CLI, MCP Server & 1-Click Configurator:
# https://github.com/toprakahmetaydogmus/TZeroAlgorithm/releases/download/v12.3.4/TZero-v12.3.4-Windows-x64.zip

# Install VS Code / Cursor Extension (.vsix):
code --install-extension dist/tzero-vscode-12.3.4.vsix

Navigation & Interactive Jump Stations

Technical Whitepaper T-Zero PC-Fixer TDQS Certified Why T-Zero Task Benchmark IDE Setup 21 MCP Tools Reality-Lock Language Support Hugging Face Türkçe Dokümantasyon

Why T-Zero • Universal IDE Setup • 21 MCP Tools • Language Support • Benchmarks • Tool Quality (TDQS) • Reality-Lock • Hugging Face Space • Türkçe Rehber

Git hooks & PATH setup

Git reminder hooks are opt-in. Installation and normal startup do not change core.hooksPath. The optional command uses Git's default hooks directory and refuses an existing hook manager or active hooks.

If a Python installation of T-Zero is missing from your PATH, run the following command with the Python interpreter that installed it.

python -m tzero.tzero_deps --add-to-path

On Windows you can use py in place of python. The command appends the launcher directory to your Windows user PATH or to your Bash or Zsh startup file on macOS and Linux. Use --shell bash or --shell zsh to select the Unix startup file explicitly. Open a new terminal after the change. On Windows, sign out and back in if the terminal still has the old PATH.

If an older T-Zero install set your local core.hooksPath to .githooks, inspect git config --show-origin --get-all core.hooksPath and .githooks/ first. If that local setting was added by T-Zero, git config --local --unset core.hooksPath restores inherited/default hook lookup. If it replaced a previous local setting, restore that original value or rerun your hook manager's installer. T-Zero cannot recover an overwritten configuration value automatically.

Security advisory

GitHub flags npm tzero-mcp@12.3.0 in GHSA-pm3r-rxg9-cj5j. If you installed or ran that version, follow GitHub's remediation guidance. The advisory lists no patched release.

Local analysis and network access

AST pruning, Shannon entropy secret scanning, and BM25 lexical search run locally. Optional AI-assisted generation sends prompts, file paths, dependency relationships, and code excerpts only to the provider you configure or explicitly select — missing keys and remote provider errors fall back locally to the AST engine without automatic Pollinations retries. Package and tokenizer downloads, optional DuckDuckGo web search, public GitHub/PyPI/npm project metrics, and hosted demos can also use the network. System repair and optional 180-Tier Anti-REA hardening tools run only when explicitly invoked (including opt-in-only webhook alerts). See Privacy and network behavior for details.


Executive Summary: What is T-Zero?

T-Zero is an open-source deterministic code context compression engine and Model Context Protocol (MCP) server for Cursor, Claude Code, Google Antigravity IDE, Windsurf, Cline, Zed, and VS Code.

T-Zero reduces code passed as context by keeping the target file intact and summarizing surrounding dependencies. Savings depend on the task and what the assistant would otherwise read.

Context Architecture & Tool Comparison Matrix

Dimension Raw Prompt Ingestion (Cursor Composer / Claude) Vector DB / Embedding RAG Repomix (Packed File Concat) Aider (Tree-Sitter Repo-Map) T-Zero Deterministic AST Engine
Token Reduction 0% (Massive context waste) 40–70% (Fragmented recall) 0% (Dumps raw source text) 70–85% (Symbol map only) 85.0% – 95.0% (Deterministic AST Skeleton)
Context Strategy Full raw file bodies Cosine similarity chunks XML file packing PageRank top-ranked signatures Smart Skeleton (Focus full + 1st-deg typed interfaces)
Hallucination Guard None (Model hallucinates calls) None (Caller context lost) None None Pre-Flight Reality-Lock (Static AST Verification)
Polyglot Languages Plain text Plain text Plain text 10+ languages 12+ Languages (Python, TS, Go, Rust, Java, C#, Swift)
Protocol Integration Manual copy/paste Custom proprietary cloud CLI file export Interactive terminal only Universal MCP Server (Cursor, Claude, Windsurf, VS Code)
Live Watcher Manual reload Cloud re-indexing Manual CLI command None Real-Time Live AST Watcher (Sub-8ms on file save)
IDE Lifecycle Hooks None None None None PreToolUse & PostToolUse Guardrails (Claude Code, Gemini)
Zero-Leak Security Plaintext risk Cloud embedding risk Can dump .env files None Shannon-Entropy Key Scrubber ($H \ge 4.75$, 100% Local)
Architecture Boundaries None None None None tzero.rules.json CI/CD Gate Enforcement
Inference & Tool Cost $3.00 – $15.00+ / turn Cloud Vector DB fees $3.00 – $15.00+ / turn API model fees $0.00 (100% Free & Open-Source, Local CPU)

Universal 1-Click IDE Setup (All Editors)

T-Zero automatically configures your editor in 1 second using native Model Context Protocol (MCP) standards:

# 1-Click auto-detect and configure all installed editors:
tzero init

# Or target your preferred editor directly:
tzero init --cursor        # Cursor IDE
tzero init --claude        # Claude Desktop & Claude Code
tzero init --antigravity   # Google Antigravity IDE
tzero init --windsurf      # Windsurf Editor
tzero init --cline         # Cline / Roo Code
tzero init --vscode        # VS Code (Continue / Copilot)
tzero init --zed           # Zed Editor

# Install official VS Code / Cursor Extension (.vsix):
code --install-extension dist/tzero-vscode-12.3.4.vsix

Manual Configuration Snippets (Any MCP Client)

Cursor (`.cursor/mcp.json` or Settings → Features → MCP)
{
  "mcpServers": {
    "tzero": {
      "command": "python",
      "args": ["-m", "tzero_mcp"]
    }
  }
}

Or zero-install via uvx:

{
  "mcpServers": {
    "tzero": {
      "command": "uvx",
      "args": ["tzero-mcp"]
    }
  }
}
Claude Desktop (`claude_desktop_config.json`)

Path: %APPDATA%\\Claude\\claude_desktop_config.json (Windows) or ~/Library/Application Support/Claude/claude_desktop_config.json (macOS)

{
  "mcpServers": {
    "tzero": {
      "command": "python",
      "args": ["-m", "tzero_mcp"]
    }
  }
}

The 21 Canonical MCP Tools (58 Runtime Tools)

All 21 canonical tools (and 58 runtime tools) are audited and verified against the Model Context Protocol specifications (tested by tests.test_mcp and tests.test_tdqs_anchor5):

Tool Name Scope Purpose
search_tools Discovery Dynamic catalog discovery exposing all 58 runtime MCP tools on demand.
build_project_context Context Builds a hierarchical context tree. Token reduction varies with the selected files and context tier.
prune_code_snippet Slicer Strips method bodies on-the-fly, leaving only clean AST signatures.
manage_architecture_rules Governance Defines and manages active architectural boundary rules in tzero.rules.json.
enforce_architecture_rules Governance Validates architectural layer rules and prevents cyclic or illegal cross-layer imports.
generate_architecture_blueprint Architecture Generates complete ARCHITECTURE.md with auto-generated Mermaid component diagrams.
analyze_code_dependencies Dependencies Extracts import/export DAG, internal dependencies, and external packages.
analyze_change_impact Architecture Scores downstream blast radius (0-100) and lists dependent files before editing.
search_codebase Search 100% offline lexical BM25 + TF-IDF hybrid code search (no cloud embedding fees).
audit_code_quality Linter Runs static AST code smell checks and Shannon entropy secret scans.
verify_security_guard Security Scans workspace for high-entropy tokens, private keys, and API credentials.
estimate_token_cost FinOps Estimates input cost from token counts and configured rates.
query_memory_store Memory Searches semantic vector-quantized virtual memory triplets (`<
manage_memory_store Memory Consolidates, prunes, and manages persistent semantic memory triplets.
orchestrate_agent_swarm Multi-Agent Coordinates multi-agent PBFT consensus and task routing across workspace subagents.
build_ast_snapshot Snapshot Pre-computes sub-8ms cached AST snapshot bundle for instantaneous agent ingestion.
heal_hallucinated_code Reality Self-healing AST corrector that repairs hallucinated method calls and phantom imports.
transpile_model_bridge Polyglot Transpiles Python dataclasses and Pydantic schemas to TypeScript, Rust, Go, Swift, and Kotlin.
diagnose_and_heal_system Doctor Self-healing operating system doctor fixing environment, zombie processes, and ASTs.
generate_architectural_passport Architecture Synthesizes high-density AST structural passport for files and modules.
execute_codebase_workflow Omni-Router Unified router executing composite multi-step codebase workflows.

Language Support Breakdown: AST vs. Heuristic Extraction

We believe in radical engineering transparency:

Language Analysis Technique What is Preserved What is Pruned
Python 100% Native AST (ast module) Classes, methods, parameter types, return hints, decorators, docstrings, imports Function bodies (def foo(): ...)
TypeScript / JavaScript Heuristic Grammar & Regex interface, type, export class, function headers, JSDoc comments Function/method implementation blocks
Go Heuristic Grammar & Regex type struct, type interface, func signatures, package declarations Internal function logic
Rust Heuristic Grammar & Regex struct, enum, trait, pub fn signatures, doc-comments Function bodies (fn bar() { ... })
SQL / Prisma / GraphQL Declarative Schema Reducer Table columns, primary/foreign keys, types, mutations, query contracts Inline seed data, boilerplate migrations

Empirical Benchmarks & Token Reduction Reports

Whole-repository snapshot: 94.5% fewer context tokens

The November 14 local benchmark report records a single scan of 352 files using cl100k_base. The full repository counted 1,790,208 tokens and its Tier-2 AST context counted 98,461 tokens, a 94.5% reduction (about 95%). This compares two representations of the entire repository. Actual requests typically use a subset of files, and coding assistants may already select context, so this number does not predict per-request savings, cost savings, or task accuracy.

Gemini 3.8 Flash Low: targeted extraction on a real source file

We ran the same three code-comprehension questions in both conditions with Antigravity CLI. Each condition was repeated three times in a fresh session. The baseline supplied the entire snapshot engine source file. The targeted condition used T-Zero to supply two preselected, complete Python methods.

Measure Full file Targeted methods
Correct answers over three runs 9/9 9/9
Code-only tokens (o200k_base) 4,361 127
Average CLI input tokens (Gemini-reported) 32,686 27,299

The targeted input used 97.1% fewer code-only tokens and 16.5% fewer total CLI input tokens. The CLI includes its own agent context in the total. This comparison covers one file and three questions, with symbols selected in advance. It does not evaluate automatic symbol selection or end-to-end coding performance.

Recorded trials · Runner · Run from the repo root with python -m scripts.benchmark_gemini_flash_cli and a signed-in Antigravity CLI. The runner disables paid credit fallback for the session.

Gemini 3.8 Flash Low: diagnosing noisy pytest output

This is the human-assisted track. The runner supplied the log view, and in the follow-up we selected the source methods in advance.

We ran 26 existing T-Zero tests in a temporary copy. The baseline passed, then a deliberately introduced regression made the SQLite path reuse the JSON snapshot filename, causing four tests to fail. We used the same diagnosis prompt in three fresh Antigravity CLI sessions per condition. The focused summary uses failed test names and short stack traces from pytest JUnit XML. In a follow-up, we appended three manually selected T-Zero method definitions to that summary.

Evidence Average CLI input tokens Reduction vs. verbose Runs finding all four failures Runs finding the exact root cause
Verbose pytest (-vv --tb=long) 34,707 — 3/3 0/3
Native short pytest (-q --tb=short) 28,557 17.7% 3/3 0/3
Focused JUnit summary 27,807 19.9% 3/3 0/3
Focused summary + three source methods 28,600 17.6% 3/3 3/3

Every run found the SQLite error. Only runs with the three source methods pinpointed the filename collision and proposed giving SQLite a separate file. The log-only focused summary used 2.6% fewer total CLI input tokens than pytest's short output. The runner filtered the logs and T-Zero extracted the preselected methods. This experiment measures diagnosis of one seeded regression with supplied evidence. It does not measure automatic source selection or patch success.

Log-only trials · Follow-up trials · Runner. From the repository root with pytest and a signed-in Antigravity CLI, run python -m scripts.benchmark_pytest_logs_cli <output-dir> --revision 25fed66 for the log-only trials. Append --focused-with-source-only for the follow-up. The runner disables paid credit fallback.

Gemini 3.8 Flash Low: autonomous pytest diagnosis

This is the autonomous track. The agent received only the regression description, the workspace, and pytest.log, and chose its own evidence using local tools.

In three alternating pairs (six runs total), Antigravity CLI ran in a fresh temporary workspace containing the seeded SQLite filename collision. We compared a baseline with built-in tools (read_file) against an enabled condition offering local T-Zero MCP tools (search_codebase, build_project_context). Sessions stayed within the workspace without internet access, environment inspection, file modification, or paid credits.

Condition Runs finding root cause Average CLI input tokens Average total tokens Average duration Preferred inspection tool
Baseline (built-in tools only) 3/3 49,539 51,017 26.5s read_file (100%)
T-Zero available (built-in + MCP) 3/3 48,864 50,303 26.6s read_file (100%)

Every run located the exact root cause in SnapshotEngine.get_sqlite_path and formulated the correct one-line fix. When given an open choice, the agent in all three enabled runs chose built-in read_file exclusively to inspect pytest.log and the source file, never calling search_codebase or build_project_context. The minor token difference (1.4%) reflects variance in the line ranges selected with read_file, not T-Zero AST pruning. When unguided on a log triage task, the model prefers native file reads over external MCP search tools.

Recorded trials · Runner. Run from the repository root with python -m scripts.benchmark_autonomous_pytest_cli <output-dir>. The runner automatically disables installed plugins during baseline runs to avoid tool leaks and disables paid credit fallback.

Current-model comparison: raw vs. pruned Python context

On 2026-11-23, we ran six paired code-comprehension questions against NVIDIA Nemotron 3.5 Lightning (30B-A3B). Each question used the same model, settings, and wording with either the full Python dependency or its T-Zero AST skeleton. Input counts are the prompt tokens reported by NVIDIA NIM and include both code and question text.

Measure Full dependency AST skeleton
Input tokens across six prompts 2,345 1,772
Interface questions correct 3/3 3/3
Implementation-detail questions correct 3/3 0/3

Result: 24.4% fewer input tokens in this run. The model matched the full-code baseline on this small set of interface questions and answered all three implementation-detail questions incorrectly when the relevant bodies were omitted. Keep full source available when the task depends on behavior inside a function.

These questions use two synthetic Python fixtures and one model. They do not measure end-to-end coding success, latency improvements, or how much context a modern agent would select on its own. A comparison against a current agent's native retrieval is still needed.

Benchmark script · Recorded responses and token counts · Model

With the project installed and an NVIDIA Developer API key set in the environment, rerun against the NVIDIA-hosted prototype endpoint:

python -m scripts.benchmark_context_ab

Follow-up: retrieve the full function when behavior matters

We reran the same three implementation questions against the same model, using T-Zero's Python symbol packer to provide only the relevant full function. All three answers were correct, matching the full-dependency baseline. The targeted prompts used 455 input tokens in total versus 1,110 for full dependencies (59.0% fewer). The relevant symbols were selected ahead of time. This measures the value of supplying the right function body, while automatic retrieval remains untested.

Recorded targeted results · Rerun with python -m scripts.benchmark_context_ab --targeted-only.

Offline token and syntax checks

tzero task-benchmark scores three built-in Python fixtures using prewritten implementations by default. A local run with cl100k_base counted 1,156 → 897 tokens across the fixtures. The fixture checks inspect syntax and method names. They do not run coding tasks or model inference in the default mode.


Turbo Overdrive Burst Accelerator ("Kamçılama Modu")

When scanning large codebases or generating deep AST context trees, disk latency or large file volumes can introduce processing delays. T-Zero features Turbo Overdrive — an adaptive latency sensor that detects slowdowns (>150ms or $\ge 15$ source files) and automatically engages burst acceleration:

  • 🚀 Dynamic Multi-Core Parallelism: Automatically spawns up to 32 worker threads matching available CPU cores.
  • ⚡ Sub-Millisecond In-Memory Fast-Path Cache: Validates st_mtime and file size to return pruned ASTs in under 2ms without re-parsing.
  • 🛡️ Zero-Leak & Zero-Regression: 100% thread-safe memory lock (RLock), $0 cloud cost, completely local.
# View live Turbo Overdrive status & cache telemetry:
tzero turbo

# Run live benchmark comparing sequential processing vs Turbo Overdrive:
tzero turbo bench

# Clear accelerator in-memory cache:
tzero turbo clear

Autonomous Dynamic Subagent Decomposer & Swarm

When given a complex mission (e.g. "Audit secrets, verify architectural boundaries, optimize database queries, and generate unit tests"), T-Zero automatically:

  1. Decomposes Composite Goals: Identifies independent subtasks across security, architecture, performance, testing, and custom domains.
  2. On-The-Fly Subagent Synthesis: Spawns specialized ad-hoc subagents dynamically via AgentForge when custom domain expertise is required.
  3. Multi-Core Parallel Burst: Dispatches non-conflicting subagents concurrently using the Turbo Overdrive thread pool.
  4. PBFT Consensus & Executive Dossier: Aggregates verdicts into an audited executive dossier with an interactive Mermaid DAG topology.
# Decompose and execute composite mission across dynamic subagents:
tzero subagent "Audit security, check AST architecture, and run test coverage"

# Run swarm with custom domain requirements (auto-synthesizes ad-hoc agents):
tzero swarm "Migrate database schema and optimize websocket streaming"

Tool definition quality

See the Glama schema page for its dated independent TDQS score and evaluated tool set. Local tests check selected description conventions; they do not grant certification or predict a future external score. The default and full tool modes expose different catalogs.

What is TDQS (Tool Documentation Quality Score)?

Coding assistants can use tool descriptions and parameter schemas to decide:

  1. Which tool to call among dozens of registered capabilities.
  2. How to invoke it without argument hallucinations.
  3. Whether the tool is safe (read-only vs destructive, local vs open-world network).

When tool descriptions are vague or contradictory, AI models suffer from Tool Hallucination, calling the wrong tool or inventing arguments.

Local description checks:

Dimension Weight Anchor 5 Standard Requirement Local convention
1. Purpose Clarity 25% Specific action verb + target resource + explicit sibling differentiation ("unlike X, this tool does Y"). Zero tautological phrasing. Checked by local tests
2. Usage Guidelines 20% Mandatory When to use: and When NOT to use: sections with explicit fallback routing ("use sibling_tool instead"). Checked by local tests
3. Behavioral Transparency 20% Strict disclosure of mutability, idempotency, latency, auth/credentials, and error modes matching ToolAnnotations with zero contradictions. Checked by local tests
4. Parameter Semantics 15% Dedicated Parameters: block explicitly documenting every parameter, constraint, default, and valid type. Checked by local tests
5. Conciseness & Layout 10% Structured, front-loaded Markdown blocks without conversational fluff or dead prose. Checked by local tests
6. Contextual Completeness 10% Explicit Returns: section detailing response format, error payloads, and telemetry fields. Checked by local tests

Automated Verification Pipeline:

Every single tool is continuously audited in CI via:

# Local description convention test:
python -m unittest tests/test_tdqs_anchor5.py -v

# Full 52-tool audit runner:
python scripts/comprehensive_tdqs_audit.py

Hugging Face Spaces Live Web Application

Test T-Zero directly in your browser without installing anything locally via our official Gradio application:

Open in Hugging Face Spaces

Running the App Locally:

tzero space
# or: python huggingface-space/app.py (opens at http://localhost:7860)

Pre-Flight Reality-Lock (Static AST Verification & 0.0% Hallucination Proof)

AI coding assistants frequently hallucinate non-existent methods (e.g., math.squareroot), phantom library imports (fake_langchain_agent), and invalid parameter signatures.

T-Zero's ZeroHallucinationGuard statically validates candidate method calls, imports, schema fields, and signatures against the verified project AST symbol table, Python standard library, and dependency manifests:

# 1. Run Empirical 60-Scenario Proof Benchmark (0.0% Escape Rate):
tzero --prove-zero-hallucination

# 2. Test code snippet:
tzero --hallucination-check "import math; x = math.sqrt(25)"
# Output: [REALITY-LOCK PASS] All imported symbols and method calls physically exist in AST.

# 3. Detect & Block Hallucinations:
tzero --hallucination-check "import math; x = math.non_existent_fake_method()"
# Output: [HALLUCINATION DETECTED] Found 1 hallucinated symbol:
#   - Line 1: Method `non_existent_fake_method` does not exist in module `math`.

# 4. Self-Healing AST Auto-Corrector:
tzero --fix "import math; x = math.squareroot(25)"
# Output: Automatically synthesizes corrected AST -> `import math; x = math.sqrt(25)`

📄 Formal Proof & Whitepaper: Read the full mathematical proof and 60-scenario empirical benchmark results in docs/ZERO_HALLUCINATION_PROOF.md. Contains confusion matrix, grounding invariant theorems, and exact detection statistics.


Security Architecture: Deterministic Secret Scanner

OS-Native Credential Storage:

T-Zero uses platform-native secret vaults:

  • Windows: Windows Credential Manager
  • macOS: macOS Keychain
  • Linux: Secret Service API / libsecret

High-Entropy Secret Scanner ($H \ge 4.75$):

  • Analyzes candidate strings using Shannon entropy: $$H(X) = -\sum_{i=1}^{n} P(x_i) \log_2 P(x_i)$$
  • Strings with entropy $H \ge 4.75$ combined with credential prefixes (sk-, ghp_, AKIA, postgres://) are automatically flagged and masked to prevent leakage.
  • Dependency checks: If a Python dependency is missing, T-Zero prints an installation command for the user to review and run.
  • Local analysis: Code parsing, AST pruning, and lexical search process workspace files on the machine running T-Zero. See Privacy and network behavior for setup, AI, and other network-enabled operations.

Token counts and cost estimates

The older multi-model pricing table used historical rates and extrapolated a token count from one workload. It has been removed from this README. To estimate costs for your setup, compare the input tokens reported by your provider for the same task and apply its current pricing and cache rules. See the paired benchmark above for the measured example.


Global Ecosystem & Multilingual Architecture

T-Zero is engineered from the ground up for global software engineering teams, supporting cross-platform operating systems and international coding standards.

Dedicated Language Guides

  • English (Primary & Canonical): You are viewing the official English reference documentation.
  • Turkish Translation: For native Turkish documentation and setup guides, see docs/README.tr.md.

30-Second Turnkey Quickstart

# 1. Install via PyPI:
pip install tzero-mcp

# 2. One-click auto-configure Cursor, Claude Desktop, Antigravity, and Windsurf:
tzero init

# 3. Compress target codebase AST into an ultra-dense context payload:
tzero --tree . --out context.txt

# 4. Launch local Zero-GPU Web Studio:
tzero space

# 5. Run Local CI & Pre-Push Verification Shield ($0 Actions quota burn):
tzero local-ci --quick

# 6. Install automated git pre-push shield:
tzero local-ci --install-hook

T-Zero Local CI & Pre-Push Verification Shield ($0 Quota Burn)

Stop burning GitHub Actions runner minutes and waiting minutes for remote build results. T-Zero Local CI executes a complete 7-gate verification pipeline locally in <10 seconds before code ever reaches remote repositories:

┌────────────────────────────────────────────────────────────────────────┐
│  ⚡ T-ZERO LOCAL CI & PRE-PUSH VERIFICATION RUNNER                     │
│  Local AST Analysis and Token Estimates                                │
└────────────────────────────────────────────────────────────────────────┘

  [1/7] Metadata & Version Sync ................ [PASS] (0.48s)
  [2/7] 100% Zero-Leak Security Audit .......... [PASS] (0.39s)
  [3/7] AST & Architecture Boundaries .......... [PASS] (1.88s)
  [4/7] Static Code Quality & Lint ............. [PASS] (3.64s)
  [5/7] Automated Unit Test Suite .............. [PASS] (2.01s)
  [6/7] Ecosystem & Extension Tests ............ [PASS] (0.46s)
  [7/7] M8ven MCP Compliance ................... [PASS] (0.00s)

════════════════════════════════════════════════════════════════════════
✔ ALL LOCAL CI GATES PASSED! Safe to push to remote.
  ⚡ Remote CI minutes saved: ~15.0 minutes (Execution took 8.86s)
════════════════════════════════════════════════════════════════════════

CLI & Standalone Executable Usage

# Run fast verification battery (seconds):
tzero local-ci --quick
# or via dedicated binary:
tzero-ci --quick
dist/TZeroCI.exe --quick

# Run full matrix verification battery:
tzero local-ci --all

# Auto-repair metadata mismatches:
tzero local-ci --fix

# Install automated Git pre-push hook (intercepts 'git push' locally):
tzero local-ci --install-hook
# (To uninstall: tzero local-ci --uninstall-hook)

T-Zero PC-Fixer & Codebase Doctor: The 12,600+ Line Autonomous Self-Healing Monolith

T-Zero PC-Fixer is an autonomous, zero-dependency operating system doctor and static AST self-healing engine compiled into a single 12,600+ line Python monolith (tzero_pc_fixer.py). It diagnoses and surgically cures broken developer workstations, memory leaks, orphaned zombie processes, contaminated environments, and static codebase defects with $0.00 cloud cost.

1-Click Zero-Dependency Installers

Windows (PowerShell 5.1+ / 7+):

irm https://raw.githubusercontent.com/toprakahmetaydogmus/tzero-pc-fixer/main/install.ps1 | iex

macOS / Linux (Bash):

curl -fsSL https://raw.githubusercontent.com/toprakahmetaydogmus/tzero-pc-fixer/main/install.sh | bash

Autonomous Healing Capabilities:

  • 🖥️ Hardware & Process Surgeon: Hunts runaway compiler/Node.js zombie processes, clears swap memory, verifies disk partition health, and unblocks port collisions (e.g. 8000, 3000, 5000, 8080).
  • 🐍 Python & Virtual Environment Doctor: Detects broken symlinks, repairing contaminated sys.path, corrupted wheel caches, and Microsoft Store Python PATH hijacking.
  • 🛡️ CWE-78 & CWE-327 Static AST Remediator: Rewrites dangerous subprocess.Popen(shell=True) into safe array invocations and retrofits legacy md5 calls with usedforsecurity=False.
  • ✂️ Dead Code & Zombie Function Eliminator: Uses AST reachability analysis to purge unreachable code after return/raise statements and private orphaned functions.
  • ⚡ Async/IO Event Loop Modernizer: Detects blocking time.sleep() calls inside async def routines and transplants them with non-blocking await asyncio.sleep().

What's New in v12.3.0: 180-Tier Ultra Anti-REA Armor Suite & Authenticated Bytecode Envelopes

T-Zero v12.3.0 expands Anti-REA (Reverse Engineering Agent) Armor to 180 Tiers across 12 Security Domains (15 verified enforcement layers per domain), stopping automated AI code extractors, decompilers (pyinstxtractor, uncompyle6, pycdc), debugger hooks (x64dbg, IDA Pro), and cognitive jailbreaks while preserving 100% native application behavior:

  • HKDF-SHA256 + CTR + HMAC Authenticated Bytecode Envelope (CryptoBytecodeEnvelope): Seals user application logic in authenticated compressed marshal capsules with zero-regression support for classes, @dataclass, async/await, generators, UTF-8, and sys.argv, wiping decrypted RAM buffers immediately after load.
  • Multi-Cave PyInstaller ExtractorShield & PE Metadata Scrubbing: Combines up to 4 PE section alignment cave decoy MEI headers with MSVC Rich/DanS header zeroization and COFF TimeDateStamp scrubbing while keeping native C bootloader execution intact.
  • Zero-Subprocess Ring-3 & POSIX Anti-Debug Matrix: Native Win32 CreateToolhelp32Snapshot (<2ms, zero subprocess), IsDebuggerPresent, NtSetInformationThread(0x11), sys.gettrace/sys.monitoring debugger lockouts, Linux TracerPid, Anti-VM hypervisor guards, and RDTSC nanosecond stepping checkpoints.
  • Type-Safe MBA & PolyVM Stack Obfuscator: Strict integer-guarded Mixed Boolean-Arithmetic identities (zero string/float TypeError risk) + per-build randomized opcode VMs + In-Flight String Vault (memset(0)).
  • Tamper Alert Webhook (Opt-In Only): Disabled by default (webhook_canary: false). When explicitly configured with a webhook URL, dispatches tamper notification payloads containing only threat_type, detected_tool, timestamp, platform, os_name, python_version, pid, and hostname[:16] (no source code or secrets are ever transmitted).
  • Built-in CLI, Matrix & GUI: Run tzero armor, tzero audit-rea, tzero shield-exe, python -m tzero.anti_rea.cli matrix, or launch tzero-gui.
  • Static Verification & Packaging Notice: Use tzero audit-rea for static textual indicator + 180-Tier domain coverage scores; official Windows ZIP and VS Code .vsix bundles include both LICENSE and NOTICE.

What's New in v12.0.0: Turbo Rust Hybrid Core & Multi-Language Tree-Sitter

T-Zero runs on a high-performance dual-engine hybrid architecture:

  • Native Rust Core (crates/tzero_core): Zero-copy Tree-sitter AST pruning for Python, TypeScript, Rust, and Go; sub-millisecond BPE token counting with tiktoken-rs (>940,000 tokens/sec); and bitwise Shannon entropy secret scanning ($H \ge 4.75$ in <4.4ms).
  • Zero-Fail Pure-Python Fallback: When native .pyd / .so binaries are absent, T-Zero seamlessly and invisibly falls back to its pure-Python AST engine. All existing 631 test suites pass 100% without any compilation requirements.

AI Agent Ingestion & Machine-Readable Grounding

If a developer asks an AI agent to "inspect this repository", "summarize T-Zero", or "how to use this":

Executive TL;DR for LLMs: T-Zero is a 100% free, local-first AST codebase context compressor & MCP server for Cursor, Claude, Windsurf & Copilot. It summarizes code into interface skeletons, with token savings that vary by workload, provides 21 canonical MCP tools, includes local secret scanning (entropy H>=4.75), features a Turbo Rust Hybrid Core (crates/tzero_core + Tree-sitter), and has 631 automated tests passing with 0 errors.


Support Open-Source Innovation: Keep T-Zero 100% Free

Hi! I'm Toprak Ahmet Aydoğmuş from Siber Akademi. I built T-Zero from scratch to solve context window bloat, token bills, and AI hallucinations for developers worldwide with local analysis tools.

T-Zero has no venture capital backing, no paywalls, and no telemetry tracking. If T-Zero helped you cut prompt tokens or saved your daily coding workflow in Cursor, Claude Code, or Windsurf, please consider supporting the project to keep it free and independent:

  • ⭐ Star the Repository: Every GitHub star helps independent open-source developers discover T-Zero.
  • 🪙 1-Click Crypto Donations (Direct Sustenance & Wallet Deep Links):
Network / Asset Address 1-Click Send Link (Deep Link) Explorer / Info
🔷 Ethereum / EVM
(ETH, ERC-20, Polygon, Arbitrum, BSC, Optimism)
0xF36Cd453f9F2bE91647C006C46ff66fB41d9F0c5 ⚡ Send via Web3 Wallet (EIP-681) 🔍 Etherscan • DeBank
🟠 Bitcoin (BTC)
(Native SegWit bech32)
bc1q9k4hvd6c2g8l9w3z7v8f2k3j5l8n9m1p4q7r0s ⚡ Send via Bitcoin Wallet (BIP-21) 🔍 Mempool Explorer
🟢 USDT (TRC-20)
(Tron Network)
TE7uKxZJ414u938gWf6bYh9QvRk2141517 ⚡ Send via Tron Wallet 🔍 Tronscan
🌐 Web3 Support Hub T-Zero Interactive Portal 🌐 tzero-indol.vercel.app/#support Direct interactive crypto & QR hub
💖 GitHub Sponsors Direct GitHub Sponsorship 💖 Sponsor on GitHub Recurring or one-time
🌐 Creator Hub Toprak Ahmet Aydoğmuş (Siber Akademi) 🌐 hopp.bio/siberegitim Direct developer hub & profiles
📱 Click to view 1-Click QR Codes (Ethereum, Bitcoin, Tron)
🔷 Ethereum / EVM 🟠 Bitcoin (BTC) 🟢 USDT (TRC-20 Tron)
Ethereum QR Code

⚡ Send (EIP-681)
Bitcoin QR Code

⚡ Send (BIP-21)
Tron QR Code

⚡ Send (Tron)
0xF36Cd453f9F2bE91647C006C46ff66fB41d9F0c5 bc1q9k4hvd6c2g8l9w3z7v8f2k3j5l8n9m1p4q7r0s TE7uKxZJ414u938gWf6bYh9QvRk2141517

💡 100% of community contributions directly sustain CI/CD matrix runners, PyPI/npm automated releases, benchmark hosting, and support open-source maintenance.


1-Click Community Share Hub

Help us reach our 500 Stars Milestone! Share T-Zero with your network in one click:

Share on X Post to Reddit Share on LinkedIn Submit to Hacker News Star on GitHub


T-Zero is open source under AGPL-3.0-only. Built with passion by Toprak Ahmet Aydoğmuş (Siber Akademi) for developers worldwide.


Directory Listings

T-Zero on Product Hunt T-Zero on VibeShelf T-Zero on Submit AI Tools T-Zero on TensorBlock MCP Index T-Zero on Glama MCP


Star History

Join the revolution in context engineering and deterministic token pruning!


License & Siber Akademi

The upstream repository records the project's original authorship and release history. When distributing T-Zero code covered by the Section 7 terms, preserve the copyright and author attribution in NOTICE and clearly identify modified versions. Section 13 requires operators of modified versions that support remote network interaction to offer their remote users the corresponding source at no charge.

The last main-branch snapshot before the AGPL transition was published under MIT. The license supplied with each earlier release continues to apply to that release.

About

Deterministic AST Context Compressor & MCP Server for Cursor, Claude & Local LLMs. Cuts prompt tokens by 85–95% with 100% Zero-Leak security.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

128 stars

Watchers

1 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages