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.1.tar.gz (39.2 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.1-py3-none-any.whl (39.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: xithead-1.2.1.tar.gz
  • Upload date:
  • Size: 39.2 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.1.tar.gz
Algorithm Hash digest
SHA256 b129755bba4180cd2d64347ca7dd77618546022106ecbd768e8a448e63084783
MD5 72f3180f56cf6e8fa7c1998480c2a617
BLAKE2b-256 d257c4bb2f0702dee6fa7b24452937ab1ee07a07d8e56e49dde51fede196ccb9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xithead-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 39.5 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7775cda758401e0beb54e69491e0598a505aadaf79ac954de4380141121e1f9e
MD5 df9a497a97d3294298edf1b6f344fcf4
BLAKE2b-256 64b695e2bacc5a7313e2ec856f18607062a08a4cbf116fa31f30687e57fa600e

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