What Every AI Coding Agent Request Does – Inside the Open‑Source claude‑tap Tool
claude‑tap is an open‑source local proxy and trace viewer that intercepts AI coding agent API calls, records full request and response details, shows token usage, provides diff and live views, and exports self‑contained HTML reports, supporting nine major AI coding clients with a single command install.
Overview
claude‑tap is a local proxy and trace viewer for AI coding agents. It intercepts all API traffic between a client and the remote model API, records each request and response in JSONL, and provides visual inspection.
Key capabilities
Full request visibility : system prompt, conversation history, tool definitions, streaming chunks and token usage are displayed.
Adjacent request diff : character‑level highlighted diff between consecutive requests, showing added/removed messages and system‑prompt changes.
Token usage analysis : input tokens, output tokens, cache hits and creations per request.
Live viewer : --tap-live streams trace data to a browser via Server‑Sent Events.
Offline archive : on exit a self‑contained HTML file is generated for local review or sharing.
Local data storage : all traces remain on the user’s machine; authentication headers are redacted.
Supported clients
Works with nine AI coding CLIs: Claude Code, Codex CLI, Gemini CLI, Kimi CLI, OpenCode, Pi, Hermes Agent, Cursor CLI, Qoder CLI.
Installation
uv tool install claude-tap pip install claude-tapBasic usage
Trace the default client (Claude Code): claude-tap Enable live view: claude-tap --tap-live Switch to another client (examples):
# Codex CLI
claude-tap --tap-client codex
# Gemini CLI
claude-tap --tap-client gemini -- -p "hello"
# Kimi CLI
claude-tap --tap-client kimi
# Cursor CLI
claude-tap --tap-client cursor -- -p --trust --model auto "hello"Run only the proxy: claude-tap --tap-no-launch --tap-port 8080 Open an offline trace archive:
claude-tap dashboardImplementation details
Clients that allow a custom base URL (Claude Code, Codex CLI) use reverse‑proxy mode: the client’s endpoint is pointed to the local proxy, which forwards the request to the real API.
Clients that cannot change the endpoint (Gemini CLI, OpenCode, Pi) use forward‑proxy mode: traffic is routed through HTTPS_PROXY to the local proxy, which uses a self‑signed CA to decrypt TLS.
All intercepted traffic is written as JSONL traces. In live mode the traces are pushed to the browser via SSE; on termination the traces are bundled into a self‑contained HTML file.
Typical workflow
Install the tool.
Run claude-tap (or with --tap-client for a specific CLI).
Observe real‑time updates in the browser if --tap-live is used.
After the session ends, open the generated HTML file to review request/response payloads, token counts and diffs.
Repository
https://github.com/liaohch3/claude-tap
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Java Backend Technology
Focus on Java-related technologies: SSM, Spring ecosystem, microservices, MySQL, MyCat, clustering, distributed systems, middleware, Linux, networking, multithreading. Occasionally cover DevOps tools like Jenkins, Nexus, Docker, and ELK. Also share technical insights from time to time, committed to Java full-stack development!
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
