ContextStream MCP Server

offiziell

Dauerhafter Speicher und semantische Suche für KI-Codierungsassistenten über Sitzungen hinweg

Dokumentation

Docs · Abschnitte durchsuchen

01 · Einrichtungsassistent

Ein Befehl, vollständig konfiguriert.

Führen Sie einen Befehl aus, um sich zu authentifizieren (Browser-/Geräteanmeldung), einen API-Schlüssel zu erstellen, Regeln zu generieren und die korrekte MCP-Konfiguration für Ihr Tool zu schreiben (einschließlich des servers-Schemas von VS Code).

terminal · terminal · macOS / Linux

curl -fsSL https://contextstream.io/scripts/mcp.sh | bash

terminal · powershell · Windows

irm https://contextstream.io/scripts/mcp.ps1 | iex

Bereits installiert? Einrichtungsassistenten erneut ausführen

terminal · terminal · erneut ausführen

contextstream-mcp setup

Was es macht: schreibt die MCP-Konfiguration (VS Code servers, Cursor/Cline/etc mcpServers), generiert Regeln (Standard/Erweitert) und kann Projekte mit einem Arbeitsbereich verknüpfen.

Konsolidierter Werkzeugsatz: Der Assistent konfiguriert standardmäßig ~11 konsolidierte Domänenwerkzeuge (~75 % Token-Reduktion). Optional: router-Modus (~2 Meta-Werkzeuge, am kompaktesten). Siehe vollständigen Werkzeugkatalog.

Vorschau der Änderungen ohne Dateien zu schreiben: contextstream-mcp setup --dry-run

Team-Workflows

Geteilter Speicher, Fähigkeiten und Kontextanzeige.

Teamkonten erhalten mehr als nur geteilte Projekte. Während contextstream-mcp setup erkennt der Assistent die Teamfähigkeit und zeigt Arbeitsbereichstipps an. In Ihrem Editor kann jeder session(action="context")-Aufruf Teamempfehlungen, Governance-Hinweise, Prioritätssignale und verknüpfte Artefakte enthalten.

Gemeinsamen Arbeitsbereich auswählen

Verknüpfen Sie jedes Repository während der Einrichtung mit dem Team-Arbeitsbereich, damit Indizierung, Entscheidungen und Tickets aufeinander abgestimmt bleiben.

Teamfähigkeiten teilen

skill(action="share", scope="team") veröffentlicht wiederverwendbare Workflows, die Teamkollegen automatisch in session(action="context") zugeordnet werden.

Ausführungsumfang wechseln

Konten mit dualem Kontext verwenden --account-mode=team|personal|auto oder session set_account_mode in MCP.

Arbeit mit Entitäten verfolgen

Tickets, Übergaben, Vorfälle und Releases verwenden indizierte Referenzen – dauerhaft über Sitzungen und Teamkollegen hinweg.

Gehosteter Remote ist der Standard. Lokales binäres MCP dient nur der Wiederherstellung – setzen Sie CONTEXTSTREAM_ALLOW_LOCAL_MCP=1, wenn dies ausdrücklich benötigt wird. Siehe Team-Einrichtung für Einladungen/Rollen und die Checkliste nach der Anmeldung.

CLI-Verknüpfungen

Nicht-interaktive Befehle (CI & Aktualisierung).

Führen Sie diese ohne den interaktiven Assistenten aus – ideal nach Upgrades, Team-Onboarding, Anmeldeinformationsrotation oder Arbeitsbereichsänderungen. Auch in contextstream-mcp --help verfügbar.

BefehlWann zu verwenden
contextstream-mcp update-hooks --scope=globalNach einem Upgrade oder Beitritt zu einem Team-Arbeitsbereich – PreToolUse/UserPromptSubmit-Hooks aktualisieren.
contextstream-mcp update-rules --scope=all.cursorrules / CLAUDE.md / AGENTS.md mit der neuesten Team-Workflow-Anleitung neu generieren.
contextstream-mcp update-configs --scope=globalMCP-Konfigurationen nach API-Schlüssel- oder Arbeitsbereichsänderungen neu schreiben.
contextstream-mcp migrate-remote --scope=allVeraltete lokale stdio-Konfigurationen in gehosteten Remote-Transport konvertieren.
contextstream-mcp detect-editors --format=jsonSkript, welche Editoren installiert sind (Bootstrap/CI).
contextstream-mcp generate-configs --transport=remote --preauthJSON-Konfigurationsnutzdaten ausgeben, ohne Dateien zu schreiben.
contextstream-mcp configure --transcripts=on --scope=allTranskriptaufzeichnungsstandards nicht-interaktiv festlegen.

terminal · Kontomodus · Team vs. Persönlich

# Default: follow account (auto)
contextstream-mcp --account-mode=auto

# Force team-scoped reads/writes
contextstream-mcp --account-mode=team

# Or set once in shell profile:
export CONTEXTSTREAM_ACCOUNT_MODE=team

02 · Manuelle Konfiguration

Konfigurationen pro Client.

Verwenden Sie das korrekte Format pro Client (VS Code verwendet servers; viele andere Clients verwenden mcpServers).

Konsolidierter Werkzeugsatz: Standardmäßig stellt der Server ~11 konsolidierte Domänenwerkzeuge bereit (~75 % Token-Reduktion im Vergleich zu alten granularen Werkzeugen). Für noch weniger Werkzeuge fügen Sie "CONTEXTSTREAM_PROGRESSIVE_MODE": "true" zum env-Block hinzu, um ~2 Router-Meta-Werkzeuge zu erhalten. Siehe vollständigen Werkzeugkatalog.

Springen Sie zu Ihrem Tool

Cursor / VS CodeWindsurfCodex CLIOpenCode CLIClaude CodeClaude DesktopClineKilo CodeRoo CodeAntigravity

Was ist MCP?

Ein offenes Protokoll für KI.

Das Model Context Protocol (MCP) ist ein offener Standard, der es KI-Assistenten ermöglicht, sich mit externen Werkzeugen und Datenquellen zu verbinden. Mit dem MCP-Server von ContextStream können Ihre KI-Werkzeuge:

  • Gespräche und Entscheidungen über Sitzungen hinweg speichern
  • Ihre Codebasis und Dokumentation semantisch durchsuchen
  • Wissensgraphen aufbauen und abfragen
  • Kontext zwischen verschiedenen KI-Werkzeugen teilen

Natürliche Sprache

Einfach fragen. Die KI kümmert sich um die Werkzeuge.

Sie müssen sich keine Werkzeugnamen merken oder sie direkt aufrufen. Beschreiben Sie einfach in einfachem Englisch, was Sie möchten, und Ihr KI-Assistent verwendet automatisch die richtigen Werkzeuge.

Fragen Sie einfach natürlich

  • · "Sitzungszusammenfassung"
  • · "Was haben wir bezüglich Authentifizierung entschieden?"
  • · "Merke, dass wir PostgreSQL verwenden"
  • · "Suche nach Zahlungscode"

Die KI erledigt den Rest

  • · Findet automatisch relevanten Kontext
  • · Ruft bei Bedarf vergangene Entscheidungen ab
  • · Speichert wichtige Informationen im Speicher
  • · Durchsucht Code und Dokumentation

Beispiel · "Sitzungszusammenfassung"

Natural language example: typing 'session summary' and the AI automatically uses context_smart

Die KI versteht Ihre Absicht und ruft im Hintergrund die entsprechenden ContextStream-Werkzeuge auf.

Voraussetzungen

Was Sie benötigen.

  • Ein ContextStream-Konto (der Einrichtungsassistent kann einen API-Schlüssel über die Browser-Anmeldung erstellen).

Kontext anreichern

GitHub + Slack-Integrationen

MCP gibt Ihrer KI ein dauerhaftes Gedächtnis. Die Verbindung von GitHub und Slack macht dieses Gedächtnis viel reichhaltiger – Ihre KI kann bei der Beantwortung von Fragen automatisch auf PRs, Issues und Teamdiskussionen verweisen.

Automatische Kontextanreicherung

Wenn Sie context_smart oder session_smart_search aufrufen, werden automatisch relevante GitHub-Issues, PRs und Slack-Diskussionen einbezogen. Keine zusätzlichen Werkzeuge erforderlich.

GitHubSync Issues, PRs, Releases und Kommentare. Entscheidungen werden automatisch aus Diskussionen extrahiert.SlackSync Kanäle und Threads. Besonders rege Diskussionen werden bewertet und priorisiert.

Beispiel-Prompts

  • · "Was haben wir bezüglich Authentifizierung entschieden?" – findet Entscheidungen aus GitHub-Issues + Slack-Threads
  • · "Zeige mir die letzten Aktivitäten am Zahlungssystem" – zeigt PRs, Issues und Teamdiskussionen an
  • · "Welche Lehren haben wir aus dem letzten Ausfall gezogen?" – ruft Erkenntnisse aus Slack und GitHub ab
  • · "Gib mir eine wöchentliche Zusammenfassung der GitHub-Aktivitäten" – verwendet integration(provider="github", action="summary", ...)
  • · "Durchsuche alle Integrationen nach Diskussionen zur Datenbankmigration" – verwendet integration(provider="all", action="search", ...)
  • · "Gib mir eine wöchentliche Teamzusammenfassung aus allen Quellen" – verwendet integration(provider="all", action="summary", ...)

Kurzreferenz für Integrationswerkzeug-Aktionen

Verwenden Sie integration(provider="github|slack|all", action="...")

GitHub (provider="github")

  • action="stats" – Statistiken und Synchronisationsstatus
  • action="search" – Suche mit Status-/Zeitraumfiltern
  • action="activity" – Aktivitätsfeed (Tage-Filter)
  • action="knowledge" – Extrahierte Entscheidungen/Lehren
  • action="summary" – Wöchentliche/monatliche Zusammenfassung
  • action="repos" – Synchronisierte Repos auflisten
  • action="issues" – Issues/PRs auflisten

Slack (provider="slack")

  • action="stats" – Statistiken und Synchronisationsstatus
  • action="search" – Suche mit Kanal-/Zeitraumfiltern
  • action="discussions" – Threads mit hoher Beteiligung
  • action="knowledge" – Extrahierte Entscheidungen/Lehren
  • action="summary" – Wöchentliche/monatliche Zusammenfassung
  • action="channels" – Synchronisierte Kanäle auflisten

Quellenübergreifend (provider="all")

  • action="status" – Synchronisationsstatus und Zustand aller verbundenen Integrationen prüfen
  • action="search" – Mit einer Abfrage über alle verbundenen Integrationen hinweg suchen
  • action="summary" – Einheitliche Aktivitätszusammenfassung aus allen Quellen (Tage-Filter)
  • action="knowledge" – Entscheidungen, Lehren und Erkenntnisse aus allen Quellen abrufen

Client · Cursor / VS Code

Cursor / VS Code

Cursor und VS Code verwenden unterschiedliche MCP-Konfigurationsschemata. Cursor verwendet weiterhin einen lokalen MCP-Prozess, aber VS Code/Copilot kann jetzt das gehostete ContextStream MCP direkt über HTTP nutzen.

terminal · .cursor/mcp.json (Projekt) oder ~/.cursor/mcp.json (global)

{
  "mcpServers": {
    "contextstream": {
      "command": "contextstream-mcp",
      "env": {
        "CONTEXTSTREAM_API_URL": "https://api.contextstream.io",
        "CONTEXTSTREAM_API_KEY": "your_api_key"
      }
    }
  }
}

Empfohlen für VS Code / Copilot: Remote-Installation mit einem Klick

Installieren Sie das gehostete ContextStream MCP und lassen Sie VS Code die OAuth-Authentifizierung bei der ersten Verwendung übernehmen. Kein lokaler Binär- oder API-Schlüssel muss in .vscode/mcp.json abgelegt werden.

In VS Code installierenVS Code MCP-Dokumentation

terminal · .vscode/mcp.json (VS Code natives MCP, remote)

{
  "servers": {
    "contextstream": {
      "type": "http",
      "url": "https://mcp.contextstream.io/mcp?default_context_mode=fast"
    }
  }
}

Bevorzugen Sie die Befehlszeile? Fügen Sie den Remote-Server mit code --add-mcp hinzu

terminal · terminal

code --add-mcp '{"name":"contextstream","type":"http","url":"https://mcp.contextstream.io/mcp?default_context_mode=fast"}'

Bei der ersten Verwendung sollte VS Code zur Autorisierung von ContextStream auffordern und die Einrichtung dann automatisch abschließen.

