Tokenectomy Razor

io.github.Tokenectomy-Labs由 GitHub 帳號 Tokenectomy-Labs 發布v1.3.3更新於 Oct 24, 2026

Cut 95% of framework noise and token bloat from error logs for AI agents.

概覽

AI 產生的概覽

在本機執行的 Rust MCP 伺服器兼 AI 閘道,可剔除錯誤日誌中的框架雜訊、遮蔽外洩的憑證,並分析或修補程式碼。

可以做什麼
處理錯誤日誌:對錯誤傾印做堆疊精簡,移除框架雜訊、遮蔽憑證並擷取相關的本機原始碼脈絡;稽核日誌或提示詞中的 token 膨脹與金鑰,回傳節省指標和健康評級。分析程式碼:以靜態 AST 檢查資源洩漏、未關閉的控制代碼和語法問題。修改檔案:套用原子修補,寫入後做語法驗證,失敗時自動回滾。聯網檢索:用遮蔽後的錯誤特徵查詢 Stack Exchange。
適用情境
適合在大型框架堆疊(Node、Python、Rust、Java 等)當機除錯時使用,讓助理只看到相關堆疊影格且不含金鑰,再提出修正建議。也適合需要助理分析程式碼並套用經驗證修補的工作流程。
執行需求
以 stdio 本機程序執行,通常透過 npx(需 Node.js)啟動,也可用 Cargo、預編譯二進位檔或 Docker 安裝。未宣告 API 金鑰或環境變數。選用的閘道模式會綁定本機連接埠並轉送到 Anthropic、OpenAI、Groq 或 Ollama 等上游。Stack Exchange 檢索工具需要對外網路存取,可用僅本機模式關閉。
安裝前請注意
apply_code_patch 工具會寫入工作區檔案,雖有語法驗證和失敗回滾。Stack Exchange 檢索工具會把遮蔽後的錯誤文字傳送到外部 API,隔離環境應關閉。閘道模式會把提示詞轉送給第三方模型供應商,並可綁定到遠端位址、要求 bearer token。遮蔽採樣式比對,應視為防護措施而非絕對保證。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Tokenectomy Razor,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

[Tokenectomy Razor Logo]

Tokenectomy Razor

Fix Claude Code & Cursor Rate Limits: Zero-Latency Local AI Gateway & Context-Surgery MCP Server in Rust

Stop burning 20,000 tokens on node_modules stack traces. Tokenectomy Razor is a sub-millisecond local AI Gateway reverse proxy (127.0.0.1:8080) & companion MCP server written in safe Rust. Excises 41.7%–99.7% framework noise from terminal error logs, redacts leaked DB credentials/JWTs, and caches prompts for free.

[Official MCP Registry] [crates.io] [npm] [OpenSSF Scorecard] [OpenSSF Best Practices] [CI] [License]

Quick Start (10s) • Architecture • The Problem • Before & After • Live Interactive Demo • Benchmarks


                                 ┌────────────────────────────────────────────────────────┐                                 │                   Autonomous Agents                    │                                 │  Claude Code • Cursor • Antigravity • Cline • Windsurf │                                 └───────────────────────────┬────────────────────────────┘                                                             │                                                             ▼ (HTTP / SSE Outbound Prompts)   ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐   │                                 ⚡ TOKENECTOMY AI GATEWAY (127.0.0.1:8080)                                       │   │                                                                                                                  │   │  ┌─────────────────────────┐   ┌───────────────────────────┐   ┌──────────────────────────────────────────────┐  │   │  │   Zero-Cost Prompt      │   │   Zero-Leak Credential    │   │         Polyglot Trace Surgery               │  │   │  │         Cache           │   │         Redaction         │   │            (9 Languages)                     │  │   │  │  <1ms Hit • 100% Free   │   │  API Keys • JWTs • DB URIs│   │  node_modules • site-packages • .cargo       │  │   │  └───────────┬─────────────┘   └─────────────┬─────────────┘   └──────────────────────┬───────────────────────┘  │   │              │                               │                                        │                          │   │              └───────────────────────────────┼────────────────────────────────────────┘                          │   │                                              ▼                                                                   │   │                                 Smart Upstream Auto-Router                                                       │   │                         (Anthropic • OpenAI • Groq • Ollama Local)                                               │   └──────────────────────────────────────────────┬───────────────────────────────────────────────────────────────────┘                                                  │                 ┌────────────────────────────────┼────────────────────────────────┐                 ▼                                ▼                                ▼       api.anthropic.com                  api.openai.com                   localhost:11434    (Claude 3.5 / 3.7 Sonnet)         (GPT-4o / o1 / o3-mini)              (DeepSeek / Llama)

