KT — gwpoc: the Claude Code Inspection Gateway
Audience: an engineer (hi Ashik) testing or extending the gwpoc spike. Goal: understand the whole thing end-to-end — what it proves, how the pieces wire together, how to drive the two-lane demo, and exactly where the honest edges are.
Status legend used throughout: 🟢 LIVE (merged, running on the devbox) · 🟡 QUIRK/CAVEAT (works, with a sharp edge you should know) · 🔵 DEV-ONLY (depends on the beta-dev stack's trust model) · 🟠 FOUNDER-GATED/PARKED (exists but requires a human grant or decision).
This is a spike, not a product (
README.mdsays so in its header). It informs core#2616 (Claude Agent SDK as coder runtime), which isawaiting-approval— nothing here is an accepted platform direction. Treat every claim as "demonstrated on the devbox," not "shipped."
Canonical code: upsquad-client → tools/gateway-poc/ @ 49ca8e4e (PR client#804, 33 files, Go 1.25, zero external deps). The devbox operating copy /opt/upsquad/ops/gateway-poc carries the same 33 source files byte-for-byte (verified 2026-08-21; the devbox tree additionally holds untracked runtime state — captures, lanes, binaries — that never leaves the box). All file:line references below resolve in either tree.
1. What it is, in one paragraph
gwpoc serve is an inspecting pass-through proxy between an unmodified Claude Code and api.anthropic.com. Point the CLI at it with one env var (ANTHROPIC_BASE_URL=http://localhost:8787) — keys untouched — and every exchange is forwarded faithfully (SSE unbuffered, ~0.8 ms p50 overhead) while a structured record lands on disk: who (four identity carriers), what (masked full-prompt attestation + tool calls), and what it cost (all four token classes, cache-aware — a naive input-token meter misreads real sessions by ~10×). On top of that sit the two-lane demo: the same CLI run "vanilla" vs "upsquad" (a PreToolUse hook enforcing the live GovernanceService cascade + an MCP shim serving Context-Engine retrieval), with per-session verdicts (delivered / cut_off / …) computed mechanically from the wire format, side by side in a Compare UI.
2. At a glance
| Piece | What | Status |
|---|---|---|
gwpoc serve (serve.go) | the proxy + capture pipeline, :8787 loopback via systemd gwpoc.service | 🟢 v0.6.0, 3d+ uptime, NRestarts=0 |
Identity (identity.go) | 4 carriers, precedence header > path > keymap > metadata | 🟢 (keymap dormant — identities.json is comment-only by design) |
Capture (capture.go, mask.go) | append-only JSONL ledger (fsync/row) + masked body sidecars |