Selbst gehostet? Richten Sie dieselbe Remote-Konfiguration auf Ihre eigene MCP-Gateway-URL anstelle von https://mcp.contextstream.io/mcp?default_context_mode=fast.

Client · OpenCode CLI

OpenCode CLI

Um ContextStream mit OpenCode CLI zu verwenden, fügen Sie die MCP-Serverkonfiguration zu Ihrer ~/.config/opencode/opencode.json-Datei hinzu (oder opencode.json in Ihrem Projektstammverzeichnis):

terminal · ~/.config/opencode/opencode.json

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "contextstream": {
      "type": "local",
      "command": ["contextstream-mcp"],
      "enabled": true,
      "environment": {
        "CONTEXTSTREAM_API_URL": "https://api.contextstream.io",
        "CONTEXTSTREAM_API_KEY": "your_api_key"
      }
    }
  }
}

Starten Sie OpenCode nach der Bearbeitung der Konfiguration neu, damit der ContextStream MCP-Server geladen werden kann.

Client · Codex CLI

Codex CLI

Um ContextStream mit der Codex CLI zu verwenden, fügen Sie die MCP-Serverkonfiguration zu Ihrer ~/.codex/config.toml-Datei hinzu:

terminal · ~/.codex/config.toml

[mcp_servers.contextstream]
command = "contextstream-mcp"
args = []

[mcp_servers.contextstream.env]
CONTEXTSTREAM_API_URL = "https://api.contextstream.io"
CONTEXTSTREAM_API_KEY = "your_api_key"

Starten Sie Codex nach der Bearbeitung der Konfiguration neu, damit der ContextStream MCP-Server geladen werden kann.

Client · Claude Code

Claude Code (CLI)

Fügen Sie ContextStream zu Claude Code hinzu, indem Sie diesen Befehl in Ihrem Projektverzeichnis ausführen:

terminal · terminal

claude mcp add --transport stdio contextstream --env CONTEXTSTREAM_API_URL=https://api.contextstream.io --env CONTEXTSTREAM_API_KEY=your_api_key -- contextstream-mcp

Windows-Hinweis (natives Windows, nicht WSL): Verwenden Sie cmd /c contextstream-mcp nach --.

Alternative: add-json (stdio)

terminal · terminal · add-json

claude mcp add-json contextstream \
'{"type":"stdio","command":"contextstream-mcp","args":[],"env":{"CONTEXTSTREAM_API_URL":"https://api.contextstream.io","CONTEXTSTREAM_API_KEY":"your_api_key"}}'

Tipp: Für Team-Setups bevorzugen Sie eine committete .mcp.json-Datei (Projektumfang), anstatt Schlüssel in den Shell-Verlauf einzubetten.

Dies fügt ContextStream zu ~/.claude.json unter Ihrem Projektpfad hinzu und macht es bei der Arbeit in diesem Verzeichnis verfügbar.

MCP-Umfangsoptionen

  • · Lokal (Standard): Privat für Sie, nur aktuelles Projekt → gespeichert in ~/.claude.json unter dem Projektpfad.
  • · Benutzer (--scope user): Privat für Sie, alle Projekte → global in ~/.claude.json gespeichert.
  • · Projekt (--scope project): Mit dem Team geteilt → gespeichert in .mcp.json im Projektstammverzeichnis (in Git committen).

Verwenden Sie für die Teamfreigabe den Projektumfang, um eine .mcp.json-Datei zu erstellen, die in Git committet werden kann:

terminal · .mcp.json (Projektumfang)

{
  "mcpServers": {
    "contextstream": {
      "command": "contextstream-mcp",
      "env": {
        "CONTEXTSTREAM_API_URL": "https://api.contextstream.io",
        "CONTEXTSTREAM_API_KEY": "your_api_key"
      }
    }
  }
}

Starten Sie Claude Code nach dem Hinzufügen des MCP-Servers neu, damit die Änderungen wirksam werden. Überprüfen Sie, ob der Server mit claude mcp list geladen ist. Bei Servern mit Projektumfang von .mcp.json fordert Claude Code bei der ersten Verwendung eine Genehmigung an.

Client · Claude Desktop

Claude Desktop (GUI-Anwendung)

Fügen Sie ContextStream zur Claude Desktop-Anwendung hinzu:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

Windows: %APPDATA%\Claude\claude_desktop_config.json

terminal · claude_desktop_config.json

{
  "mcpServers": {
    "contextstream": {
      "command": "contextstream-mcp",
      "env": {
        "CONTEXTSTREAM_API_URL": "https://api.contextstream.io",
        "CONTEXTSTREAM_API_KEY": "your_api_key"
      }
    }
  }
}

Beenden und starten Sie Claude Desktop nach der Bearbeitung der Konfiguration neu, damit die Änderungen wirksam werden.

Client · Windsurf

Windsurf

Fügen Sie ContextStream zu Windsurf hinzu, indem Sie die globale MCP-Konfigurationsdatei bearbeiten:

Konfiguration: ~/.codeium/windsurf/mcp_config.json

terminal · ~/.codeium/windsurf/mcp_config.json

{
  "mcpServers": {
    "contextstream": {
      "command": "contextstream-mcp",
      "env": {
        "CONTEXTSTREAM_API_URL": "https://api.contextstream.io",
        "CONTEXTSTREAM_API_KEY": "your_api_key"
      }
    }
  }
}

Regeldateien

  • · Global: ~/.codeium/windsurf/memories/global_rules.md
  • · Projekt: .windsurf/rules/contextstream.md

Windsurf unterstützt Hooks zur automatischen Durchsetzung von ContextStream-Regeln. Starten Sie Windsurf nach der Bearbeitung der Konfiguration neu, damit die Änderungen wirksam werden.

Client · Cline

Cline

Fügen Sie ContextStream zu Ihrer Cline MCP-Konfiguration hinzu. Klicken Sie in Cline auf das MCP-Serversymbol, wählen Sie die Registerkarte „Konfigurieren“ und klicken Sie dann auf „MCP-Server konfigurieren“, um die Bearbeitung vorzunehmen:

terminal · cline_mcp_settings.json

{
  "mcpServers": {
    "contextstream": {
      "command": "contextstream-mcp",
      "env": {
        "CONTEXTSTREAM_API_URL": "https://api.contextstream.io",
        "CONTEXTSTREAM_API_KEY": "your_api_key"
      }
    }
  }
}

Nach der Bearbeitung der Konfiguration starten Sie Cline neu, damit die Änderungen wirksam werden. Sie können auch alwaysAllow verwenden, um bestimmte Tools automatisch zu genehmigen.

Client · Kilo Code

Kilo Code

Fügen Sie ContextStream zu Ihrer Kilo Code MCP-Konfiguration hinzu. Sie können MCP-Server global oder pro Projekt konfigurieren:

Global: Klicken Sie auf Einstellungen → MCP-Server → Installiert → Globales MCP bearbeiten, um mcp_settings.json zu öffnen

Projekt: .kilocode/mcp.json in Ihrem Projektstammverzeichnis

Terminal · .kilocode/mcp.json (oder mcp_settings.json)

{
  "mcpServers": {
    "contextstream": {
      "command": "contextstream-mcp",
      "env": {
        "CONTEXTSTREAM_API_URL": "https://api.contextstream.io",
        "CONTEXTSTREAM_API_KEY": "your_api_key"
      }
    }
  }
}

Konfigurationen auf Projektebene haben Vorrang vor globalen Konfigurationen. Starten Sie Kilo Code nach der Bearbeitung neu.

Client · Roo Code

Roo Code

Fügen Sie ContextStream zu Ihrer Roo Code MCP-Konfiguration hinzu. Sie können MCP-Server global oder pro Projekt konfigurieren:

Global: Klicken Sie auf das Einstellungssymbol → Globales MCP bearbeiten, um mcp_settings.json zu öffnen

Projekt: .roo/mcp.json in Ihrem Projektstammverzeichnis

Terminal · .roo/mcp.json (oder mcp_settings.json)

{
  "mcpServers": {
    "contextstream": {
      "command": "contextstream-mcp",
      "env": {
        "CONTEXTSTREAM_API_URL": "https://api.contextstream.io",
        "CONTEXTSTREAM_API_KEY": "your_api_key"
      }
    }
  }
}

Konfigurationen auf Projektebene haben Vorrang vor globalen Konfigurationen. Starten Sie Roo Code nach der Bearbeitung neu.

Client · Antigravity

Antigravity (Google)

Antigravity verwendet projektbezogene .mcp.json-Dateien mit demselben Format wie Cursor/Claude Desktop:

Terminal · .mcp.json (Projektstammverzeichnis)

{
  "mcpServers": {
    "contextstream": {
      "command": "contextstream-mcp",
      "env": {
        "CONTEXTSTREAM_API_URL": "https://api.contextstream.io",
        "CONTEXTSTREAM_API_KEY": "your_api_key"
      }
    }
  }
}

Windows-Benutzer: Verwenden Sie den cmd-Wrapper

Terminal · .mcp.json (Windows)

{
  "mcpServers": {
    "contextstream": {
      "command": "cmd",
      "args": ["/c", "contextstream-mcp"],
      "env": {
        "CONTEXTSTREAM_API_URL": "https://api.contextstream.io",
        "CONTEXTSTREAM_API_KEY": "your_api_key"
      }
    }
  }
}

Regeldateien

  • · Global: ~/.gemini/GEMINI.md
  • · Arbeitsbereich: .agent/rules/contextstream.md

Zugriff über das Menü „…“ → „MCP-Server“ → „Rohkonfiguration anzeigen“, um Ihre Konfiguration zu überprüfen. Starten Sie Antigravity nach der Bearbeitung neu.

Editor-Regeln

Automatische ContextStream-Nutzung verbessern

Empfohlen

Die Auto-Context-Funktion von ContextStream lädt den Arbeitsbereichskontext automatisch, wenn Sie ein ContextStream-Tool verwenden. KI-Assistenten speichern jedoch möglicherweise nicht immer proaktiv Entscheidungen oder rufen vergangenen Kontext ab. Das Hinzufügen von Editor-KI-Regeln verbessert die Konsistenz und stellt sicher, dass die KI während Ihrer Unterhaltungen automatisch Entscheidungen, Präferenzen und wichtigen Kontext erfasst.

Kritisch: MCP-Tool-Namenskonventionen

Verschiedene KI-Tools verwenden unterschiedliche Namenskonventionen für MCP-Tools. Die Verwendung des falschen Formats führt dazu, dass Tools nicht gefunden werden.

KI-ToolFormatBeispiel
Claude Codemcp____mcp__contextstream__session_init
Codex CLI / OpenCode CLI (Rohname)session_init
Cursor / Windsurf / Cline (Rohname)session_init
Kilo Code / Roo Code (Rohname)session_init

Zusammenfassung: Nur Claude Code verwendet das Präfix mcp__contextstream__. Alle anderen Tools verwenden rohe Toolnamen.

Sie können ContextStream-Regeln auf zwei Ebenen hinzufügen: Global (gilt für alle Projekte) oder Projekt (gilt für ein Projekt).

Globale Regeln (alle Projekte)

Fügen Sie diese einmal hinzu, und sie werden automatisch auf jedes Projekt angewendet:

EditorSpeicherort für globale Regeln
CursorEinstellungen → Allgemein → Regeln für KI
Windsurf~/.codeium/windsurf/memories/global_rules.md
Cline~/Documents/Cline/Rules/
Kilo Code~/.kilocode/rules/
Roo Code~/.roo/rules/
Claude Code~/.claude/CLAUDE.md
Codex CLI~/.codex/AGENTS.md (global) oder übergeordneter Ordner (z. B. ~/dev/AGENTS.md)
OpenCode CLI~/.config/opencode/AGENTS.md

Projektregeln (einzelnes Projekt)

Fügen Sie diese zu einem bestimmten Projekt hinzu. Setzen Sie bei ordnerbasierten Regeln in Cursor den Aktivierungsmodus auf „Immer an“, damit die Regeln immer aktiv sind.