⚡ Quick Start (10s)

0. Zero-Config One-Liner Wrapper (wrap)

Run any coding agent or test suite directly behind Tokenectomy's privacy & caching gateway with zero manual environment variable setup:

bash
# Wrap Claude Code CLIrazor wrap -- claude
# Wrap Aider with DeepSeek or Ollama (Auto-Transpiled on the fly!)razor wrap -- aider --model deepseek/deepseek-chat
# Wrap test runs to scrub logs and prevent accidental credential leakagerazor wrap npm test

1. Launch the Standalone AI Gateway (Manual Mode)

bash
npx -y tokenectomy-razor --proxy

💡 Smart Multi-Provider Auto-Routing & Universal LLM Transpiler ON by default! Tokenectomy automatically analyzes request paths and headers. Need to run Claude Code against DeepSeek or Ollama? Tokenectomy transparently transpiles Anthropic /v1/messages format into OpenAI /v1/chat/completions on-the-fly and vice-versa.

2. Connect Your Favorite Agent

Point your coding agent or CLI to the local gateway on 127.0.0.1:8080:

Agent / EnvironmentSetup Command or ConfigurationAuto-Routed Upstream
Claude Codeexport ANTHROPIC_BASE_URL="http://127.0.0.1:8080"https://api.anthropic.com
CursorModels > OpenAI Base URL: http://127.0.0.1:8080/v1https://api.openai.com
Google Antigravity / Geminiexport OPENAI_BASE_URL="http://127.0.0.1:8080/v1"https://api.openai.com
Cline / Roo CodeProvider: OpenAI Compatible • Base URL: http://127.0.0.1:8080/v1https://api.openai.com
Ollama / Local LLMsBase URL: http://127.0.0.1:8080http://localhost:11434

3. Real-Time FinOps & Security Dashboard

Open http://127.0.0.1:8080/dashboard in your browser to observe live token reductions, prompt cache hits, dollar savings, and redacted credentials in real time.


4. Companion MCP Server Setup (Sub-Cortex)

For agents calling deep diagnostic tools (get_error_context, analyze_code, apply_code_patch):

Claude Code CLI
bash
claude mcp add tokenectomy npx -y tokenectomy-razor --mcp
Google Antigravity / Gemini CLI
bash
agy mcp add tokenectomy-razor -- npx -y tokenectomy-razor --mcp
Cursor Composer (.cursor/mcp.json)
json
{  "mcpServers": {    "tokenectomy": {      "command": "npx",      "args": ["-y", "tokenectomy-razor", "--mcp"]    }  }}
Claude Desktop (claude_desktop_config.json)
json
{  "mcpServers": {    "tokenectomy": {      "command": "npx",      "args": ["-y", "tokenectomy-razor", "--mcp"]    }  }}

5. Terminal Piping & CLI Scrubbing

bash
npm test 2>&1 | npx tokenectomy-razor

🛑 The Problem: Why Your AI Hits Rate Limits & Hallucinates

When your app crashes during development (Next.js, Express, FastAPI, Tokio), the runtime dumps hundreds of lines of third-party plumbing from node_modules or site-packages.

When you paste that raw crash dump into Cursor or Claude:

  1. Eats Your 5-Hour Rate Limit: A single Express/Prisma error can dump 5,000 to 45,000 tokens of third-party library code you never wrote. A few crash loops easily burn your session limit.
  2. Triggers AI Hallucinations: Claude gets lost in framework internals (node_modules/express/lib/router/layer.js or starlette/routing.py) and tries to edit library files instead of your actual application code.
  3. Leaks Secrets & Credentials: Connection strings with raw database passwords, JWT bearer tokens, and cloud keys embedded in error traces get forwarded to external model servers.
Raw Terminal Crash (45,820 tokens + Leaked Secrets)     │     ▼  <0.2ms Local Rust DFA Engine[Redact Passwords & Keys] ──► [Strip Third-Party Framework Frames] ──► [Isolate Root Cause]     │     ▼Clean Context (118 tokens • Zero Secrets • Sub-millisecond)

