# jianshuo/ccglass — AlpLab Radar Static Code Audit

- Ring: `adopt`
- Category: `dev`
- Overall score: `4.1/5`
- Implementation check: `verified`
- Maturity: `active`
- Audited commit: `aebfed32d1e9` (read-only; nothing from the repository was executed)
- Reviewed at: 2026-12-01T20:26:55Z
- Repository: https://github.com/jianshuo/ccglass
- Radar entry: https://radar.alplab.co/#repo/jianshuo/ccglass
- License: `MIT`
- CI workflows: `.github/workflows`
- Tags: `claude-code`, `codex`, `reverse-proxy`, `llm-debugging`, `token-cost`, `dashboard`

## Summary

A dependency-light Node logging reverse proxy plus localhost web dashboard that captures, persists (content-addressed blobs), reassembles, and renders every request coding agents (Claude Code, Codex, DeepSeek-TUI, Reasonix, Kimi, etc.) send to LLM APIs, with token/cost rollups, diffing, exports, and an optional self-inspection MCP server.

## Implementation Check

Every core README claim maps to working code — the 18-provider table is src/providers.js PROVIDERS, MCP self-inspection is src/mcp.js registerTool(list_sessions/usage_summary/recent_requests/request_detail), forward-proxy MITM is src/forward-proxy.js createForwardProxy — though the 'core proxy + dashboard have no runtime dependencies' claim is contradicted by the cross-spawn dependency imported unconditionally in src/spawn-command.js.

## When to Use

Use it whenever you need to see exactly what a coding agent sends to the model — system prompts, tool schemas, message history, cache/token/cost — or to debug a provider switcher/gateway misconfiguration; not for clients whose traffic ignores base-URL env vars (Codex in ChatGPT-login mode uses a WebSocket transport and stays invisible, and direct AWS Bedrock SigV4 endpoints fail through the proxy, both warned in src/cli.js).

## Sub-scores

| Dimension | Score |
|---|---|
| quality | 4.5/5 |
| usability | 4.5/5 |
| reliability | 3.0/5 |
| security | 4.0/5 |
| integration | 4.5/5 |

## Code Evidence

src/proxy.js createProxy is a plain-HTTP localhost reverse proxy that records request+streamed response and forwards to the upstream, stripping accept-encoding; src/forward-proxy.js createForwardProxy implements CONNECT tunneling with TLS MITM restricted to a targetSet (copilot.tencent.com) and a side-channel src/http-response-parser.js ResponseParser so the raw pipe is untouched; src/ca.js ensureCA/signHost generate a local CA and per-host certs via openssl; src/store.js Store masks authorization/x-api-key via mask() by default and persists v2 manifests referencing sha256 blobs from src/blobs.js packRecord/unpackRecord (test/store.test.js 'growing-prefix sessions store O(N) blobs' verifies the dedup bound); src/formats/openai.js reassemble handles both Chat Completions SSE chunks and Responses API events with cost tables in src/tokens.js costFromUsage and openai.js PRICES; src/server.js createServer exposes /api/* + SSE /api/stream with serveStatic prefix-guarded to WEB_DIR; src/cli.js orchestrates upstream resolution (settingsEnvBaseUrl, codexConfigBaseUrl, detectCodexChatGPTAuth) and spawns the wrapped client via src/spawn-command.js; 23 node:test files cover store, blobs, formats, providers, proxy, server, and web/app.js is exercised headless in test/web-live.test.js via vm with a fake DOM.

## Issues Found

src/ca.js ensureCA/signHost interpolate file paths and hostnames into execSync shell-command strings (lines 23, 60, 65) — a command-injection-shaped pattern, not reachable in normal use because MITM targets are hardcoded in providers.js and paths are local, but fragile if target sets ever become user-supplied; .github/workflows/claude.yml auto-fix runs with allowed_non_write_users: "*" on every newly opened issue with Bash enabled — a prompt-injection surface on the repo's own CI; no CI workflow runs `npm test` on push or PR (tests only run in publish.yml on tag push, so regressions on main are untested); src/proxy.js buffers each full response body in memory (respChunks) before persisting, which can balloon for very large non-streamed responses.

## Key Risks

Nothing was executed — test coverage is observed statically; Node >= 18 plus openssl on PATH are required for CodeBuddy MITM mode; captured prompts persist in plaintext under ~/.ccglass (only auth headers are masked), so the log dir must be treated as sensitive; cost estimates rely on hardcoded price tables (src/tokens.js, src/formats/openai.js) that will drift as vendors change pricing; GitHub Actions are tag-floating (@v4, unpinned per maturity signals) and the auto-fix workflow grants an agent Bash on every new issue from any actor.

## Reviewed Files

- `README.md`
- `package.json`
- `src/cli.js`
- `src/proxy.js`
- `src/store.js`
- `src/providers.js`
- `src/forward-proxy.js`
- `src/ca.js`
- `src/mcp.js`
- `src/server.js`
- `src/paths.js`
- `src/spawn-command.js`
- `src/usage.js`
- `src/blobs.js`
- `src/child-args.js`
- `src/tokens.js`
- `src/export.js`
- `src/agent-sessions.js`
- `src/formats/openai.js`
- `src/formats/anthropic.js`
- `test/store.test.js`
- `test/web-live.test.js`
- `.github/workflows/claude.yml`
- `.github/workflows/publish.yml`
- `.github/workflows/claude-code-review.yml`