EditorSpeicherort für Projektregeln
Cursor.cursorrules oder .cursor/rules/*.mdc
Windsurf.windsurf/rules/contextstream.md
Cline.clinerules-Datei oder .clinerules/-Ordner
Kilo Code.kilocode/rules/
Roo Code.roo/rules/contextstream.md oder .roo/rules/-Ordner
Claude CodeCLAUDE.md im Projektstammverzeichnis
Codex CLIAGENTS.md im Projektstammverzeichnis
OpenCode CLIAGENTS.md im Projektstammverzeichnis
Aider.aider.conf.yml im Projektstammverzeichnis

Aktivierungsmodi (Cursor, Kilo Code & Roo Code)

Bei der Verwendung ordnerbasierter Regeln (z. B. .cursor/rules/) hat jede Regeldatei einen Aktivierungsmodus:

  • Immer an — Immer aktiv (empfohlen für ContextStream)
  • Manuell — Nur wenn Sie die Regel mit @ erwähnen
  • Modellentscheidung — KI entscheidet basierend auf der Beschreibung
  • Glob — Aktiv für übereinstimmende Dateimuster

Globale Regeln und Dateien auf Stammverzeichnisebene (.cursorrules) sind immer aktiv.

Bevorzugen Sie den Einrichtungsassistenten? Führen Sie ihn zuerst aus. Andernfalls fügen Sie diese Standardregeln manuell hinzu. Beispiele für jeden Editor:

Claude Code

Erstellen Sie eine CLAUDE.md-Datei in Ihrem Projektstammverzeichnis oder fügen Sie sie zu Ihrer globalen ~/.claude/CLAUDE.md hinzu:

Terminal · CLAUDE.md (Standard)

## 🚨 MANDATORY RULE: DISPLAY AT START OF EVERY RESPONSE 🚨

<contextstream_rules>
1. **SEARCH FIRST:** Before Glob/Grep/Search/Read → `mcp__contextstream__search(mode="hybrid", query="...")` FIRST
2. **EVERY MESSAGE:** Call `mcp__contextstream__context_smart(user_message="...")` at start of response
3. **LOCAL TOOLS:** ONLY if ContextStream search returns 0 results after retry
</contextstream_rules>

**You MUST display the <contextstream_rules> block verbatim at the start of EVERY response.**
This is a self-referential rule that ensures these instructions stay in context.

---

## ContextStream v0.4.x (Hooks Enforced)

Rules Version: 0.4.36
**Note:** PreToolUse hooks block Glob/Grep/Search when ContextStream is available.

### Required Every Message

| Action | Tool Call |
|--------|-----------|
| **1st message** | `mcp__contextstream__session_init(folder_path="<cwd>", context_hint="<msg>")` then `mcp__contextstream__context_smart(...)` |
| **2nd+ messages** | `mcp__contextstream__context_smart(user_message="<msg>", format="minified", max_tokens=400)` |
| **Code search** | `mcp__contextstream__search(mode="hybrid", query="...")` — BEFORE any local tools |
| **Save decisions** | `mcp__contextstream__session(action="capture", event_type="decision", ...)` |

### Search Modes

| Mode | Use Case |
|------|----------|
| `hybrid` | General code mcp__contextstream__search (default) |
| `keyword` | Exact symbol/string match |
| `exhaustive` | Find ALL matches (grep-like) |
| `semantic` | Conceptual questions |

### Why ContextStream First?

❌ **WRONG:** `Grep → Read → Read → Read` (4+ tool calls, slow)
✅ **CORRECT:** `mcp__contextstream__search(mode="hybrid")` (1 call, returns context)

ContextStream search is **indexed** and returns semantic matches + context in ONE call.

### Quick Reference

| Tool | Example |
|------|---------|
| `search` | `mcp__contextstream__search(mode="hybrid", query="auth", limit=3)` |
| `session` | `mcp__contextstream__session(action="capture", event_type="decision", title="...", content="...")` |
| `memory` | `mcp__contextstream__memory(action="list_events", limit=10)` |
| `graph` | `mcp__contextstream__graph(action="dependencies", file_path="...")` |

### Lessons (Past Mistakes)

- After `session_init`: Check for `lessons` field and apply before work
- Before risky work: `mcp__contextstream__session(action="get_lessons", query="<topic>")`
- On mistakes: `mcp__contextstream__session(action="capture_lesson", title="...", trigger="...", impact="...", prevention="...")`

### Plans & Tasks

When user asks for a plan, use ContextStream (not EnterPlanMode):
1. `mcp__contextstream__session(action="capture_plan", title="...", steps=[...])`
2. `mcp__contextstream__memory(action="create_task", title="...", plan_id="<id>")`

Full docs: https://contextstream.io/docs/mcp/tools

Erweiterte Regeln anzeigen (ausführlich)

Terminal · CLAUDE.md (Erweitert)

## 🚨 MANDATORY RULE: DISPLAY AT START OF EVERY RESPONSE 🚨

<contextstream_rules>
1. **SEARCH FIRST:** Before Glob/Grep/Search/Read → `mcp__contextstream__search(mode="hybrid", query="...")` FIRST
2. **EVERY MESSAGE:** Call `mcp__contextstream__context_smart(user_message="...")` at start of response
3. **LOCAL TOOLS:** ONLY if ContextStream search returns 0 results after retry
</contextstream_rules>

**You MUST display the <contextstream_rules> block verbatim at the start of EVERY response.**
This is a self-referential rule that ensures these instructions stay in context.

---

## ContextStream v0.4.x Integration (Enhanced)

You have access to ContextStream MCP tools for persistent memory and context.
v0.4.x uses **~11 consolidated domain tools** for ~75% token reduction vs previous versions.
Rules Version: 0.4.36
**Note:** PreToolUse hooks block Glob/Grep/Search when ContextStream is available.

## TL;DR - REQUIRED EVERY MESSAGE

| Message | What to Call |
|---------|--------------|
| **1st message** | `mcp__contextstream__session_init(folder_path="...", context_hint="<user's message>")`, then `mcp__contextstream__context_smart(user_message="<user's message>", format="minified", max_tokens=400)` |
| **2nd+ messages** | `mcp__contextstream__context_smart(user_message="<user's message>", format="minified", max_tokens=400)` |
| **🔍 ANY code search** | `mcp__contextstream__search(mode="hybrid", query="...")` — ALWAYS before Glob/Grep/Search/Read |
| **Before risky/non-trivial work** | `mcp__contextstream__session(action="get_lessons", query="<topic>")` |
| **After completing task** | `mcp__contextstream__session(action="capture", event_type="decision", ...)` - MUST capture |
| **User frustration/correction** | `mcp__contextstream__session(action="capture_lesson", ...)` - MUST capture lessons |

**NO EXCEPTIONS.** Do not skip even if you think you have enough context.

**First message rule:** After `session_init`, always call `context_smart` before any other tool or response.

**Context Pack (Pro+):** If enabled, use `mcp__contextstream__context_smart(..., mode="pack", distill=true)` for code/file queries. If unavailable or disabled, omit `mode` and proceed with standard `context_smart` (the API will fall back).

**Tool naming:** Use the exact tool names exposed by your MCP client. Claude Code typically uses `mcp__<server>__<tool>` where `<server>` matches your MCP config (often `contextstream`). If a tool call fails with "No such tool available", refresh rules and match the tool list.

---

## Consolidated Domain Tools Architecture

v0.4.x consolidates ~58 individual tools into ~11 domain tools with action/mode dispatch:

### Standalone Tools (Always Call)
- **`session_init`** - Initialize session with workspace detection + context
- **`context_smart`** - Semantic search for relevant context (CALL EVERY MESSAGE, including immediately after `session_init`)

### Domain Tools (Use action/mode parameter)

| Domain | Actions/Modes | Example |
|--------|---------------|---------|
| **`search`** | mode: semantic, hybrid, keyword, pattern, exhaustive, refactor | `mcp__contextstream__search(mode="hybrid", query="auth implementation", limit=3)` |
| **`session`** | action: capture, capture_lesson, get_lessons, recall, remember, user_context, summary, compress, delta, smart_search, decision_trace | `mcp__contextstream__session(action="capture", event_type="decision", title="Use JWT", content="...")` |
| **`memory`** | action: create_event, get_event, update_event, delete_event, list_events, distill_event, create_node, get_node, update_node, delete_node, list_nodes, supersede_node, search, decisions, timeline, summary | `mcp__contextstream__memory(action="list_events", limit=10)` |
| **`graph`** | action: dependencies, impact, call_path, related, path, decisions, ingest, circular_dependencies, unused_code, contradictions | `mcp__contextstream__graph(action="impact", symbol_name="AuthService")` |
| **`project`** | action: list, get, create, update, index, overview, statistics, files, index_status, ingest_local | `mcp__contextstream__project(action="statistics")` |
| **`workspace`** | action: list, get, associate, bootstrap | `mcp__contextstream__workspace(action="list")` |
| **`reminder`** | action: list, active, create, snooze, complete, dismiss | `mcp__contextstream__reminder(action="active")` |
| **`integration`** | provider: slack/github/all; action: status, search, stats, activity, contributors, knowledge, summary, channels, discussions, sync_users, repos, issues | `mcp__contextstream__integration(provider="github", action="search", query="...")` |
| **`help`** | action: tools, auth, version, editor_rules, enable_bundle | `mcp__contextstream__help(action="tools")` |

---

### Why context_smart is Required (Even After session_init)

**Common mistake:** "session_init already gave me context, I don't need context_smart"

**This is WRONG. Here's why:**
- `session_init` returns the last ~10 items **BY TIME** (chronological)
- `context_smart` **SEARCHES** for items **RELEVANT to THIS message** (semantic)

**Example failure:**
- User asks: "how should I implement authentication?"
- Auth decisions were made 20 conversations ago
- `session_init` won't have it (too old, not in recent 10)
- `context_smart` FINDS it via semantic search

**Without context_smart, you WILL miss relevant older context.**

---

### Search & Code Intelligence (ContextStream-first)

⚠️ **STOP: Before using Search/Glob/Grep/Read/Explore** → Call `mcp__contextstream__search(mode="hybrid")` FIRST. Use local tools ONLY if ContextStream returns 0 results.

**❌ WRONG workflow (wastes tokens, slow):**

Grep "function" → Read file1.ts → Read file2.ts → Read file3.ts → endlich verstehen


**✅ CORRECT workflow (fast, complete):**

mcp__contextstream__search(mode="hybrid", query="function implementation") → erledigt (Ergebnisse enthalten Kontext)


**Why?** ContextStream search returns semantic matches + context + file locations in ONE call. Local tools require multiple round-trips.

**Search Mode Selection:**

| Need | Mode | Example |
|------|------|---------|
| Find code by meaning | `hybrid` | "authentication logic", "error handling" |
| Exact string/symbol | `keyword` | "UserAuthService", "API_KEY" |
| File patterns | `pattern` | "*.sql", "test_*.py" |
| ALL matches (grep-like) | `exhaustive` | "TODO", "FIXME" (find all occurrences) |
| Symbol renaming | `refactor` | "oldFunctionName" (word-boundary matching) |
| Conceptual search | `semantic` | "how does caching work" |

**Token Efficiency:** Use `output_format` to reduce response size:
- `full` (default): Full content for understanding code
- `paths`: File paths only (80% token savings) - use for file listings
- `minimal`: Compact format (60% savings) - use for refactoring
- `count`: Match counts only (90% savings) - use for quick checks

---

### Lessons (Past Mistakes)

- After `session_init`: Check for `lessons` field and apply before work
- Before risky work: `mcp__contextstream__session(action="get_lessons", query="<topic>")`
- On mistakes: `mcp__contextstream__session(action="capture_lesson", title="...", trigger="...", impact="...", prevention="...")`

---

### Plans & Tasks

When user asks to create a plan or implementation roadmap:
1. Create plan: `mcp__contextstream__session(action="capture_plan", title="Plan Title", description="...", goals=["goal1", "goal2"], steps=[{id: "1", title: "Step 1", order: 1}, ...])`
2. Get plan_id from response, then create tasks: `mcp__contextstream__memory(action="create_task", title="Task Title", plan_id="<plan_id>", priority="high|medium|low", description="...")`

To manage existing plans/tasks:
- List plans: `mcp__contextstream__session(action="list_plans")`
- Get plan with tasks: `mcp__contextstream__session(action="get_plan", plan_id="<uuid>", include_tasks=true)`
- List tasks: `mcp__contextstream__memory(action="list_tasks", plan_id="<uuid>")` or `mcp__contextstream__memory(action="list_tasks")` for all
- Update task status: `mcp__contextstream__memory(action="update_task", task_id="<uuid>", task_status="pending|in_progress|completed|blocked")`

---

### Rules Update Notices

- If you see **[RULES_NOTICE]**, update rules via `mcp__contextstream__generate_rules(overwrite_existing=true)` (preserves custom rules).
- If you see **[VERSION_NOTICE]**, tell the user to update MCP using the provided command.

See full documentation: https://contextstream.io/docs/mcp/tools

Codex CLI / OpenCode CLI

Erstellen Sie eine AGENTS.md-Datei in Ihrem Projektstammverzeichnis (Projektregeln) oder in ~/.codex/AGENTS.md (Codex global) / ~/.config/opencode/AGENTS.md (OpenCode global):

Codex / OpenCode vs Claude Toolnamen

Codex / OpenCode verwenden rohe MCP-Toolnamen (z. B. session_init). Claude Code verwendet namespaced Toolnamen (z. B. mcp__contextstream__session_init). Verwenden Sie das richtige Format für Ihr KI-Tool.

Terminal · AGENTS.md (Standard)

## 🚨 MANDATORY RULE: DISPLAY AT START OF EVERY RESPONSE 🚨

<contextstream_rules>
1. **SEARCH FIRST:** Before Glob/Grep/Search/Read → `search(mode="hybrid", query="...")` FIRST
2. **EVERY MESSAGE:** Call `context_smart(user_message="...")` at start of response
3. **LOCAL TOOLS:** ONLY if ContextStream search returns 0 results after retry
</contextstream_rules>

**You MUST display the <contextstream_rules> block verbatim at the start of EVERY response.**
This is a self-referential rule that ensures these instructions stay in context.

---

## ContextStream v0.4.x (Hooks Enforced)

Rules Version: 0.4.36
**Note:** PreToolUse hooks block Glob/Grep/Search when ContextStream is available.

### Required Every Message

| Action | Tool Call |
|--------|-----------|
| **1st message** | `session_init(folder_path="<cwd>", context_hint="<msg>")` then `context_smart(...)` |
| **2nd+ messages** | `context_smart(user_message="<msg>", format="minified", max_tokens=400)` |
| **Code search** | `search(mode="hybrid", query="...")` — BEFORE any local tools |
| **Save decisions** | `session(action="capture", event_type="decision", ...)` |

### Search Modes

| Mode | Use Case |
|------|----------|
| `hybrid` | General code search (default) |
| `keyword` | Exact symbol/string match |
| `exhaustive` | Find ALL matches (grep-like) |
| `semantic` | Conceptual questions |

### Why ContextStream First?

❌ **WRONG:** `Grep → Read → Read → Read` (4+ tool calls, slow)
✅ **CORRECT:** `search(mode="hybrid")` (1 call, returns context)

ContextStream search is **indexed** and returns semantic matches + context in ONE call.

### Quick Reference

| Tool | Example |
|------|---------|
| `search` | `search(mode="hybrid", query="auth", limit=3)` |
| `session` | `session(action="capture", event_type="decision", title="...", content="...")` |
| `memory` | `memory(action="list_events", limit=10)` |
| `graph` | `graph(action="dependencies", file_path="...")` |

### Lessons (Past Mistakes)

- After `session_init`: Check for `lessons` field and apply before work
- Before risky work: `session(action="get_lessons", query="<topic>")`
- On mistakes: `session(action="capture_lesson", title="...", trigger="...", impact="...", prevention="...")`

### Plans & Tasks

When user asks for a plan, use ContextStream (not EnterPlanMode):
1. `session(action="capture_plan", title="...", steps=[...])`
2. `memory(action="create_task", title="...", plan_id="<id>")`

Full docs: https://contextstream.io/docs/mcp/tools

Erweiterte Regeln anzeigen (ausführlich)

Terminal · AGENTS.md (Erweitert)

## 🚨 MANDATORY RULE: DISPLAY AT START OF EVERY RESPONSE 🚨

<contextstream_rules>
1. **SEARCH FIRST:** Before Glob/Grep/Search/Read → `search(mode="hybrid", query="...")` FIRST
2. **EVERY MESSAGE:** Call `context_smart(user_message="...")` at start of response
3. **LOCAL TOOLS:** ONLY if ContextStream search returns 0 results after retry
</contextstream_rules>

**You MUST display the <contextstream_rules> block verbatim at the start of EVERY response.**
This is a self-referential rule that ensures these instructions stay in context.

---

## ContextStream v0.4.x Integration (Enhanced)

You have access to ContextStream MCP tools for persistent memory and context.
v0.4.x uses **~11 consolidated domain tools** for ~75% token reduction vs previous versions.
Rules Version: 0.4.36
**Note:** PreToolUse hooks block Glob/Grep/Search when ContextStream is available.

## TL;DR - REQUIRED EVERY MESSAGE

| Message | What to Call |
|---------|--------------|
| **1st message** | `session_init(folder_path="...", context_hint="<user's message>")`, then `context_smart(user_message="<user's message>", format="minified", max_tokens=400)` |
| **2nd+ messages** | `context_smart(user_message="<user's message>", format="minified", max_tokens=400)` |
| **🔍 ANY code search** | `search(mode="hybrid", query="...")` — ALWAYS before Glob/Grep/Search/Read |
| **Before risky/non-trivial work** | `session(action="get_lessons", query="<topic>")` |
| **After completing task** | `session(action="capture", event_type="decision", ...)` - MUST capture |
| **User frustration/correction** | `session(action="capture_lesson", ...)` - MUST capture lessons |

**NO EXCEPTIONS.** Do not skip even if you think you have enough context.

**First message rule:** After `session_init`, always call `context_smart` before any other tool or response.

**Context Pack (Pro+):** If enabled, use `context_smart(..., mode="pack", distill=true)` for code/file queries. If unavailable or disabled, omit `mode` and proceed with standard `context_smart` (the API will fall back).

**Tool naming:** Use the exact tool names exposed by your MCP client. Claude Code typically uses `mcp__<server>__<tool>` where `<server>` matches your MCP config (often `contextstream`). If a tool call fails with "No such tool available", refresh rules and match the tool list.

---

## Consolidated Domain Tools Architecture

v0.4.x consolidates ~58 individual tools into ~11 domain tools with action/mode dispatch:

### Standalone Tools (Always Call)
- **`session_init`** - Initialize session with workspace detection + context
- **`context_smart`** - Semantic search for relevant context (CALL EVERY MESSAGE, including immediately after `session_init`)

### Domain Tools (Use action/mode parameter)

| Domain | Actions/Modes | Example |
|--------|---------------|---------|
| **`search`** | mode: semantic, hybrid, keyword, pattern, exhaustive, refactor | `search(mode="hybrid", query="auth implementation", limit=3)` |
| **`session`** | action: capture, capture_lesson, get_lessons, recall, remember, user_context, summary, compress, delta, smart_search, decision_trace | `session(action="capture", event_type="decision", title="Use JWT", content="...")` |
| **`memory`** | action: create_event, get_event, update_event, delete_event, list_events, distill_event, create_node, get_node, update_node, delete_node, list_nodes, supersede_node, search, decisions, timeline, summary | `memory(action="list_events", limit=10)` |
| **`graph`** | action: dependencies, impact, call_path, related, path, decisions, ingest, circular_dependencies, unused_code, contradictions | `graph(action="impact", symbol_name="AuthService")` |
| **`project`** | action: list, get, create, update, index, overview, statistics, files, index_status, ingest_local | `project(action="statistics")` |
| **`workspace`** | action: list, get, associate, bootstrap | `workspace(action="list")` |
| **`reminder`** | action: list, active, create, snooze, complete, dismiss | `reminder(action="active")` |
| **`integration`** | provider: slack/github/all; action: status, search, stats, activity, contributors, knowledge, summary, channels, discussions, sync_users, repos, issues | `integration(provider="github", action="search", query="...")` |
| **`help`** | action: tools, auth, version, editor_rules, enable_bundle | `help(action="tools")` |

---

### Why context_smart is Required (Even After session_init)

**Common mistake:** "session_init already gave me context, I don't need context_smart"

**This is WRONG. Here's why:**
- `session_init` returns the last ~10 items **BY TIME** (chronological)
- `context_smart` **SEARCHES** for items **RELEVANT to THIS message** (semantic)

**Example failure:**
- User asks: "how should I implement authentication?"
- Auth decisions were made 20 conversations ago
- `session_init` won't have it (too old, not in recent 10)
- `context_smart` FINDS it via semantic search

**Without context_smart, you WILL miss relevant older context.**

---

### Search & Code Intelligence (ContextStream-first)

⚠️ **STOP: Before using Search/Glob/Grep/Read/Explore** → Call `search(mode="hybrid")` FIRST. Use local tools ONLY if ContextStream returns 0 results.

**❌ WRONG workflow (wastes tokens, slow):**

Grep "function" → Read file1.ts → Read file2.ts → Read file3.ts → endlich verstehen


**✅ CORRECT workflow (fast, complete):**

search(mode="hybrid", query="function implementation") → erledigt (Ergebnisse enthalten Kontext)


**Why?** ContextStream search returns semantic matches + context + file locations in ONE call. Local tools require multiple round-trips.

**Search Mode Selection:**

| Need | Mode | Example |
|------|------|---------|
| Find code by meaning | `hybrid` | "authentication logic", "error handling" |
| Exact string/symbol | `keyword` | "UserAuthService", "API_KEY" |
| File patterns | `pattern` | "*.sql", "test_*.py" |
| ALL matches (grep-like) | `exhaustive` | "TODO", "FIXME" (find all occurrences) |
| Symbol renaming | `refactor` | "oldFunctionName" (word-boundary matching) |
| Conceptual search | `semantic` | "how does caching work" |

**Token Efficiency:** Use `output_format` to reduce response size:
- `full` (default): Full content for understanding code
- `paths`: File paths only (80% token savings) - use for file listings
- `minimal`: Compact format (60% savings) - use for refactoring
- `count`: Match counts only (90% savings) - use for quick checks

---

### Lessons (Past Mistakes)

- After `session_init`: Check for `lessons` field and apply before work
- Before risky work: `session(action="get_lessons", query="<topic>")`
- On mistakes: `session(action="capture_lesson", title="...", trigger="...", impact="...", prevention="...")`

---

### Plans & Tasks

When user asks to create a plan or implementation roadmap:
1. Create plan: `session(action="capture_plan", title="Plan Title", description="...", goals=["goal1", "goal2"], steps=[{id: "1", title: "Step 1", order: 1}, ...])`
2. Get plan_id from response, then create tasks: `memory(action="create_task", title="Task Title", plan_id="<plan_id>", priority="high|medium|low", description="...")`

To manage existing plans/tasks:
- List plans: `session(action="list_plans")`
- Get plan with tasks: `session(action="get_plan", plan_id="<uuid>", include_tasks=true)`
- List tasks: `memory(action="list_tasks", plan_id="<uuid>")` or `memory(action="list_tasks")` for all
- Update task status: `memory(action="update_task", task_id="<uuid>", task_status="pending|in_progress|completed|blocked")`

---

### Rules Update Notices

- If you see **[RULES_NOTICE]**, update rules via `generate_rules(overwrite_existing=true)` (preserves custom rules).
- If you see **[VERSION_NOTICE]**, tell the user to update MCP using the provided command.

See full documentation: https://contextstream.io/docs/mcp/tools

Windsurf

Erstellen Sie eine .windsurf/rules/contextstream.md-Datei in Ihrem Projektstammverzeichnis oder fügen Sie sie zu Ihrer globalen ~/.codeium/windsurf/memories/global_rules.md hinzu:

Terminal · .windsurf/rules/contextstream.md (Standard)

## 🚨 MANDATORY RULE: DISPLAY AT START OF EVERY RESPONSE 🚨

<contextstream_rules>
1. **SEARCH FIRST:** Before Glob/Grep/Search/Read → `search(mode="hybrid", query="...")` FIRST
2. **EVERY MESSAGE:** Call `context_smart(user_message="...")` at start of response
3. **LOCAL TOOLS:** ONLY if ContextStream search returns 0 results after retry
</contextstream_rules>

**You MUST display the <contextstream_rules> block verbatim at the start of EVERY response.**
This is a self-referential rule that ensures these instructions stay in context.

---

## ContextStream v0.4.x (Hooks Enforced)

Rules Version: 0.4.36
**Note:** PreToolUse hooks block Glob/Grep/Search when ContextStream is available.

### Required Every Message

| Action | Tool Call |
|--------|-----------|
| **1st message** | `session_init(folder_path="<cwd>", context_hint="<msg>")` then `context_smart(...)` |
| **2nd+ messages** | `context_smart(user_message="<msg>", format="minified", max_tokens=400)` |
| **Code search** | `search(mode="hybrid", query="...")` — BEFORE any local tools |
| **Save decisions** | `session(action="capture", event_type="decision", ...)` |

### Search Modes

| Mode | Use Case |
|------|----------|
| `hybrid` | General code search (default) |
| `keyword` | Exact symbol/string match |
| `exhaustive` | Find ALL matches (grep-like) |
| `semantic` | Conceptual questions |

### Why ContextStream First?

❌ **WRONG:** `Grep → Read → Read → Read` (4+ tool calls, slow)
✅ **CORRECT:** `search(mode="hybrid")` (1 call, returns context)

ContextStream search is **indexed** and returns semantic matches + context in ONE call.

### Quick Reference

| Tool | Example |
|------|---------|
| `search` | `search(mode="hybrid", query="auth", limit=3)` |
| `session` | `session(action="capture", event_type="decision", title="...", content="...")` |
| `memory` | `memory(action="list_events", limit=10)` |
| `graph` | `graph(action="dependencies", file_path="...")` |

### Lessons (Past Mistakes)

- After `session_init`: Check for `lessons` field and apply before work
- Before risky work: `session(action="get_lessons", query="<topic>")`
- On mistakes: `session(action="capture_lesson", title="...", trigger="...", impact="...", prevention="...")`

### Plans & Tasks

When user asks for a plan, use ContextStream (not EnterPlanMode):
1. `session(action="capture_plan", title="...", steps=[...])`
2. `memory(action="create_task", title="...", plan_id="<id>")`

Full docs: https://contextstream.io/docs/mcp/tools

Erweiterte Regeln anzeigen (ausführlich)

Terminal · .windsurf/rules/contextstream.md (Erweitert)

## 🚨 MANDATORY RULE: DISPLAY AT START OF EVERY RESPONSE 🚨

<contextstream_rules>
1. **SEARCH FIRST:** Before Glob/Grep/Search/Read → `search(mode="hybrid", query="...")` FIRST
2. **EVERY MESSAGE:** Call `context_smart(user_message="...")` at start of response
3. **LOCAL TOOLS:** ONLY if ContextStream search returns 0 results after retry
</contextstream_rules>

**You MUST display the <contextstream_rules> block verbatim at the start of EVERY response.**
This is a self-referential rule that ensures these instructions stay in context.

---

## ContextStream v0.4.x Integration (Enhanced)

You have access to ContextStream MCP tools for persistent memory and context.
v0.4.x uses **~11 consolidated domain tools** for ~75% token reduction vs previous versions.
Rules Version: 0.4.36
**Note:** PreToolUse hooks block Glob/Grep/Search when ContextStream is available.

## TL;DR - REQUIRED EVERY MESSAGE

| Message | What to Call |
|---------|--------------|
| **1st message** | `session_init(folder_path="...", context_hint="<user's message>")`, then `context_smart(user_message="<user's message>", format="minified", max_tokens=400)` |
| **2nd+ messages** | `context_smart(user_message="<user's message>", format="minified", max_tokens=400)` |
| **🔍 ANY code search** | `search(mode="hybrid", query="...")` — ALWAYS before Glob/Grep/Search/Read |
| **Before risky/non-trivial work** | `session(action="get_lessons", query="<topic>")` |
| **After completing task** | `session(action="capture", event_type="decision", ...)` - MUST capture |
| **User frustration/correction** | `session(action="capture_lesson", ...)` - MUST capture lessons |

**NO EXCEPTIONS.** Do not skip even if you think you have enough context.

**First message rule:** After `session_init`, always call `context_smart` before any other tool or response.

**Context Pack (Pro+):** If enabled, use `context_smart(..., mode="pack", distill=true)` for code/file queries. If unavailable or disabled, omit `mode` and proceed with standard `context_smart` (the API will fall back).

**Tool naming:** Use the exact tool names exposed by your MCP client. Claude Code typically uses `mcp__<server>__<tool>` where `<server>` matches your MCP config (often `contextstream`). If a tool call fails with "No such tool available", refresh rules and match the tool list.

---

## Consolidated Domain Tools Architecture

v0.4.x consolidates ~58 individual tools into ~11 domain tools with action/mode dispatch:

### Standalone Tools (Always Call)
- **`session_init`** - Initialize session with workspace detection + context
- **`context_smart`** - Semantic search for relevant context (CALL EVERY MESSAGE, including immediately after `session_init`)

### Domain Tools (Use action/mode parameter)

| Domain | Actions/Modes | Example |
|--------|---------------|---------|
| **`search`** | mode: semantic, hybrid, keyword, pattern, exhaustive, refactor | `search(mode="hybrid", query="auth implementation", limit=3)` |
| **`session`** | action: capture, capture_lesson, get_lessons, recall, remember, user_context, summary, compress, delta, smart_search, decision_trace | `session(action="capture", event_type="decision", title="Use JWT", content="...")` |
| **`memory`** | action: create_event, get_event, update_event, delete_event, list_events, distill_event, create_node, get_node, update_node, delete_node, list_nodes, supersede_node, search, decisions, timeline, summary | `memory(action="list_events", limit=10)` |
| **`graph`** | action: dependencies, impact, call_path, related, path, decisions, ingest, circular_dependencies, unused_code, contradictions | `graph(action="impact", symbol_name="AuthService")` |
| **`project`** | action: list, get, create, update, index, overview, statistics, files, index_status, ingest_local | `project(action="statistics")` |
| **`workspace`** | action: list, get, associate, bootstrap | `workspace(action="list")` |
| **`reminder`** | action: list, active, create, snooze, complete, dismiss | `reminder(action="active")` |
| **`integration`** | provider: slack/github/all; action: status, search, stats, activity, contributors, knowledge, summary, channels, discussions, sync_users, repos, issues | `integration(provider="github", action="search", query="...")` |
| **`help`** | action: tools, auth, version, editor_rules, enable_bundle | `help(action="tools")` |

---

### Why context_smart is Required (Even After session_init)

**Common mistake:** "session_init already gave me context, I don't need context_smart"

**This is WRONG. Here's why:**
- `session_init` returns the last ~10 items **BY TIME** (chronological)
- `context_smart` **SEARCHES** for items **RELEVANT to THIS message** (semantic)

**Example failure:**
- User asks: "how should I implement authentication?"
- Auth decisions were made 20 conversations ago
- `session_init` won't have it (too old, not in recent 10)
- `context_smart` FINDS it via semantic search

**Without context_smart, you WILL miss relevant older context.**

---

### Search & Code Intelligence (ContextStream-first)

⚠️ **STOP: Before using Search/Glob/Grep/Read/Explore** → Call `search(mode="hybrid")` FIRST. Use local tools ONLY if ContextStream returns 0 results.

**❌ WRONG workflow (wastes tokens, slow):**

Grep "function" → Read file1.ts → Read file2.ts → Read file3.ts → endlich verstehen


**✅ CORRECT workflow (fast, complete):**

search(mode="hybrid", query="function implementation") → erledigt (Ergebnisse enthalten Kontext)


**Why?** ContextStream search returns semantic matches + context + file locations in ONE call. Local tools require multiple round-trips.

**Search Mode Selection:**

| Need | Mode | Example |
|------|------|---------|
| Find code by meaning | `hybrid` | "authentication logic", "error handling" |
| Exact string/symbol | `keyword` | "UserAuthService", "API_KEY" |
| File patterns | `pattern` | "*.sql", "test_*.py" |
| ALL matches (grep-like) | `exhaustive` | "TODO", "FIXME" (find all occurrences) |
| Symbol renaming | `refactor` | "oldFunctionName" (word-boundary matching) |
| Conceptual search | `semantic` | "how does caching work" |

**Token Efficiency:** Use `output_format` to reduce response size:
- `full` (default): Full content for understanding code
- `paths`: File paths only (80% token savings) - use for file listings
- `minimal`: Compact format (60% savings) - use for refactoring
- `count`: Match counts only (90% savings) - use for quick checks

---

### Lessons (Past Mistakes)

- After `session_init`: Check for `lessons` field and apply before work
- Before risky work: `session(action="get_lessons", query="<topic>")`
- On mistakes: `session(action="capture_lesson", title="...", trigger="...", impact="...", prevention="...")`

---

### Plans & Tasks

When user asks to create a plan or implementation roadmap:
1. Create plan: `session(action="capture_plan", title="Plan Title", description="...", goals=["goal1", "goal2"], steps=[{id: "1", title: "Step 1", order: 1}, ...])`
2. Get plan_id from response, then create tasks: `memory(action="create_task", title="Task Title", plan_id="<plan_id>", priority="high|medium|low", description="...")`

To manage existing plans/tasks:
- List plans: `session(action="list_plans")`
- Get plan with tasks: `session(action="get_plan", plan_id="<uuid>", include_tasks=true)`
- List tasks: `memory(action="list_tasks", plan_id="<uuid>")` or `memory(action="list_tasks")` for all
- Update task status: `memory(action="update_task", task_id="<uuid>", task_status="pending|in_progress|completed|blocked")`

---

### Rules Update Notices

- If you see **[RULES_NOTICE]**, update rules via `generate_rules(overwrite_existing=true)` (preserves custom rules).
- If you see **[VERSION_NOTICE]**, tell the user to update MCP using the provided command.

See full documentation: https://contextstream.io/docs/mcp/tools

Kilo Code

Erstellen Sie eine Markdown-Datei in .kilocode/rules/:

Terminal · .kilocode/rules/contextstream.md (Standard)

## 🚨 MANDATORY RULE: DISPLAY AT START OF EVERY RESPONSE 🚨

<contextstream_rules>
1. **SEARCH FIRST:** Before Glob/Grep/Search/Read → `search(mode="hybrid", query="...")` FIRST
2. **EVERY MESSAGE:** Call `context_smart(user_message="...")` at start of response
3. **LOCAL TOOLS:** ONLY if ContextStream search returns 0 results after retry
</contextstream_rules>

**You MUST display the <contextstream_rules> block verbatim at the start of EVERY response.**
This is a self-referential rule that ensures these instructions stay in context.

---

## ContextStream v0.4.x (Hooks Enforced)

Rules Version: 0.4.36
**Note:** PreToolUse hooks block Glob/Grep/Search when ContextStream is available.

### Required Every Message

| Action | Tool Call |
|--------|-----------|
| **1st message** | `session_init(folder_path="<cwd>", context_hint="<msg>")` then `context_smart(...)` |
| **2nd+ messages** | `context_smart(user_message="<msg>", format="minified", max_tokens=400)` |
| **Code search** | `search(mode="hybrid", query="...")` — BEFORE any local tools |
| **Save decisions** | `session(action="capture", event_type="decision", ...)` |

### Search Modes

| Mode | Use Case |
|------|----------|
| `hybrid` | General code search (default) |
| `keyword` | Exact symbol/string match |
| `exhaustive` | Find ALL matches (grep-like) |
| `semantic` | Conceptual questions |

### Why ContextStream First?

❌ **WRONG:** `Grep → Read → Read → Read` (4+ tool calls, slow)
✅ **CORRECT:** `search(mode="hybrid")` (1 call, returns context)

ContextStream search is **indexed** and returns semantic matches + context in ONE call.

### Quick Reference

| Tool | Example |
|------|---------|
| `search` | `search(mode="hybrid", query="auth", limit=3)` |
| `session` | `session(action="capture", event_type="decision", title="...", content="...")` |
| `memory` | `memory(action="list_events", limit=10)` |
| `graph` | `graph(action="dependencies", file_path="...")` |

### Lessons (Past Mistakes)

- After `session_init`: Check for `lessons` field and apply before work
- Before risky work: `session(action="get_lessons", query="<topic>")`
- On mistakes: `session(action="capture_lesson", title="...", trigger="...", impact="...", prevention="...")`

### Plans & Tasks

When user asks for a plan, use ContextStream (not EnterPlanMode):
1. `session(action="capture_plan", title="...", steps=[...])`
2. `memory(action="create_task", title="...", plan_id="<id>")`

Full docs: https://contextstream.io/docs/mcp/tools

Erweiterte Regeln anzeigen (ausführlich)

Terminal · .kilocode/rules/contextstream.md (Erweitert)

## 🚨 MANDATORY RULE: DISPLAY AT START OF EVERY RESPONSE 🚨

<contextstream_rules>
1. **SEARCH FIRST:** Before Glob/Grep/Search/Read → `search(mode="hybrid", query="...")` FIRST
2. **EVERY MESSAGE:** Call `context_smart(user_message="...")` at start of response
3. **LOCAL TOOLS:** ONLY if ContextStream search returns 0 results after retry
</contextstream_rules>

**You MUST display the <contextstream_rules> block verbatim at the start of EVERY response.**
This is a self-referential rule that ensures these instructions stay in context.

---

## ContextStream v0.4.x Integration (Enhanced)

You have access to ContextStream MCP tools for persistent memory and context.
v0.4.x uses **~11 consolidated domain tools** for ~75% token reduction vs previous versions.
Rules Version: 0.4.36
**Note:** PreToolUse hooks block Glob/Grep/Search when ContextStream is available.

## TL;DR - REQUIRED EVERY MESSAGE

| Message | What to Call |
|---------|--------------|
| **1st message** | `session_init(folder_path="...", context_hint="<user's message>")`, then `context_smart(user_message="<user's message>", format="minified", max_tokens=400)` |
| **2nd+ messages** | `context_smart(user_message="<user's message>", format="minified", max_tokens=400)` |
| **🔍 ANY code search** | `search(mode="hybrid", query="...")` — ALWAYS before Glob/Grep/Search/Read |
| **Before risky/non-trivial work** | `session(action="get_lessons", query="<topic>")` |
| **After completing task** | `session(action="capture", event_type="decision", ...)` - MUST capture |
| **User frustration/correction** | `session(action="capture_lesson", ...)` - MUST capture lessons |

**NO EXCEPTIONS.** Do not skip even if you think you have enough context.

**First message rule:** After `session_init`, always call `context_smart` before any other tool or response.

**Context Pack (Pro+):** If enabled, use `context_smart(..., mode="pack", distill=true)` for code/file queries. If unavailable or disabled, omit `mode` and proceed with standard `context_smart` (the API will fall back).

**Tool naming:** Use the exact tool names exposed by your MCP client. Claude Code typically uses `mcp__<server>__<tool>` where `<server>` matches your MCP config (often `contextstream`). If a tool call fails with "No such tool available", refresh rules and match the tool list.

---

## Consolidated Domain Tools Architecture

v0.4.x consolidates ~58 individual tools into ~11 domain tools with action/mode dispatch:

### Standalone Tools (Always Call)
- **`session_init`** - Initialize session with workspace detection + context
- **`context_smart`** - Semantic search for relevant context (CALL EVERY MESSAGE, including immediately after `session_init`)

### Domain Tools (Use action/mode parameter)

| Domain | Actions/Modes | Example |
|--------|---------------|---------|
| **`search`** | mode: semantic, hybrid, keyword, pattern, exhaustive, refactor | `search(mode="hybrid", query="auth implementation", limit=3)` |
| **`session`** | action: capture, capture_lesson, get_lessons, recall, remember, user_context, summary, compress, delta, smart_search, decision_trace | `session(action="capture", event_type="decision", title="Use JWT", content="...")` |
| **`memory`** | action: create_event, get_event, update_event, delete_event, list_events, distill_event, create_node, get_node, update_node, delete_node, list_nodes, supersede_node, search, decisions, timeline, summary | `memory(action="list_events", limit=10)` |
| **`graph`** | action: dependencies, impact, call_path, related, path, decisions, ingest, circular_dependencies, unused_code, contradictions | `graph(action="impact", symbol_name="AuthService")` |
| **`project`** | action: list, get, create, update, index, overview, statistics, files, index_status, ingest_local | `project(action="statistics")` |
| **`workspace`** | action: list, get, associate, bootstrap | `workspace(action="list")` |
| **`reminder`** | action: list, active, create, snooze, complete, dismiss | `reminder(action="active")` |
| **`integration`** | provider: slack/github/all; action: status, search, stats, activity, contributors, knowledge, summary, channels, discussions, sync_users, repos, issues | `integration(provider="github", action="search", query="...")` |
| **`help`** | action: tools, auth, version, editor_rules, enable_bundle | `help(action="tools")` |

---

### Why context_smart is Required (Even After session_init)

**Common mistake:** "session_init already gave me context, I don't need context_smart"

**This is WRONG. Here's why:**
- `session_init` returns the last ~10 items **BY TIME** (chronological)
- `context_smart` **SEARCHES** for items **RELEVANT to THIS message** (semantic)

**Example failure:**
- User asks: "how should I implement authentication?"
- Auth decisions were made 20 conversations ago
- `session_init` won't have it (too old, not in recent 10)
- `context_smart` FINDS it via semantic search

**Without context_smart, you WILL miss relevant older context.**

---

### Search & Code Intelligence (ContextStream-first)

⚠️ **STOP: Before using Search/Glob/Grep/Read/Explore** → Call `search(mode="hybrid")` FIRST. Use local tools ONLY if ContextStream returns 0 results.

**❌ WRONG workflow (wastes tokens, slow):**

Grep "function" → Read file1.ts → Read file2.ts → Read file3.ts → endlich verstehen


**✅ CORRECT workflow (fast, complete):**

search(mode="hybrid", query="function implementation") → erledigt (Ergebnisse enthalten Kontext)


**Why?** ContextStream search returns semantic matches + context + file locations in ONE call. Local tools require multiple round-trips.

**Search Mode Selection:**

| Need | Mode | Example |
|------|------|---------|
| Find code by meaning | `hybrid` | "authentication logic", "error handling" |
| Exact string/symbol | `keyword` | "UserAuthService", "API_KEY" |
| File patterns | `pattern` | "*.sql", "test_*.py" |
| ALL matches (grep-like) | `exhaustive` | "TODO", "FIXME" (find all occurrences) |
| Symbol renaming | `refactor` | "oldFunctionName" (word-boundary matching) |
| Conceptual search | `semantic` | "how does caching work" |

**Token Efficiency:** Use `output_format` to reduce response size:
- `full` (default): Full content for understanding code
- `paths`: File paths only (80% token savings) - use for file listings
- `minimal`: Compact format (60% savings) - use for refactoring
- `count`: Match counts only (90% savings) - use for quick checks

---

### Lessons (Past Mistakes)

- After `session_init`: Check for `lessons` field and apply before work
- Before risky work: `session(action="get_lessons", query="<topic>")`
- On mistakes: `session(action="capture_lesson", title="...", trigger="...", impact="...", prevention="...")`

---

### Plans & Tasks

When user asks to create a plan or implementation roadmap:
1. Create plan: `session(action="capture_plan", title="Plan Title", description="...", goals=["goal1", "goal2"], steps=[{id: "1", title: "Step 1", order: 1}, ...])`
2. Get plan_id from response, then create tasks: `memory(action="create_task", title="Task Title", plan_id="<plan_id>", priority="high|medium|low", description="...")`

To manage existing plans/tasks:
- List plans: `session(action="list_plans")`
- Get plan with tasks: `session(action="get_plan", plan_id="<uuid>", include_tasks=true)`
- List tasks: `memory(action="list_tasks", plan_id="<uuid>")` or `memory(action="list_tasks")` for all
- Update task status: `memory(action="update_task", task_id="<uuid>", task_status="pending|in_progress|completed|blocked")`

---

### Rules Update Notices

- If you see **[RULES_NOTICE]**, update rules via `generate_rules(overwrite_existing=true)` (preserves custom rules).
- If you see **[VERSION_NOTICE]**, tell the user to update MCP using the provided command.

See full documentation: https://contextstream.io/docs/mcp/tools

Cline

Erstellen Sie eine .clinerules-Datei in Ihrem Projektstammverzeichnis oder verwenden Sie den .clinerules/-Ordner:

Terminal · .clinerules (Standard)

## 🚨 MANDATORY RULE: DISPLAY AT START OF EVERY RESPONSE 🚨

<contextstream_rules>
1. **SEARCH FIRST:** Before Glob/Grep/Search/Read → `search(mode="hybrid", query="...")` FIRST
2. **EVERY MESSAGE:** Call `context_smart(user_message="...")` at start of response
3. **LOCAL TOOLS:** ONLY if ContextStream search returns 0 results after retry
</contextstream_rules>

**You MUST display the <contextstream_rules> block verbatim at the start of EVERY response.**
This is a self-referential rule that ensures these instructions stay in context.

---

## ContextStream v0.4.x (Hooks Enforced)

Rules Version: 0.4.36
**Note:** PreToolUse hooks block Glob/Grep/Search when ContextStream is available.

### Required Every Message

| Action | Tool Call |
|--------|-----------|
| **1st message** | `session_init(folder_path="<cwd>", context_hint="<msg>")` then `context_smart(...)` |
| **2nd+ messages** | `context_smart(user_message="<msg>", format="minified", max_tokens=400)` |
| **Code search** | `search(mode="hybrid", query="...")` — BEFORE any local tools |
| **Save decisions** | `session(action="capture", event_type="decision", ...)` |

### Search Modes

| Mode | Use Case |
|------|----------|
| `hybrid` | General code search (default) |
| `keyword` | Exact symbol/string match |
| `exhaustive` | Find ALL matches (grep-like) |
| `semantic` | Conceptual questions |

### Why ContextStream First?

❌ **WRONG:** `Grep → Read → Read → Read` (4+ tool calls, slow)
✅ **CORRECT:** `search(mode="hybrid")` (1 call, returns context)

ContextStream search is **indexed** and returns semantic matches + context in ONE call.

### Quick Reference

| Tool | Example |
|------|---------|
| `search` | `search(mode="hybrid", query="auth", limit=3)` |
| `session` | `session(action="capture", event_type="decision", title="...", content="...")` |
| `memory` | `memory(action="list_events", limit=10)` |
| `graph` | `graph(action="dependencies", file_path="...")` |

### Lessons (Past Mistakes)

- After `session_init`: Check for `lessons` field and apply before work
- Before risky work: `session(action="get_lessons", query="<topic>")`
- On mistakes: `session(action="capture_lesson", title="...", trigger="...", impact="...", prevention="...")`

### Plans & Tasks

When user asks for a plan, use ContextStream (not EnterPlanMode):
1. `session(action="capture_plan", title="...", steps=[...])`
2. `memory(action="create_task", title="...", plan_id="<id>")`

Full docs: https://contextstream.io/docs/mcp/tools

Erweiterte Regeln anzeigen (ausführlich)

Terminal · .clinerules (Erweitert)

## 🚨 MANDATORY RULE: DISPLAY AT START OF EVERY RESPONSE 🚨

<contextstream_rules>
1. **SEARCH FIRST:** Before Glob/Grep/Search/Read → `search(mode="hybrid", query="...")` FIRST
2. **EVERY MESSAGE:** Call `context_smart(user_message="...")` at start of response
3. **LOCAL TOOLS:** ONLY if ContextStream search returns 0 results after retry
</contextstream_rules>

**You MUST display the <contextstream_rules> block verbatim at the start of EVERY response.**
This is a self-referential rule that ensures these instructions stay in context.

---

## ContextStream v0.4.x Integration (Enhanced)

You have access to ContextStream MCP tools for persistent memory and context.
v0.4.x uses **~11 consolidated domain tools** for ~75% token reduction vs previous versions.
Rules Version: 0.4.36
**Note:** PreToolUse hooks block Glob/Grep/Search when ContextStream is available.

## TL;DR - REQUIRED EVERY MESSAGE

| Message | What to Call |
|---------|--------------|
| **1st message** | `session_init(folder_path="...", context_hint="<user's message>")`, then `context_smart(user_message="<user's message>", format="minified", max_tokens=400)` |
| **2nd+ messages** | `context_smart(user_message="<user's message>", format="minified", max_tokens=400)` |
| **🔍 ANY code search** | `search(mode="hybrid", query="...")` — ALWAYS before Glob/Grep/Search/Read |
| **Before risky/non-trivial work** | `session(action="get_lessons", query="<topic>")` |
| **After completing task** | `session(action="capture", event_type="decision", ...)` - MUST capture |
| **User frustration/correction** | `session(action="capture_lesson", ...)` - MUST capture lessons |

**NO EXCEPTIONS.** Do not skip even if you think you have enough context.

**First message rule:** After `session_init`, always call `context_smart` before any other tool or response.

**Context Pack (Pro+):** If enabled, use `context_smart(..., mode="pack", distill=true)` for code/file queries. If unavailable or disabled, omit `mode` and proceed with standard `context_smart` (the API will fall back).

**Tool naming:** Use the exact tool names exposed by your MCP client. Claude Code typically uses `mcp__<server>__<tool>` where `<server>` matches your MCP config (often `contextstream`). If a tool call fails with "No such tool available", refresh rules and match the tool list.

---

## Consolidated Domain Tools Architecture

v0.4.x consolidates ~58 individual tools into ~11 domain tools with action/mode dispatch:

### Standalone Tools (Always Call)
- **`session_init`** - Initialize session with workspace detection + context
- **`context_smart`** - Semantic search for relevant context (CALL EVERY MESSAGE, including immediately after `session_init`)

### Domain Tools (Use action/mode parameter)

| Domain | Actions/Modes | Example |
|--------|---------------|---------|
| **`search`** | mode: semantic, hybrid, keyword, pattern, exhaustive, refactor | `search(mode="hybrid", query="auth implementation", limit=3)` |
| **`session`** | action: capture, capture_lesson, get_lessons, recall, remember, user_context, summary, compress, delta, smart_search, decision_trace | `session(action="capture", event_type="decision", title="Use JWT", content="...")` |
| **`memory`** | action: create_event, get_event, update_event, delete_event, list_events, distill_event, create_node, get_node, update_node, delete_node, list_nodes, supersede_node, search, decisions, timeline, summary | `memory(action="list_events", limit=10)` |
| **`graph`** | action: dependencies, impact, call_path, related, path, decisions, ingest, circular_dependencies, unused_code, contradictions | `graph(action="impact", symbol_name="AuthService")` |
| **`project`** | action: list, get, create, update, index, overview, statistics, files, index_status, ingest_local | `project(action="statistics")` |
| **`workspace`** | action: list, get, associate, bootstrap | `workspace(action="list")` |
| **`reminder`** | action: list, active, create, snooze, complete, dismiss | `reminder(action="active")` |
| **`integration`** | provider: slack/github/all; action: status, search, stats, activity, contributors, knowledge, summary, channels, discussions, sync_users, repos, issues | `integration(provider="github", action="search", query="...")` |
| **`help`** | action: tools, auth, version, editor_rules, enable_bundle | `help(action="tools")` |

---

### Why context_smart is Required (Even After session_init)

**Common mistake:** "session_init already gave me context, I don't need context_smart"

**This is WRONG. Here's why:**
- `session_init` returns the last ~10 items **BY TIME** (chronological)
- `context_smart` **SEARCHES** for items **RELEVANT to THIS message** (semantic)

**Example failure:**
- User asks: "how should I implement authentication?"
- Auth decisions were made 20 conversations ago
- `session_init` won't have it (too old, not in recent 10)
- `context_smart` FINDS it via semantic search

**Without context_smart, you WILL miss relevant older context.**

---

### Search & Code Intelligence (ContextStream-first)

⚠️ **STOP: Before using Search/Glob/Grep/Read/Explore** → Call `search(mode="hybrid")` FIRST. Use local tools ONLY if ContextStream returns 0 results.

**❌ WRONG workflow (wastes tokens, slow):**

Grep "function" → Read file1.ts → Read file2.ts → Read file3.ts → endlich verstehen


**✅ CORRECT workflow (fast, complete):**

search(mode="hybrid", query="function implementation") → erledigt (Ergebnisse enthalten Kontext)


**Why?** ContextStream search returns semantic matches + context + file locations in ONE call. Local tools require multiple round-trips.

**Search Mode Selection:**

| Need | Mode | Example |
|------|------|---------|
| Find code by meaning | `hybrid` | "authentication logic", "error handling" |
| Exact string/symbol | `keyword` | "UserAuthService", "API_KEY" |
| File patterns | `pattern` | "*.sql", "test_*.py" |
| ALL matches (grep-like) | `exhaustive` | "TODO", "FIXME" (find all occurrences) |
| Symbol renaming | `refactor` | "oldFunctionName" (word-boundary matching) |
| Conceptual search | `semantic` | "how does caching work" |

**Token Efficiency:** Use `output_format` to reduce response size:
- `full` (default): Full content for understanding code
- `paths`: File paths only (80% token savings) - use for file listings
- `minimal`: Compact format (60% savings) - use for refactoring
- `count`: Match counts only (90% savings) - use for quick checks

---

### Lessons (Past Mistakes)

- After `session_init`: Check for `lessons` field and apply before work
- Before risky work: `session(action="get_lessons", query="<topic>")`
- On mistakes: `session(action="capture_lesson", title="...", trigger="...", impact="...", prevention="...")`

---

### Plans & Tasks

When user asks to create a plan or implementation roadmap:
1. Create plan: `session(action="capture_plan", title="Plan Title", description="...", goals=["goal1", "goal2"], steps=[{id: "1", title: "Step 1", order: 1}, ...])`
2. Get plan_id from response, then create tasks: `memory(action="create_task", title="Task Title", plan_id="<plan_id>", priority="high|medium|low", description="...")`

To manage existing plans/tasks:
- List plans: `session(action="list_plans")`
- Get plan with tasks: `session(action="get_plan", plan_id="<uuid>", include_tasks=true)`
- List tasks: `memory(action="list_tasks", plan_id="<uuid>")` or `memory(action="list_tasks")` for all
- Update task status: `memory(action="update_task", task_id="<uuid>", task_status="pending|in_progress|completed|blocked")`

---

### Rules Update Notices

- If you see **[RULES_NOTICE]**, update rules via `generate_rules(overwrite_existing=true)` (preserves custom rules).
- If you see **[VERSION_NOTICE]**, tell the user to update MCP using the provided command.

See full documentation: https://contextstream.io/docs/mcp/tools

Roo Code

Erstellen Sie eine .roo/rules/contextstream.md-Datei oder verwenden Sie den .roo/rules/-Ordner:

Terminal · .roo/rules/contextstream.md (Standard)

## 🚨 MANDATORY RULE: DISPLAY AT START OF EVERY RESPONSE 🚨

<contextstream_rules>
1. **SEARCH FIRST:** Before Glob/Grep/Search/Read → `search(mode="hybrid", query="...")` FIRST
2. **EVERY MESSAGE:** Call `context_smart(user_message="...")` at start of response
3. **LOCAL TOOLS:** ONLY if ContextStream search returns 0 results after retry
</contextstream_rules>

**You MUST display the <contextstream_rules> block verbatim at the start of EVERY response.**
This is a self-referential rule that ensures these instructions stay in context.

---

## ContextStream v0.4.x (Hooks Enforced)

Rules Version: 0.4.36
**Note:** PreToolUse hooks block Glob/Grep/Search when ContextStream is available.

### Required Every Message

| Action | Tool Call |
|--------|-----------|
| **1st message** | `session_init(folder_path="<cwd>", context_hint="<msg>")` then `context_smart(...)` |
| **2nd+ messages** | `context_smart(user_message="<msg>", format="minified", max_tokens=400)` |
| **Code search** | `search(mode="hybrid", query="...")` — BEFORE any local tools |
| **Save decisions** | `session(action="capture", event_type="decision", ...)` |

### Search Modes

| Mode | Use Case |
|------|----------|
| `hybrid` | General code search (default) |
| `keyword` | Exact symbol/string match |
| `exhaustive` | Find ALL matches (grep-like) |
| `semantic` | Conceptual questions |

### Why ContextStream First?

❌ **WRONG:** `Grep → Read → Read → Read` (4+ tool calls, slow)
✅ **CORRECT:** `search(mode="hybrid")` (1 call, returns context)

ContextStream search is **indexed** and returns semantic matches + context in ONE call.

### Quick Reference

| Tool | Example |
|------|---------|
| `search` | `search(mode="hybrid", query="auth", limit=3)` |
| `session` | `session(action="capture", event_type="decision", title="...", content="...")` |
| `memory` | `memory(action="list_events", limit=10)` |
| `graph` | `graph(action="dependencies", file_path="...")` |

### Lessons (Past Mistakes)

- After `session_init`: Check for `lessons` field and apply before work
- Before risky work: `session(action="get_lessons", query="<topic>")`
- On mistakes: `session(action="capture_lesson", title="...", trigger="...", impact="...", prevention="...")`

### Plans & Tasks

When user asks for a plan, use ContextStream (not EnterPlanMode):
1. `session(action="capture_plan", title="...", steps=[...])`
2. `memory(action="create_task", title="...", plan_id="<id>")`

Full docs: https://contextstream.io/docs/mcp/tools

Erweiterte Regeln anzeigen (ausführlich)

Terminal · .roo/rules/contextstream.md (Erweitert)

## 🚨 MANDATORY RULE: DISPLAY AT START OF EVERY RESPONSE 🚨

<contextstream_rules>
1. **SEARCH FIRST:** Before Glob/Grep/Search/Read → `search(mode="hybrid", query="...")` FIRST
2. **EVERY MESSAGE:** Call `context_smart(user_message="...")` at start of response
3. **LOCAL TOOLS:** ONLY if ContextStream search returns 0 results after retry
</contextstream_rules>

**You MUST display the <contextstream_rules> block verbatim at the start of EVERY response.**
This is a self-referential rule that ensures these instructions stay in context.

---

## ContextStream v0.4.x Integration (Enhanced)

You have access to ContextStream MCP tools for persistent memory and context.
v0.4.x uses **~11 consolidated domain tools** for ~75% token reduction vs previous versions.
Rules Version: 0.4.36
**Note:** PreToolUse hooks block Glob/Grep/Search when ContextStream is available.

## TL;DR - REQUIRED EVERY MESSAGE

| Message | What to Call |
|---------|--------------|
| **1st message** | `session_init(folder_path="...", context_hint="<user's message>")`, then `context_smart(user_message="<user's message>", format="minified", max_tokens=400)` |
| **2nd+ messages** | `context_smart(user_message="<user's message>", format="minified", max_tokens=400)` |
| **🔍 ANY code search** | `search(mode="hybrid", query="...")` — ALWAYS before Glob/Grep/Search/Read |
| **Before risky/non-trivial work** | `session(action="get_lessons", query="<topic>")` |
| **After completing task** | `session(action="capture", event_type="decision", ...)` - MUST capture |
| **User frustration/correction** | `session(action="capture_lesson", ...)` - MUST capture lessons |

**NO EXCEPTIONS.** Do not skip even if you think you have enough context.

**First message rule:** After `session_init`, always call `context_smart` before any other tool or response.

**Context Pack (Pro+):** If enabled, use `context_smart(..., mode="pack", distill=true)` for code/file queries. If unavailable or disabled, omit `mode` and proceed with standard `context_smart` (the API will fall back).

**Tool naming:** Use the exact tool names exposed by your MCP client. Claude Code typically uses `mcp__<server>__<tool>` where `<server>` matches your MCP config (often `contextstream`). If a tool call fails with "No such tool available", refresh rules and match the tool list.

---

## Consolidated Domain Tools Architecture

v0.4.x consolidates ~58 individual tools into ~11 domain tools with action/mode dispatch:

### Standalone Tools (Always Call)
- **`session_init`** - Initialize session with workspace detection + context
- **`context_smart`** - Semantic search for relevant context (CALL EVERY MESSAGE, including immediately after `session_init`)

### Domain Tools (Use action/mode parameter)

| Domain | Actions/Modes | Example |
|--------|---------------|---------|
| **`search`** | mode: semantic, hybrid, keyword, pattern, exhaustive, refactor | `search(mode="hybrid", query="auth implementation", limit=3)` |
| **`session`** | action: capture, capture_lesson, get_lessons, recall, remember, user_context, summary, compress, delta, smart_search, decision_trace | `session(action="capture", event_type="decision", title="Use JWT", content="...")` |
| **`memory`** | action: create_event, get_event, update_event, delete_event, list_events, distill_event, create_node, get_node, update_node, delete_node, list_nodes, supersede_node, search, decisions, timeline, summary | `memory(action="list_events", limit=10)` |
| **`graph`** | action: dependencies, impact, call_path, related, path, decisions, ingest, circular_dependencies, unused_code, contradictions | `graph(action="impact", symbol_name="AuthService")` |
| **`project`** | action: list, get, create, update, index, overview, statistics, files, index_status, ingest_local | `project(action="statistics")` |
| **`workspace`** | action: list, get, associate, bootstrap | `workspace(action="list")` |
| **`reminder`** | action: list, active, create, snooze, complete, dismiss | `reminder(action="active")` |
| **`integration`** | provider: slack/github/all; action: status, search, stats, activity, contributors, knowledge, summary, channels, discussions, sync_users, repos, issues | `integration(provider="github", action="search", query="...")` |
| **`help`** | action: tools, auth, version, editor_rules, enable_bundle | `help(action="tools")` |

---

### Why context_smart is Required (Even After session_init)

**Common mistake:** "session_init already gave me context, I don't need context_smart"

**This is WRONG. Here's why:**
- `session_init` returns the last ~10 items **BY TIME** (chronological)
- `context_smart` **SEARCHES** for items **RELEVANT to THIS message** (semantic)

**Example failure:**
- User asks: "how should I implement authentication?"
- Auth decisions were made 20 conversations ago
- `session_init` won't have it (too old, not in recent 10)
- `context_smart` FINDS it via semantic search

**Without context_smart, you WILL miss relevant older context.**

---

### Search & Code Intelligence (ContextStream-first)

⚠️ **STOP: Before using Search/Glob/Grep/Read/Explore** → Call `search(mode="hybrid")` FIRST. Use local tools ONLY if ContextStream returns 0 results.

**❌ WRONG workflow (wastes tokens, slow):**

Grep "function" → Read file1.ts → Read file2.ts → Read file3.ts → endlich verstehen


**✅ CORRECT workflow (fast, complete):**

search(mode="hybrid", query="function implementation") → erledigt (Ergebnisse enthalten Kontext)


**Why?** ContextStream search returns semantic matches + context + file locations in ONE call. Local tools require multiple round-trips.

**Search Mode Selection:**

| Need | Mode | Example |
|------|------|---------|
| Find code by meaning | `hybrid` | "authentication logic", "error handling" |
| Exact string/symbol | `keyword` | "UserAuthService", "API_KEY" |
| File patterns | `pattern` | "*.sql", "test_*.py" |
| ALL matches (grep-like) | `exhaustive` | "TODO", "FIXME" (find all occurrences) |
| Symbol renaming | `refactor` | "oldFunctionName" (word-boundary matching) |
| Conceptual search | `semantic` | "how does caching work" |

**Token Efficiency:** Use `output_format` to reduce response size:
- `full` (default): Full content for understanding code
- `paths`: File paths only (80% token savings) - use for file listings
- `minimal`: Compact format (60% savings) - use for refactoring
- `count`: Match counts only (90% savings) - use for quick checks

---

### Lessons (Past Mistakes)

- After `session_init`: Check for `lessons` field and apply before work
- Before risky work: `session(action="get_lessons", query="<topic>")`
- On mistakes: `session(action="capture_lesson", title="...", trigger="...", impact="...", prevention="...")`

---

### Plans & Tasks

When user asks to create a plan or implementation roadmap:
1. Create plan: `session(action="capture_plan", title="Plan Title", description="...", goals=["goal1", "goal2"], steps=[{id: "1", title: "Step 1", order: 1}, ...])`
2. Get plan_id from response, then create tasks: `memory(action="create_task", title="Task Title", plan_id="<plan_id>", priority="high|medium|low", description="...")`

To manage existing plans/tasks:
- List plans: `session(action="list_plans")`
- Get plan with tasks: `session(action="get_plan", plan_id="<uuid>", include_tasks=true)`
- List tasks: `memory(action="list_tasks", plan_id="<uuid>")` or `memory(action="list_tasks")` for all
- Update task status: `memory(action="update_task", task_id="<uuid>", task_status="pending|in_progress|completed|blocked")`

---

### Rules Update Notices

- If you see **[RULES_NOTICE]**, update rules via `generate_rules(overwrite_existing=true)` (preserves custom rules).
- If you see **[VERSION_NOTICE]**, tell the user to update MCP using the provided command.

See full documentation: https://contextstream.io/docs/mcp/tools

Regeln automatisch generieren

Sie können die KI auch bitten, diese Regeln automatisch zu generieren, indem Sie sagen: "Verwende generate_rules, um ContextStream-Regeln für dieses Projekt zu erstellen"

Lessons-System

Lessons-Learned-System

Aus Fehlern lernen – sie nie wiederholen

Das Lessons-System erfasst Fehler, Korrekturen und Benutzerfrustrationen, damit KI-Assistenten dieselben Fehler nie wiederholen. Lessons werden automatisch in session_init- und context_smart-Antworten angezeigt, wenn sie relevant sind.

Wann Lessons erfasst werden sollten

Lessons sollten automatisch erfasst werden, wenn eine dieser Situationen eintritt:

AuslöserBeispielSchweregrad
Produktionsproblem"Die Seite ist wegen dieser Änderung down"kritisch
Benutzerfrustration"NEIN! Ich habe dir gesagt, das NICHT zu tun", "WTF", Feststelltastehoch
Korrektur"Das ist falsch, du solltest...", "Behebe das"mittel
Breaking Change"Das hat die Tests kaputt gemacht", "Der Build ist fehlgeschlagen"mittel/hoch
Präferenz geäußert"Ich bevorzuge es so", "Mach immer X stattdessen"niedrig

Erläuterung der Lesson-Felder

FeldBeschreibungBeispiel
titleWoran man sich erinnern soll (imperativ)"Assets vor dem Pushen immer in Git überprüfen"
severitykritisch, hoch, mittel, niedrig"kritisch" für Produktionsprobleme
categoryworkflow, code_quality, verification, communication, project_specific"workflow"
triggerWelche Aktion das Problem verursacht hat"Code gepusht, der auf Bilder verweist, ohne sie zu committen"
impactWas schiefgelaufen ist"Produktions-404-Fehler - defekte Landingpage"
preventionWie man es in Zukunft verhindert"Vor dem Pushen git status ausführen, um nicht verfolgte Dateien zu überprüfen"
keywordsSchlüsselwörter für den Abgleich in zukünftigen Kontexten["git", "images", "assets", "push"]

Vollständiges Beispiel

Terminal · session_capture_lesson

// User says: "OH COME ON! You pushed the code but the images are missing
// and now the production site shows broken images!"

session_capture_lesson({
  title: "Always verify assets in git before pushing code references",
  severity: "critical",
  category: "workflow",
  trigger: "Pushed code referencing /screenshots/*.png without committing images",
  impact: "Production 404 errors - broken landing page with missing images",
  prevention: "Run 'git status' to check untracked files before pushing code that references static assets",
  keywords: ["git", "images", "assets", "push", "404", "static", "screenshots"]
})

Wie Lessons angezeigt werden

Erfasste Lessons werden in zukünftigen Sitzungen automatisch zurückgegeben, wenn sie relevant sind:

session_init

Lessons mit hohem und kritischem Schweregrad aus diesem Arbeitsbereich werden in die Sitzungsinitialisierung aufgenommen und warnen die KI, bevor sie denselben Fehler machen kann.

context_smart

Wenn die KI nach Kontext fragt, werden Lessons, die mit den Schlüsselwörtern der Abfrage übereinstimmen, eingeschlossen. Z. B. werden bei einer Frage zu „git push“ Lessons mit den Schlüsselwörtern „git“ oder „push“ angezeigt.

Lessons abrufen

Verwenden Sie session_get_lessons, um Lessons abzurufen und zu filtern:

Terminal · session_get_lessons Beispiele

// Get all critical lessons
session_get_lessons({ severity: "critical" })

// Get workflow lessons
session_get_lessons({ category: "workflow" })

// Search for relevant lessons
session_get_lessons({ query: "git push images" })

// Combine filters
session_get_lessons({
  category: "verification",
  severity: "high",
  limit: 5
})

Profi-Tipp: Fügen Sie Regeln zu Ihrem Editor hinzu (siehe Abschnitt Editor AI Rules oben), um automatisch Lektionen zu erfassen, wenn Benutzer Frustration oder Korrekturen äußern. So entsteht eine Wissensbasis, die wiederholte Fehler verhindert.

Tool-Katalog

MCP-Tools.

Siehe die vollständige MCP-Tool-Referenz (PRO-Badges und gängige Anwendungsbeispiele).

MCP-Tools-Referenz anzeigenDas konsolidierte Toolset verwendet ~11 Domänen-Tools für ~75 % Token-Reduzierung im Vergleich zu älteren granularen Tools.Lesen

Anwendungsbeispiele

Was Sie fragen können.

Sobald die Verbindung hergestellt ist, können Sie Ihren KI-Assistenten Dinge fragen wie:

„Erinnere dich, dass wir uns für PostgreSQL als Datenbank entschieden haben“

„Was waren unsere früheren Entscheidungen zur Authentifizierung?“

„Durchsuche unsere Codebasis danach, wie wir API-Ratenbegrenzung handhaben“

„Zeige mir verwandten Kontext zum Zahlungssystem“

Lektionsbeispiele

Die KI sollte automatisch Lektionen erfassen, wenn Sie Frustration oder Korrekturen äußern:

Benutzer sagt

„NEIN! Du hast ohne Tests gepusht und jetzt ist die Produktion kaputt!“

→ KI erfasst Lektion mit Schweregrad: kritisch, Kategorie: Verifizierung

Benutzer sagt

„Das ist falsch. Verwende immer snake_case für Datenbankspalten, nicht camelCase.“

→ KI erfasst Lektion mit Schweregrad: mittel, Kategorie: Code_Qualität

Benutzer sagt

„Ich bevorzuge TypeScript Strict Mode. Bitte aktiviere ihn immer.“

→ KI erfasst Lektion mit Schweregrad: niedrig, Kategorie: Projekt_spezifisch

Diese Lektionen werden in zukünftigen Sitzungen automatisch angezeigt, wenn relevanter Kontext angefordert wird.

Wartung

Auf dem neuesten Stand bleiben.

Um die neuesten Funktionen, Fehlerbehebungen und Verbesserungen zu erhalten, aktualisieren Sie den MCP-Server regelmäßig:

Terminal · Terminal · macOS / Linux

curl -fsSL https://contextstream.io/scripts/mcp.sh | bash

Terminal · PowerShell · Windows

irm https://contextstream.io/scripts/mcp.ps1 | iex

Der MCP-Server warnt Sie automatisch, wenn eine neuere Version verfügbar ist. Starten Sie nach der Aktualisierung Ihr KI-Tool neu, um die neue Version zu verwenden.

Fehlerbehebung

Wenn etwas nicht funktioniert.

MCP-Server startet nicht

Stellen Sie sicher, dass contextstream-mcp installiert und in Ihrem PATH verfügbar ist. Versuchen Sie, contextstream-mcp --version manuell auszuführen, um nach Fehlern zu suchen.

Authentifizierungsfehler

Überprüfen Sie, ob Ihr API-Schlüssel korrekt und nicht abgelaufen ist. Sie können einen neuen Schlüssel über Ihr ContextStream-Dashboard generieren.

Tools werden nicht angezeigt

Starten Sie Ihre KI-Anwendung nach dem Ändern der Konfiguration neu. Überprüfen Sie die Anwendungsprotokolle auf MCP-Verbindungsfehler.

Kein Workspace gefunden (Ersteinrichtung)

Wenn Ihr Konto noch keine Workspaces hat, fordert ContextStream Ihren KI-Assistenten auf, Sie nach einem Workspace-Namen zu fragen. Der aktuelle Ordner wird als Projekt erstellt. Siehe MCP-Tools für workspace_bootstrap.

Nächste Schritte

Weiter erkunden.

Team-SetupMitglieder einladen, Kontext teilen.LesenLessons LearnedFehler erfassen, nie wiederholen.LesenMemory EventsMehr über Speichertypen erfahren.LesenSemantische SucheNach Bedeutung suchen.Lesen

{"@context":"https://schema.org","@type":"Organization","name":"ContextStream","url":"https://contextstream.io","logo":"https://contextstream.io/logo.png","description":"Give your AI applications infinite context. Unify code, documentation, and workspace history into a single, queryable intelligence layer with semantic search and knowledge graphs.","sameAs":["https://twitter.com/contextstream","https://github.com/contextstream"]}
{"@context":"https://schema.org","@type":"SoftwareApplication","name":"ContextStream","applicationCategory":"DeveloperApplication","operatingSystem":"Any","description":"Give your AI applications infinite context. Unify code, documentation, and workspace history into a single, queryable intelligence layer with semantic search and knowledge graphs.","offers":{"@type":"Offer","price":"20","priceCurrency":"USD","description":"Pro plan includes a 5-day free trial"},"aggregateRating":{"@type":"AggregateRating","ratingValue":"5","ratingCount":"10"}}