liaohch3/claude-tap

Intercept and inspect Coding Agent API traffic from Claude Code, Codex CLI, Gemini CLI, Cursor CLI, OpenCode, Kimi/Kimi Code, Pi, and Hermes in a local trace viewer.

What it solves

claude-tap is a local proxy and trace viewer designed to make the internal workings of AI coding agents transparent. It allows developers to inspect the actual API traffic and context being sent to and from LLMs, which is often hidden by the agent's CLI or application interface.

How it works

The tool acts as a proxy between the AI agent (the client) and the LLM provider's API. It can operate in two primary modes:

  • Reverse Proxy Mode: It redirects the agent's API base URL to a local proxy, capturing the traffic before forwarding it to the target API.
  • Forward Proxy Mode: It injects HTTPS_PROXY and a local CA certificate into the child process, capturing traffic to any provider the agent communicates with.

Captured data is stored as local trace sessions, which can be viewed through a live browser-based viewer or exported as self-contained HTML files for archiving and sharing.

Who it’s for

Developers and AI researchers who use AI coding agents (such as Claude Code, Codex, Gemini CLI, Cursor, and others) and want to debug agent behavior, analyze system prompts, or audit token usage and tool calls.

Highlights

  • Deep Context Inspection: View system prompts, conversation history, tool schemas, tool calls, and reconstructed streaming responses.
  • Detailed Debugging: Compare adjacent requests to identify exactly what changed in the prompt or parameters between turns.
  • Broad Client Support: Works with a wide array of agents including Claude Code, Codex, Gemini, Grok, Kimi, Cursor, and more.
  • Local-First Privacy: Traces are kept on the local machine, and sensitive authentication headers are redacted before recording.
  • Portable Artifacts: Export trace sessions to standalone HTML viewers for review or sharing.

Related

  • Project
  • Project
  • Project
  • Project
  • Project