Documentation
¶
Overview ¶
cc-proxy — see what Claude Code actually sends the model.
A transparent logging proxy between Claude Code and the Anthropic API. Point Claude Code at it:
ANTHROPIC_BASE_URL=http://localhost:8787 claude
Directories
¶
| Path | Synopsis |
|---|---|
|
internal
|
|
|
audit
Package audit measures what a /v1/messages request spends its bytes on: tool definitions ranked by size, system prompt, and total request size.
|
Package audit measures what a /v1/messages request spends its bytes on: tool definitions ranked by size, system prompt, and total request size. |
|
capture
Package capture turns raw proxied bytes into the normalized Record that every sink consumes.
|
Package capture turns raw proxied bytes into the normalized Record that every sink consumes. |
|
config
Package config loads proxy configuration with precedence: flags > environment (CAP_*) > JSON config file > defaults.
|
Package config loads proxy configuration with precedence: flags > environment (CAP_*) > JSON config file > defaults. |
|
cost
Package cost estimates request cost in USD from token usage and a per-model pricing table.
|
Package cost estimates request cost in USD from token usage and a per-model pricing table. |
|
proxy
Package proxy implements the transparent reverse proxy in front of the Anthropic API, teeing request/response bytes to a capture callback without ever delaying the client stream.
|
Package proxy implements the transparent reverse proxy in front of the Anthropic API, teeing request/response bytes to a capture callback without ever delaying the client stream. |
|
sink
Package sink defines the pluggable capture-consumer interface and the fan-out dispatcher that keeps every sink off the proxy's hot path.
|
Package sink defines the pluggable capture-consumer interface and the fan-out dispatcher that keeps every sink off the proxy's hot path. |
|
sink/clickhouse
Package clickhouse ships analytics rows to ClickHouse over its HTTP interface (INSERT ...
|
Package clickhouse ships analytics rows to ClickHouse over its HTTP interface (INSERT ... |
|
sink/loki
Package loki pushes capture records as structured log lines to Grafana Loki via its HTTP push API.
|
Package loki pushes capture records as structured log lines to Grafana Loki via its HTTP push API. |
|
sink/markdown
Package markdown writes per-request files, format-compatible with the original agent-proxy gist (gist.github.com/mattpocock/5b3d76ea21f5f698aefded47a9cea3b1): a readable .md audit document plus the raw request body as .request.txt.
|
Package markdown writes per-request files, format-compatible with the original agent-proxy gist (gist.github.com/mattpocock/5b3d76ea21f5f698aefded47a9cea3b1): a readable .md audit document plus the raw request body as .request.txt. |
|
sink/sqlite
Package sqlite persists capture records to an embedded SQLite database (pure-Go driver, no CGO) for local ad-hoc querying.
|
Package sqlite persists capture records to an embedded SQLite database (pure-Go driver, no CGO) for local ad-hoc querying. |
|
sink/terminal
Package terminal prints the compact per-request audit table — the live view of what is eating your context.
|
Package terminal prints the compact per-request audit table — the live view of what is eating your context. |
|
sse
Package sse decodes Anthropic Messages API responses — both streamed SSE and plain JSON bodies — into a normalized shape for the capture pipeline.
|
Package sse decodes Anthropic Messages API responses — both streamed SSE and plain JSON bodies — into a normalized shape for the capture pipeline. |
|
version
Package version exposes build metadata injected via -ldflags.
|
Package version exposes build metadata injected via -ldflags. |
Click to show internal directories.
Click to hide internal directories.