Docs & Quickstart

Every command below is real and copy-pasteable — this is the exact path from zero to a running audit.

1. Install the CLI

There's no crates.io publish yet, so building from source with cargo is the only install path that works today — see the CLI's README for why, and for prebuilt binaries once they land.

cargo install --git https://github.com/ChevvyOkK/contextguard contextguard

2. Run your first audit

Points at every local Claude Code session transcript on this machine and prints cost, cache-hit rate, and where tokens leak. Nothing leaves your disk.

contextguard

3. See what's actually in your context window

The flagship command: breaks a session's context window down by source — system prompt, MCP tool definitions, tool results, conversation history — and names a specific, priced action, like which unused MCP servers to drop.

contextguard context

4. Lint your CLAUDE.md

Finds boilerplate, duplicate lines, and stale references in your CLAUDE.md, prices what each one costs per month, and (with --fix) shows a diff before writing anything.

contextguard lint --fix

5. Install the plugin for real-time protection

Unlike the CLI, the plugin sits in Claude Code's own hooks and acts while a session is running — trimming noisy Bash output, capping runaway Grep results, and (opt-in) warning when an agent looks stuck. It never blocks a tool call unless you explicitly turn that on.

/plugin marketplace add ChevvyOkK/contextguard-plugin
/plugin install contextguard@contextguard

6. Push aggregates to the dashboard (optional)

Sends one aggregated row per day — token counts by category, session count, an estimated cost. Never code, prompts, tool names, or file paths. Everything above this line works with zero account.

contextguard --push --api-url https://your-dashboard.example.com --api-key cg_live_...

Where to go next