ContextGuard CLI Reference

Updated August 2026

The ContextGuard CLI is designed for instant execution with no latency in your developer terminal. All commands support the --json flag for CI/CD pipeline integration.

contextguard

Run a quick report on the current Claude Code session: tokens spent, cost estimate, and cache hit ratio.

contextguard

contextguard init --api-key <KEY>

Initialize the project, install runtime hooks, and connect to the dashboard via your API key.

contextguard init --api-key <KEY>

contextguard context

Audit your persistent context (CLAUDE.md, rules, system prompts) with cost-per-100-requests breakdown.

contextguard context

contextguard lint --fix

Automatically compress system rules, remove duplicate instructions, and reformat for prompt caching.

contextguard lint --fix

contextguard watch

Background watcher mode (Circuit Breaker): intercepts looping commands and prevents infinite file reads.

contextguard watch

contextguard --push --api-url <URL> --api-key <KEY>

Sync aggregated daily metrics to the web dashboard without sending any source code.

contextguard --push --api-url <URL> --api-key <KEY>

contextguard status

Check connection status, hook activity, and current session health.

contextguard status