🔍 Before & After Comparison

❌ Without Tokenectomy: AI Hallucinates & Burns Context

text
TypeError: Cannot read properties of undefined (reading 'token')    at loadComponents (/app/node_modules/next/dist/server/load-components.js:14:2)    at renderToHTML (/app/node_modules/next/dist/server/render.js:50:5)    at nextServer (/app/node_modules/next/dist/server/next-server.js:80:12)    at processTicksAndRejections (node:internal/process/task_queues:95:5)    at runMicrotasks (node:internal/process/task_queues:120:3)    at checkoutHandler (/app/pages/api/checkout.ts:42:15)Database connection failed: postgresql://admin:[email protected]:5432/primaryAPI key leaked: sk-ant-api03-abcdef1234567890abcdef1234567890

What Claude does: Analyzes load-components.js and next-server.js, speculates on Webpack / Next.js internals, and leaks connection credentials to remote inference logs.

✅ With Tokenectomy: Clean Context & Instant Fix

text
// [Tokenectomy Surgery: 5 internal framework frames pruned (83.3%)]// Source: /app/pages/api/checkout.ts:42:1542 |   const sessionToken = req.headers.authorization.token;   |                                                  ^ TypeError: Cannot read properties of undefined (reading 'token')🛡️ [CONNECTION_STRING_REDACTED]🛡️ [ANTHROPIC_KEY_REDACTED]

What Claude does: Instantly identifies that line 42 in checkout.ts attempted to access .token on undefined headers. Suggests optional chaining req.headers.authorization?.token immediately. Credentials redacted before transmission.


🔬 Verifiable Benchmarks

All performance claims are hardware-grounded and independently reproducible on physical hardware (measured on 10-Core Intel Core i5-1235U @ 15W running Arch Linux, Kernel 6.13):

Hardware Dependency Notice: Performance is hardware-dependent; reported throughput represents measured results on the specified test hardware (10-Core Intel Core i5-1235U @ 15W TDP). Throughput scales with higher TDP desktop/server CPUs and faster memory buses. Developers are encouraged to independently audit performance using the reproduction command below.

📋 Click to expand full raw benchmark terminal log ($ cargo test --release)
text
$ cargo test --release --test stress_benchmark -- --nocapture
=====================================================================================🧪 TOKENECTOMY OSS VERIFIABLE HEAVY STRESS BENCHMARK (100% REPRODUCIBLE IN OSS)   Hardware: 10-Core / 12-Thread Intel Core i5-1235U | OS: Arch Linux | Kernel Telemetry Active   Initial Baseline Process Memory (VmRSS): 3.45 MB=====================================================================================
🔥 [TEST 1/3] QUARTER-MILLION LINES LOG REDACTION TORTURE (250,000 LINES / 25MB+ BUFFER)  ├── Buffer Size: 24.44 MB (250000 lines)  ├── Redaction Latency: 471.05ms (51.9 MB/sec)  ├── Line Throughput: 530,735 lines/sec  ├── Peak Memory (VmRSS): 76.05 MB (Delta: +72.60 MB)  └── Status: ✅ PASSED (100% of 250,000 lines sanitized, zero memory balloon)
🔥 [TEST 2/3] REDOS CATASTROPHIC BACKTRACKING TORTURE (50,000 CHARS PAYLOAD)  ├── Attack Payload Size: 50,082 characters  ├── Execution Latency: 1.165 ms  └── Status: ✅ PASSED (Linear O(N) evaluation, ReDoS-resistant on tested payloads)
🔥 [TEST 3/3] HIGH-CONCURRENCY TORTURE (100 PARALLEL OS THREADS)  ├── Thread Concurrency: 100 concurrent OS threads  ├── Successful Operations: 100/100 (100.0%)  ├── Total Elapsed: 11.31ms  ├── Concurrency Throughput: 17,688 ops/sec  ├── Final VmRSS: 78.99 MB  └── Status: ✅ PASSED (Zero race condition, zero deadlock)
=====================================================================================🏆 TOKENECTOMY OSS STRESS BENCHMARK: 3/3 PASSED (100% GREEN)   Total Suite Duration: 580.83ms   Bounded Final VmRSS: 78.99 MB=====================================================================================test test_oss_heavy_stress_benchmark ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.58s
Benchmark TargetWorkload Under TestVerified MeasurementResult
Log Redaction Throughput250,000 lines (24.44 MB) enterprise dump with API keys & connection URIs530,735 lines/sec (471.0 ms, 51.9 MB/s)Pass
ReDoS Resilience50,000-character pathological backtracking regex payload1.16 ms (Deterministic Linear $O(N)$ DFA Evaluation)Pass
Thread Concurrency100 concurrent OS threads executing simultaneous redaction17,688 ops/sec (100/100 completed in 11.31 ms)Pass
Memory FootprintPeak Resident Memory during 250k-line continuous stress test76.05 MB VmRSS via /proc/self/status (~3× input buffer size)Pass
Release Test SuiteFull integration test matrix across extractors, filters, and analyzers90 / 90 Verified Green (Zero panics, zero leaks)Pass

