Skip to main content

Aggressive Claude context optimizer by Xtream-ITSolutions UG - Cut costs by 50-95%

Project description

Xtream-ITSolutions UG

⚡ xithead

Claude Context Optimizer — bis zu 95% Token-Einsparung, automatisch

PyPI npm Discord Apache 2.0

🌐 xtream-itsolutions.com · 💬 Discord · 🐛 Bug melden


Was ist xithead?

xithead ist ein lokaler Proxy von Xtream-ITSolutions UG, der sich zwischen Claude Code und die Anthropic API setzt. Er komprimiert Kontext aggressiv, cached Antworten und dedupliziert identische Requests — vollautomatisch, ohne Code-Änderungen.

Claude Code  ──►  xithead Proxy :8787  ──►  Anthropic API
                  │ Cache-Control
                  │ Context-Trim
                  │ Request-Dedup
                  └ Live Dashboard

Ergebnis: 50–95% weniger Token-Verbrauch, gleiche Qualität.


Installation

Windows (empfohlen — ein Befehl, alles automatisch)

iex (irm https://raw.githubusercontent.com/xtream-itsolutions/xithead/main/headroom.ps1)

Das Skript installiert automatisch (ohne Adminrechte):

  • Python 3.12, Node.js, Git (via Winget falls nicht vorhanden)
  • xithead Python-Paket + Proxy-Abhängigkeiten
  • xithead npm CLI + Claude Code
  • Claude Code konfigurieren (~/.claude/settings.json)
  • PowerShell-Profil mit allen Hilfsbefehlen

Danach nur noch eingeben (optional):

  • Claude Login (Browser oder API-Key)
  • GitHub Token (für Repo-Zugriff in Claude Code)

npm (Windows / macOS / Linux)

npm install -g xithead
xithead

pip (Python direkt)

pip install "xithead[proxy]"
python -m xithead.cli.main proxy --port 8787

Benutzung

xithead              # Claude Code mit Proxy starten (empfohlen)
xithead proxy        # Nur Proxy starten (mit Logs)
xithead stats        # Token-Einsparungen anzeigen
xithead update       # Alles aktualisieren (npm + Python)
xithead help         # Alle Befehle

PowerShell-Hilfsbefehle (nach Installation)

xithead-dashboard    # Dashboard im Browser öffnen
xithead-stats        # Einsparungen anzeigen
xithead-update       # Alles auf neuestem Stand halten
xithead-github       # GitHub Token + MCP Server einrichten
xithead-doctor       # System-Diagnose
xithead-help         # Alle Befehle

Dashboard

Das Live-Dashboard läuft automatisch auf http://localhost:8787/dashboard:

  • Echtzeit-Statistiken — Token gespart, Kosten, Cache-Hit-Rate
  • Request-Verlauf — Token-Verbrauch pro Request als Chart
  • Einstellungen — Komprimierungsstärke, Cache-Optionen
  • Installation — Quick-Start Guide direkt im Browser

Wie es funktioniert

Feature Beschreibung
Cache Control Anthropic cache_control wird automatisch in jeden Request injiziert (bis zu 90% Einsparung bei Wiederholungen)
Context Trimming Lange Konversations-Historien werden aggressiv komprimiert
Request Deduplication Identische gleichzeitige Requests werden zusammengeführt
429 Retry Automatisches Retry mit Retry-After Header bei Rate Limits
SQLite Cache Persistenter Cache unter ~/.xithead/cache/

Claude Code konfigurieren

xithead setzt ~/.claude/settings.json automatisch während der Installation:

{
  "env": {
    "ANTHROPIC_BASE_URL": "http://localhost:8787/v1",
    "CLAUDE_CODE_MAX_OUTPUT_TOKENS": "16000",
    "XITHEAD_ENABLE_CACHE_CONTROL": "1",
    "XITHEAD_ENABLE_DEDUP": "1",
    "XITHEAD_ENABLE_CONTEXT_TRIM": "1",
    "HEADROOM_STRENGTH": "aggressive"
  }
}

Damit nutzt auch claude direkt (ohne xithead-Wrapper) den Proxy.


GitHub Integration

Claude Code kann direkt mit GitHub arbeiten (Repos lesen, PRs erstellen, Issues verwalten):

xithead-github   # GitHub Token eingeben + MCP Server einrichten

Token erstellen unter: github.com/settings/tokens/new
Benötigte Scopes: repo, workflow, read:org


Auto-Update

xithead prüft automatisch alle 6 Stunden auf neue Versionen:

  • Neue npm-Version → stiller Hintergrund-Update
  • Python-Paket → parallel aktualisiert

Manuelles Update jederzeit:

xithead update       # oder
xithead-update       # PowerShell-Funktion

Voraussetzungen

Software Version Installiert durch
Python ≥ 3.9 Winget (automatisch)
Node.js ≥ 18 Winget (automatisch)
Claude Code aktuell npm (automatisch)
Git aktuell Winget (automatisch)

Lizenz

Apache 2.0 — © 2026 Xtream-ITSolutions UG


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

xithead-1.2.2.tar.gz (39.6 kB view details)

Uploaded Source

Built Distribution

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

xithead-1.2.2-py3-none-any.whl (39.9 kB view details)

Uploaded Python 3

File details

Details for the file xithead-1.2.2.tar.gz.

File metadata

  • Download URL: xithead-1.2.2.tar.gz
  • Upload date:
  • Size: 39.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for xithead-1.2.2.tar.gz
Algorithm Hash digest
SHA256 39e4a525978e3c61830dc508f74bf6a13a998e2e8ccf7a94409199d226112e29
MD5 38d7734e2a8e7ad7d1f89ef15d848d92
BLAKE2b-256 60d0de702c77eec25d1dfa77a3496e41e83756f0540d6347acade51afa9d9952

See more details on using hashes here.

File details

Details for the file xithead-1.2.2-py3-none-any.whl.

File metadata

  • Download URL: xithead-1.2.2-py3-none-any.whl
  • Upload date:
  • Size: 39.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for xithead-1.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e90345a7354dcc31b6d65fb0ea5466e54af5963ae6d31f69b3ac78527df2b4e9
MD5 07fad83869c0fae9f9dea236dfc5a197
BLAKE2b-256 2eb105d03f219e2b6ce7ac63f3e8f51d5860f64a325f9f8e7b1e074f00421901

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