# Qwen Code × Tokenade

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

## What `tokenade install` does

- Hooks in `~/.qwen/settings.json` (Claude Code event names: PreToolUse, SessionStart, UserPromptSubmit); `hooks.enabled` must be true.
- Rules: `~/.qwen/QWEN.md`.
- MCP: every third-party server in `~/.qwen/settings.json` is wrapped as `tokenade mcp-proxy -- <original command>` (original kept, undone by `tokenade uninstall`), so its results reach you folded.
- Local proxy via `env.OPENAI_BASE_URL` in settings.json. 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.

## Coverage

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

## What isn't compressed

- Windows: `cmd.exe` can't parse the hook's quoting, so shell output is folded by the local proxy rather than in the hook.

## 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