🛡️ Automated Redaction & Secret Sanitization Benchmark

Evaluated across an internal benchmark test fixture (tests/fixtures/) of 12 polyglot crash traces (Rust, Python, TypeScript, Go, YAML) containing 22 ground-truth credentials and clean negative controls. Evaluated head-to-head against Gitleaks v8.30.1 (default ruleset).

Architectural Note: Gitleaks is designed primarily as a repository commit/diff scanner, not an in-memory runtime trace redactor. Tokenectomy Razor is engineered specifically for runtime stream sanitization and stack trace surgery.

1. Per-Category Precision, Recall & F1-Score
Secret CategoryGround TruthRazor RecallRazor F1Gitleaks RecallGitleaks F1Sanitization Advantage
Anthropic Claude API Key (sk-ant-...)1100.0%100.0%0.0%0.0%+100% Recall (M2M zero-leak)
AWS Access Key ID (AKIA...)1100.0%100.0%0.0%0.0%+100% Recall (M2M zero-leak)
AWS Secret Access Key1100.0%100.0%0.0%0.0%+100% Recall (M2M zero-leak)
Database URI (PostgreSQL, MySQL, Redis, Mongo)4100.0%100.0%0.0%0.0%+100% Recall (M2M zero-leak)
Generic Passwords / Auth Secrets (YAML/JSON)3100.0%100.0%0.0%0.0%+100% Recall (M2M zero-leak)
GitHub Personal Access Token (ghp_...)1100.0%100.0%0.0%0.0%+100% Recall (M2M zero-leak)
GitLab Personal Access Token (glpat-...)1100.0%100.0%100.0%100.0%Parity (100% caught)
HuggingFace API Token (hf_...)1100.0%100.0%0.0%0.0%+100% Recall (M2M zero-leak)
JSON Web Token (RFC 7519 / Truncated)2100.0%100.0%100.0%100.0%Parity (100% caught)
npm Registry Access Token (npm_...)1100.0%100.0%0.0%0.0%+100% Recall (M2M zero-leak)
OpenAI API Key (sk-..., sk-proj-...)1100.0%100.0%100.0%100.0%Parity (100% caught)
PEM Private RSA Key Block1100.0%100.0%100.0%100.0%Parity (100% caught)
PyPI Package Upload Token (pypi-AgEI...)1100.0%100.0%100.0%100.0%Parity (100% caught)
SendGrid API Key (SG...)1100.0%100.0%0.0%0.0%+100% Recall (M2M zero-leak)
Slack Bot/User Token (xoxb-...)1100.0%100.0%100.0%100.0%Parity (100% caught)
Stripe Live/Test Secret Key (sk_live_...)1100.0%100.0%100.0%100.0%Parity (100% caught)
2. Head-to-Head Performance & Architectural Summary
DimensionTokenectomy Razor (--scrub)Gitleaks v8.30.1Architectural Rationale
Overall Secret Recall100.0% (22/22)36.4% (8/22)Razor captures unquoted URIs, DB ports & AI keys missed by diff rules
Overall Precision100.0% (0 False Positives)88.9%Zero false triggers on compiler errors & minified traces
Overall F1-Score100.0% (internal fixture)51.6%Comprehensive coverage engineered specifically for crash context
Execution EngineHigh-throughput Rust DFA ($O(N)$)Go regex scanner + Git tree crawlerSub-millisecond latency for agent streaming backtraces
ReDoS ResilienceDeterministic Linear Time ($O(N)$)Engine dependentNon-backtracking DFA regex prevents catastrophic backtracking on tested dumps
Sanitization ActionInline token redaction ([KEY_REDACTED])Warning log only (No scrub)Directly sanitizes text before ingestion by LLM cortex
3. Token Reduction & LLM Context Savings (tiktoken cl100k_base)
MetricMeasured ValueOperational Impact for AI Coding Agents
Mean Token Reduction41.67%Consistently shrinks raw crash trace token footprint
Median Reduction (P50)42.95%Typical credential and connection dump reduction
90th Percentile (P90)61.42%Eliminates long multi-line keys and credentials
Min / Max Spread0.00% — 81.36%0% on clean negative controls (zero distortion), up to 81.4% on leaks
Total Tokens Preserved / Saved920 tokens (44.02% net)Prevents context window saturation and reduces LLM billing

