# ContextRadar (context-radar-mcp)

> See how full your Antigravity context really is, why a turn slowed down, and when /compact actually pays off. Request `Accept: text/markdown` for content negotiation or fetch `https://contextradar.eatingdream.dev/index.md` directly.

## Agent Endpoints

- [Search for Agents](https://contextradar.eatingdream.dev/.well-known/search?q={query}): Site-wide Markdown search supporting `GET ?q=...` and HTTP `QUERY` (`text/plain` or JSON `{"q":"..."}`).
- [Markdown Page Mirror](https://contextradar.eatingdream.dev/index.md): Clean Markdown mirror with YAML frontmatter.
- [Full Technical Spec](https://contextradar.eatingdream.dev/llms-full.txt): Complete self-contained technical specification, operational matrix, MCP tools, and CLI reference.
- [Agent Skills Discovery](https://contextradar.eatingdream.dev/.well-known/agent-skills/index.json): Machine-readable Agent Skills Discovery v0.2.0 index with SHA-256 digests.
- [XML Sitemap](https://contextradar.eatingdream.dev/sitemap.xml): Canonical URL index.
- [Atom Feed](https://contextradar.eatingdream.dev/feed.xml): Machine-readable Atom 1.0 feed.

## Metadata

- Official Site: https://contextradar.eatingdream.dev/
- Suite Hub: https://eatingdream.dev/
- Repository: https://github.com/eatingDream-antigravity-plugins/context-radar-mcp
- AI Guide: https://github.com/eatingDream-antigravity-plugins/context-radar-mcp/blob/main/docs/ai-guide.md
- Upstream llms.txt: https://github.com/eatingDream-antigravity-plugins/context-radar-mcp/blob/main/llms.txt
- Platform: macOS · Linux
- License: MIT

## Quick Install

```sh
curl -fsSL https://raw.githubusercontent.com/eatingDream-antigravity-plugins/context-radar-mcp/main/scripts/install.sh | sh
```

## Portable Agent Skill

```sh
npx skills add eatingDream-antigravity-plugins/context-radar-mcp
```

## MCP Tools

- `context_radar_overview`: Live status (ready/running/waiting/error), headroom, thinking share, Stream/E2E speed, loop rollup, and subagents.
- `context_radar_turns`: Per-turn tokens, cache hit rate, 3-way cold-cache attribution, TTFT, speed, and cost.
- `context_radar_hotspots`: Locate context spikes (hotspots) or distill a step range into scratch/ (distill, save_note: true).
- `context_radar_prepare_handoff`: Evaluate budget tier, cooldown, subagent drain, and break-even economics.
- `context_radar_commit_handoff`: Issue a scoped single-use grant for /compact or fresh-chat handoff.

## Key Capabilities

- **Live 4-State Budget & Headroom**: Tracks main sessions and subagents (ready, running, waiting, error), remaining token headroom, KV cache hit rate, thinking vs response share, and Stream/E2E speed.
- **3-Way Cold-Cache Miss Attribution**: Separates normal new-turn misses, mid-loop cache breaks (slow-turn TTL expiry, spillover, model switches), and post-compact rebuilds—with cross-model /compact warnings.
- **Prefix-Safe Slice Distillation**: Extracts concise digests of bloated turn ranges into out-of-band scratch/ files via O_NOFOLLOW checks and atomic 0600 renames so your active KV prefix stays hot.
- **Pinned vs Recent Session Cards**: Dark-first zero-flash side panel with a single focus hero, horizontal subagent dock, mini-bar turn hotspots, and deterministic Pinned vs Recent session cards.
- **Gated /compact & Fresh Handoffs**: Evaluates budget tiers, active subagents, and break-even turns before dispatching through official SEP-1865 ui/message or pure-protocol ACP v1.
- **Session Guardrails & Fail-Closed Grants**: Prevents short shell commands from backgrounding prematurely; one-time handoff grants bind strictly to conversation_id and workspace in 0600 files.

## Safety & Privacy

- 100% local & read-only: opens Antigravity SQLite ledgers with SQLITE_OPEN_READ_ONLY plus incremental WAL/JSONL tailing.
- Atomic symlink-safe writes: scratch/ digests traverse directories with O_NOFOLLOW checks and atomic 0600 temp-file renames.
- Fail-closed grants & ACP auth: headless acp-run cancels allow-only prompts unless --auto-approve is explicitly set.
- Strict panel CSP: single self-contained HTML bundle (default-src 'none'), zero external assets, and zero innerHTML writes.
