ccglass
A lightweight local logging reverse-proxy plus web dashboard that shows exactly what your coding agent — Claude Code, Codex, Kimi — sends to the model, in real time.
Evidence: tool intercepts only the plain-HTTP localhost hop by default, masks auth tokens by default (--no-redact opt-out), CodeBuddy MITM is host-scoped to copilot.tencent.com with other HTTPS passing through, CA key stays in a session dir without system trust. Deducted: masking/interception implementation code is not in evidence, so static verification is impossible; CodeBuddy mode instructs disabling proxyStrictSSL, which lowers security posture.
Evidence: node --test suite covers session resolution, blob store, and CA generation; prepublishOnly enforces tests; the Codex ChatGPT-login blind spot is documented with a diagnostic (codex doctor). Deducted: Bedrock direct-endpoint failure is only warned about rather than fixed; no retry/failure-recovery mechanism is described.
Evidence: audience (developers debugging coding agents) and scenarios (CLI wrap, IDE BYOK, forward-proxy) are clearly segmented; limitations (Cursor subscription models, SigV4 Host signing) are stated. Deducted: environment guidance is macOS/Node-centric; Windows has a single PR mention, thin cross-platform evidence.
Evidence: README is well structured (why/providers table/usage/options/logs), MIT LICENSE matches package., dual install channels (npm/brew), detailed contributor attribution with PR links. Deducted: no CHANGELOG file — version history is inferable only from git tags; tests cover only three modules and src is absent from evidence; alias naming (dsnix, reasonix) rests on docs, not structure.
Evidence: rich output forms (dashboard, raw/md//har export, copy-as-cURL, usage rollup), content-addressed storage avoids quadratic growth, clear marginal value for the 'see what the agent sends' need. Deducted: cost estimation depends on a per-provider price table with no stated source or update mechanism; MCP self-inspection is injected by default requiring --no-mcp to opt out, making its cost/benefit implicit.
Evidence: README claims cross-check with package. (bin, engines, deps) and the shipped tests (blobs, CA, session naming); contributor claims point to specific PR numbers. Deducted: demo.gif is unverifiable external media; the core proxy source is not in evidence; the 'no runtime dependencies' claim versus three entries in dependencies (explained as optional MCP) requires user-side verification.
- Static review executed no code: masking logic, MITM scope, and dependency security rest on README and test assertions only; src was not in evidence.
- CodeBuddy mode asks you to disable proxyStrictSSL to trust an auto-generated CA; always remove the proxy settings afterwards and never expose the CA key directory or add it to system trust.
- Captured logs contain full prompts and message histories; even with default token masking, treat ~/.ccglass as sensitive and never commit or share it.
- MCP self-inspection tools are injected into Claude Code sessions by default; pass --no-mcp if unwanted.
- No CHANGELOG exists; behavioral differences around v1.1.2 must be compared via git history or release notes yourself.
- Direct AWS Bedrock endpoints fail through the proxy due to SigV4 Host signing with only a printed warning — do not mistake it for a network fault.
What does this agent do, and when should you use it?
ccglass is a local logging reverse-proxy with a web dashboard for observing the real requests made by coding-agent CLIs. It redirects traffic by setting the client's base-URL environment variable (e.g. ANTHROPIC_BASE_URL, OPENAI_BASE_URL); the client still performs its own HTTPS to the real API, so no CA certificates are needed and TLS pinning is avoided. The dashboard shows the full system prompt, tool schemas, message history, token/cache/cost numbers, a turn-to-turn diff, and a sequence diagram of the agent loop. Supported clients include Claude Code, Codex, DeepSeek-TUI, Reasonix, CodeBuddy, Kimi, and OpenCode, with upstreams spanning Ollama, LM Studio, OpenRouter, AWS Bedrock, and Google Vertex AI. For clients with hardcoded upstream URLs (like Tencent's CodeBuddy), it offers a forward-proxy mode with targeted TLS MITM. Captures are stored content-addressed (git-style) under ~/.ccglass/sessions/ with auth tokens masked by default. It installs globally via npm or Homebrew and starts with a single command.
Running ccglass (or ccglass claude, ccglass codex, etc.) starts a local proxy, points the client at it via the right base-URL env var, launches the client, and opens a dashboard at http://127.0.0.1:<port>. The dashboard provides: a live request stream (expandable system prompt, messages, tools), an agent-loop sequence diagram pairing tool_use and tool_result by call_id with color coding, a turn-to-turn diff highlighting added context and cache breakpoints, exact token/cache-hit/cost numbers from response usage, streamed SSE reassembled into final messages, export to raw HTTP / Markdown / JSON / HAR, session summaries, per-request latency with trend sparklines, Copy as cURL replay, light/dark themes, and optional MCP self-inspection (registers query tools into Claude Code so the agent can inspect its own requests; disable with --no-mcp). Captures go to ~/.ccglass/sessions/<project-path>-<hash>/ in content-addressed format with authorization and x-api-key masked; ccglass view reopens saved logs, ccglass migrate copies legacy ./.ccglass data into the global store, and ccglass export dumps a specific request. For CodeBuddy, whose upstream copilot.tencent.com is hardcoded, ccglass codebuddy runs a forward proxy intercepting HTTP CONNECT tunnels with targeted TLS MITM and an auto-generated local CA.
- An engineer debugging agent prompts who suspects Claude Code's system prompt or tool list differs from expectations and wants to read the raw request each turn.
- A team controlling API spend that needs per-request token, cache-hit-rate, and estimated USD figures to see where a session's cost comes from.
- A developer investigating context bloat, using the turn-to-turn diff to see exactly which blocks were added this turn and where cache breakpoints land.
- A user of local or third-party models who inspects OpenAI-compatible clients via ccglass ollama, lmstudio, openrouter, or glm providers.
- A Tencent CodeBuddy user whose built-in models hardcode copilot.tencent.com and therefore require the forward-proxy mode (HTTP CONNECT + TLS MITM).
- An IDE user (Cursor BYOK, Cline, Continue.dev) who runs ccglass proxy and points the IDE's API base URL at the proxy address to observe requests.
What are this agent's strengths and limitations?
- Intercepts only the plain HTTP hop to localhost via base-URL env vars while the client does its own HTTPS — no CA certs needed, and it sidesteps TLS pinning and brittle fetch-patching.
- Broad coverage: native providers for Claude Code, Codex, DeepSeek-TUI, Reasonix, CodeBuddy, Kimi, OpenCode, Qoder, Ollama, LM Studio, OpenRouter, GLM/Zhipu, Bedrock, and Vertex, plus a generic run + --env-var escape hatch.
- Feature-rich dashboard: live request stream, agent-loop sequence diagram, turn-to-turn diff, exact token/cache/cost, SSE reassembly, raw/MD/JSON/HAR export, Copy as cURL, and theming.
- Auth tokens are masked by default and content-addressed storage prevents quadratic log growth; optional MCP self-inspection lets the agent query its own requests in-chat.
- Codex capture only works in API-key mode; ChatGPT-login mode uses a wss://chatgpt.com WebSocket transport that bypasses OPENAI_BASE_URL, leaving the dashboard empty.
- Direct AWS Bedrock endpoints (*.amazonaws.com) fail through the proxy because SigV4 signs the Host header — only Bedrock-compat gateways work.
- IDE support is limited to BYOK custom base-URL setups; Cursor's subscription models route through api2.cursor.sh and cannot be intercepted.
- CodeBuddy's TLS MITM requires disabling proxyStrictSSL and trusting an auto-generated local CA — invasive settings that must be manually cleaned up afterwards.
How do you install or deploy this agent?
Requires Node.js >= 18. Install with either:
npm install -g ccglassor:
brew install jianshuo/tap/ccglassHow do you use this agent?
Basic usage:
ccglass # interactively pick a client to inspect
ccglass claude # inspect Claude Code (args pass through, e.g. --resume)
ccglass codex # inspect Codex (API-key mode required; ChatGPT login uses WebSocket and bypasses the proxy)
ccglass kimi # Claude Code to Moonshot; set ANTHROPIC_AUTH_TOKEN
ccglass codebuddy # forward-proxy mode; set "http.proxy": "http://127.0.0.1:9999" and "http.proxyStrictSSL": false in your IDEEach client needs its own credentials (OPENAI_API_KEY, DEEPSEEK_API_KEY, Zhipu's OPENAI_API_KEY, etc.). Generic escape hatch for any client:
ccglass run --upstream https://my.custom.api/v1 --env-var MY_CUSTOM_BASE_URL -- my-toolProxy-only mode for IDEs:
ccglass proxy --provider openaiOther commands: ccglass view (reopen dashboard over saved logs), ccglass usage (token + USD rollup), ccglass export <session>/<seq> --format raw|md||har, ccglass migrate, ccglass rm <session>. The dashboard runs at a URL like http://127.0.0.1:57633; press Ctrl-C to stop.