🔌 Advanced Agent & Gateway Configuration

1. Multi-Provider AI Gateway Options (--proxy)

Tokenectomy's gateway runs locally on 127.0.0.1:8080 with zero manual configuration. In complex development environments or containerized agent topologies, you can customize binding and routing:

bash
# Default Smart Auto-Routing (routes Anthropic, OpenAI, and Ollama requests dynamically):razor --proxy
# Safety Circuit Breaker: Prevent runaway agent loops from burning your hourly budget or 5-hour window:razor --proxy --max-hourly-tokens 200000
# Resilient 429 Auto-Retry: Automatically pause and retry when hitting upstream rate limits (default: on):razor --proxy --max-retries 5
# Explicit upstream override (e.g. Groq, vLLM, or OpenRouter):razor --proxy --upstream-url https://api.groq.com/openai/v1
# Secure remote container binding with mandatory bearer token:razor --proxy --proxy-bind 0.0.0.0:8080 --allow-remote --proxy-token "$MY_GATEWAY_TOKEN"
Real-Time Metrics & Prometheus Export

Tokenectomy exposes live FinOps and token economics data via JSON:

bash
curl http://127.0.0.1:8080/v1/metrics

Returns instant telemetry for rate_limits_mitigated, circuit_breaker_trips, last_latency_ms, current_hourly_tokens, cache_hits, cache_tokens_saved, and estimated_cost_saved_usd.


2. Standalone CLI & Terminal Scrubbing

When debugging or piping terminal test output directly:

bash
# Pipe terminal test failures through the surgical redactor:npm test 2>&1 | razor --scrub
# Sanitize a specific raw log file:razor --scrub --file /var/log/app/error.log > sanitized.log
# Offline local air-gapped mode (zero external network calls):cat failure.log | razor --scrub --local-only

🛠️ Exposed MCP Tools

Tokenectomy Razor complies with Glama Grade A Tool Definition Quality Score (TDQS) with explicit parameter boundaries:

Tool NameCapability Description
get_error_contextPerforms trace surgery on error dumps, removes framework noise, redacts credentials, and extracts relevant local source context bounded to the workspace.
analyze_codePerforms static AST code analysis to detect resource leaks, unclosed handles, and syntax vulnerabilities with bounded execution limits and precise LSP UTF-16 coordinates.
apply_code_patchApplies atomic file modifications with post-write language syntax verification (cargo check, py_compile, node --check) and automated rollback on failure.
search_stack_overflowQueries Stack Exchange API for relevant error signatures using sanitized, redacted search terms.
audit_context_healthAudits raw logs, traces, or prompt payloads for token bloat, framework noise, and credentials. Returns M2M telemetry, savings metrics, and context health grades.

🌐 Supported Polyglot Ecosystems

LanguageFrameworks SupportedExcluded Framework Internals
RustTokio, Actix-web, Axum.cargo/registry, .rustup, target/debug/build
TypeScript / JSNext.js, Express, NestJS, Vitenode_modules, .next, dist, webpack internals
PythonDjango, FastAPI, Flask, PyTorchsite-packages, dist-packages, venv, __pycache__
GolangGin, Fiber, Stdlib Panicsgo/src (stdlib), go/pkg/mod, vendor
Java / KotlinSpring Boot 3, Tomcat, Netty.m2/repository, .gradle/caches, internal bytecode
C / C++AddressSanitizer, GDB / LLDB/usr/include, /usr/lib, vcpkg_installed
C# (.NET)ASP.NET Core, .NET RuntimeSystem.Private.CoreLib, Microsoft.AspNetCore
Ruby on RailsRails, Sinatra, Bundler/gems/, ruby/gems, internal rack handlers
PHPLaravel, Symfonyvendor/composer, vendor/symfony

