openamer/openamer / skills/system/context-compressor
context-compressor
UnverifiedUse for session compression and full-text search.
Context Compressor
Intelligente Session-Komprimierung aus der OpenAmer state.db:
- Komprimiert Session-Transkripte um 60-80% durch Redundanz-Entfernung
- Extrahiert Entscheidungen, Action-Items, Learnings und offene Punkte
- Volltextsuche über alle komprimierten Sessions
- Batch-Archivierung aller Sessions in JSON-Archiven
Standort
- Script:
$OPENAMER_HOME\scripts\context-compressor.py - Archiv:
$OPENAMER_HOME\context-compressor\archives\ - Index:
$OPENAMER_HOME\context-compressor\index.json
CLI-Übersicht
| Flag | Beschreibung |
|---|---|
--session <id> | Einzelne Session komprimieren → JSON on stdout |
--batch [Tage] | Alle Sessions älter als N Tage archivieren (default: 7) |
--stats | Kompressionsrate + Extraktions-Statistiken anzeigen |
--search <query> | Volltextsuche in allen komprimierten Sessions |
Beispiel
# Einzelne Session komprimieren
python scripts/context-compressor.py --session 20260821_233243_387822
# Batch-Verarbeitung (alle Sessions >7 Tage)
python scripts/context-compressor.py --batch
# Alle Sessions verarbeiten (auch aktuelle)
python scripts/context-compressor.py --batch 0
# Statistiken anzeigen
python scripts/context-compressor.py --stats
# Volltextsuche
python scripts/context-compressor.py --search "API-Key"
python scripts/context-compressor.py --search "entscheidung"
Ausgabe-Struktur (pro Session)
{
"session_id": "20260821_233243_387822",
"title": "...",
"raw_chars": 59414,
"compressed_chars": 4756,
"compression_percent": "92.0%",
"decisions": ["..."],
"action_items": ["..."],
"learnings": ["..."],
"open_points": ["..."],
"messages": [
{"id": 24014, "role": "user", "compressed": "...", "original_len": 89, "compressed_len": 89},
{"id": 24016, "role": "tool", "compressed": "[JSON] keys=[...]", "original_len": 8125, "compressed_len": 221}
]
}
Kompressions-Strategie
- Boilerplate entfernen:
<antthinking>,<tool_call>, lange Code-Blöcke - Duplikat-Sätze entfernen: Wiederholungen innerhalb derselben Nachricht
- Tool-Outputs massiv kürzen:
- JSON-Outputs →
[JSON] keys=[...](auf Schlüssel reduziert) - Lange Tool-Outputs → auf max 200 Zeichen gekürzt
- JSON-Outputs →
- Entscheidungen extrahieren: Pattern-basiert (DE + EN)
- Deduplizieren: Gleiche Entscheidungen/Actions nur einmal
Datenquelle
- state.db aus
OPENAMER_HOME(default:$OPENAMER_HOME\state.db) - Tabellen:
sessions,messages - Komprimierte Sessions:
context-compressor/archives/batch_<timestamp>.json
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 192k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 192k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 192k | Updated | Claude CodeCodex | Verified | Install |