跪拜 Guibai
← All articles
AI Coding · Artificial Intelligence · Open Source

claude-tap Intercepts 16 AI Coding CLIs So You Can See Every Request They Send

By 狂师 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

Prompt engineers and agent developers debugging opaque AI coding tools now have a Wireshark-equivalent that reveals exactly what each CLI sends to the model. Seeing the raw requests — system prompts, tool definitions, context diffs — replaces guesswork with data, and the automatic key redaction plus self-contained HTML exports make it safe to share traces with a team or in a GitHub issue.

Summary

AI coding assistants are black boxes — they work, but you never see the raw requests they send to the model. claude-tap inserts a local proxy between any of 16 supported CLIs and their APIs, recording every request and response into a self-contained HTML viewer. It covers Claude Code, Codex CLI, Gemini CLI, Cursor, Kimi Code, CodeBuddy, and more, handling both reverse-proxy and forward-proxy modes depending on whether the tool supports custom base URLs.

The standout feature is a structured diff view that shows character-level changes between consecutive requests. System prompt edits, tool list additions, conversation history concatenation order, and hidden instruction insertions all become visible. Token usage is broken down into input, output, cache reads, and cache creation.

Installation is a single `uv tool install claude-tap` command. The tool auto-launches a proxy, a browser viewer, and the target CLI. API keys are automatically redacted before storage, and exported traces are zero-dependency HTML files that anyone can open.

Takeaways
claude-tap is an MIT-licensed local proxy that intercepts API traffic between AI coding CLIs and model providers, recording every request and response.
It supports 16 CLIs: Claude Code, Codex CLI, Codex App, Gemini CLI, Grok Build CLI, Kimi CLI, Kimi Code, MiMo Code, Cursor, Qoder, Antigravity, OpenCode, OpenClaw, Pi, Hermes Agent, and CodeBuddy CLI.
A structured diff view highlights character-level changes between consecutive requests — system prompt edits, tool list modifications, and context accumulation order.
Token usage is broken into input tokens, output tokens, cache reads, and cache creation for cost optimization.
API keys are automatically redacted before storage, and exported traces are self-contained HTML files with zero external dependencies.
Installation is `uv tool install claude-tap`; running `claude-tap` starts the proxy, viewer, and target CLI in one step.
Real-time mode pushes request records to the browser via SSE while the conversation is still in progress.
AWS Bedrock traffic is captured across all three access methods: Anthropic gateway, enterprise proxy, and native SigV4.
Conclusions

AI coding tooling has crossed a maturity threshold where developers now demand visibility into request internals — system prompts, tool definitions, and context management — rather than just evaluating output quality by feel.

The 16-CLI coverage is unusually broad and signals that the proxy approach (reverse for configurable base URLs, forward with TLS decryption for locked-down clients) generalizes well across the fragmented coding-assistant landscape.

Character-level diffing of multi-turn agent requests is a genuinely under-served debugging primitive; most observability tools stop at single-request inspection and miss how context mutates across turns.

Self-contained HTML trace exports with automatic secret redaction lower the friction for sharing debugging evidence in issues, code reviews, and compliance audits — a design choice that prioritizes collaboration over dashboard lock-in.

Concepts & terms
Reverse proxy mode
The client's API base URL is pointed at the local proxy, which forwards requests to the real API. The client sees no difference; the proxy intercepts all traffic transparently.
Forward proxy mode with TLS decryption
Traffic is routed through the proxy via the HTTPS_PROXY environment variable. A self-signed CA certificate is installed locally so the proxy can decrypt TLS traffic, then re-encrypt it before forwarding.
Structured diff
A character-level comparison between two consecutive API requests, highlighting additions, deletions, and modifications in system prompts, tool definitions, and conversation history.
JSONL trace file
A line-delimited JSON format where each line is a complete JSON object representing one recorded request or response event, used for streaming and incremental processing.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