📦 Installation Options

Method 1: Instant via npx (Zero Toolchain Setup)

bash
npx -y tokenectomy-razor --mcp

Method 2: Cargo (crates.io)

bash
cargo install tokenectomy

Method 3: Precompiled Standalone Binaries

Zero-dependency, standalone release binaries available on GitHub Releases:

  • Linux: x86_64-unknown-linux-gnu, x86_64-unknown-linux-musl, aarch64-unknown-linux-gnu
  • macOS: aarch64-apple-darwin (Apple Silicon M1/M2/M3/M4), x86_64-apple-darwin (Intel)
  • Windows: x86_64-pc-windows-msvc.exe

Method 4: Multi-Arch Docker Container (GHCR)

bash
docker pull ghcr.io/tokenectomy-labs/razor:latestdocker run -i ghcr.io/tokenectomy-labs/razor:latest --mcp

⚖️ Edition Comparison

CapabilityRazor (Community OSS)Sentinel (Commercial Tier)
Polyglot Stack Trace SurgeryYes (9 Runtime Languages)Yes (All 9 Languages + Deep AST Semantic Healing)
O(N) ReDoS-Safe Secret RedactionYesYes
JSON-RPC 2.0 MCP ServerYesYes
AI Gateway Reverse Proxy (--proxy)YesYes
SHA-256 Idempotency Cache (24h TTL)YesYes
FinOps Metrics DashboardYesYes
Syntax Validation Rollback (Compilers / Linters)YesYes
Automated Test Suite Rollback (0 Dirty Diff)—Yes
Tree-sitter AST Syntax Healing—Yes
Anti-Hallucination Scope Guard—Yes
Multi-File Atomic Transactions—Yes
Time Machine Undo Engine (--undo)—Yes
Autonomous Healing State Machine—Yes

Need Enterprise AST Self-Healing? Explore the Sentinel Tier


🗺️ Roadmap & Milestones

Milestone / CapabilityStatusTarget
Core Polyglot Log Surgery & $O(N)$ ReDoS Redaction✅ Completev1.0.0
AI Gateway Reverse Proxy (--proxy) & Idempotency Cache✅ Completev1.1.0
Multi-arch Docker & GitHub Actions Marketplace Action✅ Completev1.1.3
Static AST Analysis Engine (analyze_code) & UTF-16 LSP✅ Completev1.1.5
Glama.ai Tool Definition Quality Score (TDQS Grade A)✅ Completev1.1.5
Precompiled Standalone Binaries (Linux, macOS, Windows)✅ Completev1.1.6
Official MCP Registry Listing (io.github.Tokenectomy-Labs/razor)✅ Completev1.1.7
mcpservers.org Directory Listing✅ Completev1.1.7
Java/Kotlin (Spring Boot 3) & C/C++ (ASan) Extractors✅ Completev1.2.0
C# (.NET) & Ruby on Rails Deep Stack Surgery✅ Completev1.2.2
User-defined custom redaction & noise rules (~/.tokenectomy.toml)✅ Completev1.2.2
Autonomous Context Health Audit (audit_context_health) & M2M Advisory✅ Completev1.2.2
Automated Redaction Benchmark & CI Gate✅ Completev1.2.2
Declarative Advisory M2M Control Plane ([:TOKENECTOMY:M2M_CONTROL_PLANE:v1.3.0])✅ Completev1.3.0
Interactive Multi-Strategy Budgeting (aggressive, conservative, lossless_compact)✅ Completev1.2.3
GitHub Actions OIDC Official Registry Publishing Gate✅ Completev1.2.3
awesome-mcp-servers Community Catalog Listing✅ Completev1.2.4
Inline Dropped Frame Identities ([DROPPED_FRAMES: ...]) & Anti-Silent Truncation Audit✅ Completev1.3.1
Content-Addressable Raw Log Cache & Verification Hash (--diff-verify)✅ Completev1.3.1
Smart Multi-Provider Auto-Routing (Anthropic, OpenAI, Ollama) & Zero-Cost Prompt Caching✅ Completev1.3.3
Agent Safety Circuit Breaker (--max-hourly-tokens), 429 Auto-Retry Mitigator & CORS Preflight✅ Completev1.3.3
Universal LLM Format Transpiler (OpenAI /v1/chat/completions ⇄ Anthropic /v1/messages)✅ Completev1.3.4
Zero-Config Agent Command Wrapper (razor wrap -- <cmd>) & Git Pre-commit Hook✅ Completev1.3.4
Multi-Provider High-Availability & Automatic Outage Fallback📋 Plannedv1.4.0
Declarative AI Gateway Configuration (gateway.toml / tokenectomy.yaml)📋 Plannedv1.4.0
Full SSE Streaming Token Caching Engine📋 Plannedv1.4.0
Native VS Code & JetBrains companion extensions📋 Plannedv1.4.0
Server-Sent Events (SSE) remote MCP transport📋 Plannedv1.4.0

