# Grok × Tokenade

> Tokenade hooks into Grok; a few layers stay partial, detailed below.

## What `tokenade install` does

- Hooks in `~/.grok/hooks/tokenade.json`: SessionStart and PreCompact (Grok's PreToolUse can only allow/deny, and PostToolUse output is ignored).
- So tool output is folded by the local proxy, set in `~/.grok/config.toml` (`[endpoints] models_base_url`). A local LLM proxy (loopback only, started at boot) sits between you and the model API and folds tool results inside each request. `tokenade install` checks it answers before switching you over and restores your original config otherwise.
- Rules: `~/.grok/rules/tokenade.md`.
- MCP: every third-party server in `~/.grok/config.toml` is wrapped as `tokenade mcp-proxy -- <original command>` (original kept, undone by `tokenade uninstall`), so its results reach you folded.

## Coverage

- ◐ Command compaction — Partial
- ◐ Web search — Partial
- ✓ MCP optimization — Supported
- ✓ Code search — Supported
- ◐ Lean output — Partial
- ✓ Context optimization — Supported
- ✓ Re-read dedup — Supported
- ◐ Documents & media — Partial
- ✓ Privacy — Supported
- ✓ Secret redaction — Supported

## What isn't compressed

- Without the proxy, call `tokenade wrap` / `web` / `read` yourself.

## Install

    npm install -g @tokenade/cli
    tokenade install
    tokenade login

`tokenade uninstall` restores every file it touched.

## Read next

- https://tokenade.net/tokenade.md
- https://tokenade.net/install.md
- https://tokenade.net/en/docs/compatibility