🔒 Security & Invariants

  • Local Execution by Default: All stack trace parsing, frame pruning, and secret redaction execute locally on physical hardware.
  • Documented Network Egress: In MCP server mode, search_stack_overflow is the sole tool with outbound network egress (HTTPS to api.stackexchange.com). The payload is strictly limited to sanitized, redacted error signature text (no code lines, no local paths, zero credentials). In air-gapped environments, use --local-only to disable network search entirely.
  • Deterministic Linear-Time Pattern Matching: All pattern matchers utilize non-backtracking DFA regex engines ($O(N)$ linear time) and Aho-Corasick automaton evaluation.
  • Path Traversal Boundary Isolation: File operations are strictly locked within the active workspace root (CWD). Path traversals (../) and unauthorized symlinks are blocked.
  • Safe Rust Implementation: Core execution paths enforce safe Rust memory guarantees with bounded stream readers (.take()) preventing resource exhaustion.

For vulnerability disclosures, please review our Security Policy.


⚖️ Legal & Downstream Fork Disclaimer

Tokenectomy Razor is provided strictly for lawful developer productivity, observability, log surgery, and defensive credential redaction. Any downstream forks, clones, redistributions, or private deployments operate completely independently of the original authors. Tokenectomy Labs and its maintainers assume zero liability for unlawful, malicious, or unauthorized actions committed by third parties using this codebase or derivatives thereof. All downstream operators bear 100% individual responsibility for compliance with local and international cybersecurity laws. See DISCLAIMER.md for full legal terms.

❓ Frequently Asked Questions (FAQ)

How does Tokenectomy Razor prevent Claude Code & Cursor from hitting rate limits?

When tests or terminal builds crash, frameworks like Next.js, Express, Jest, and Django dump thousands of internal stack frames (node_modules, site-packages). Sending raw 5,000-line crash logs consumes 15,000 to 45,000 tokens per prompt, draining your 5-hour session limit in minutes. Tokenectomy Razor intercepts logs and strips 95% of non-actionable framework plumbing, reducing a 40,000-character crash log to under 200 essential tokens in <0.2ms.

How do I stop Cursor from sending node_modules error logs to LLMs?

Run Tokenectomy Razor as a local AI Gateway reverse proxy (npx -y tokenectomy-razor --proxy). In Cursor settings, point your OpenAI Base URL to http://127.0.0.1:8080/v1. Any terminal error output pasted or referenced by Composer will be automatically sanitized, scrubbed, and cached on the fly before reaching model servers.

How does Tokenectomy prevent credential leakage in error logs?

All log surgery and secret redaction execute 100% locally on your machine in memory before outbound transmission. Razor uses deterministic linear-time regex and Aho-Corasick automata to detect and redact PostgreSQL/MongoDB connection URIs, JWT bearer tokens, and cloud API keys with [REDACTED] tokens. Zero cloud egress is required for scrubbing.


🤝 Community & Resources


Tokenectomy Labs • Autonomous M2M Sub-Cortex

Engineered with precision by Daffa (@daffa2555)

Licensed under the MIT License

來源:README.md,提交 29ff8de

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

3
  1. v1.3.3最新Sep 19, 2026
  2. v1.3.2Sep 18, 2026
  3. v1.3.1Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分