claude-tap Intercepts 16 AI Coding CLIs So You Can See Every Request They Send
You might be using Claude Code, Codex, or Cursor every day.
But have you ever wondered — what exactly does it send to the model each time?
What does the system prompt look like? How are the tools defined? How does the multi-turn conversation context accumulate? Where are the tokens being spent? What are the differences in request structure between different models?
You probably have no idea.
This is the current state of AI coding assistants — they work well, but they are a black box.
You can't see what they send to the model, so you can only guess at the results: was the bad response due to a poorly written prompt? Was the context too long? Or was the model itself not up to the task? Without data, it's all superstition.
Recently I found an open-source project that pries this black box open.
It's called claude-tap
A one-sentence introduction: a local proxy + trace viewer, specifically designed to intercept the API traffic of AI coding CLIs.
MIT open-source, 2.9k stars, created by a developer named liaohch3.

It essentially does two things:
- Inserts a local proxy between the AI CLI and the model API
- Completely records every request and every response, then presents them in a nice viewer
It sounds simple, but it solves a real pain point — you can finally see what the AI coding assistant is actually doing.
One tool, covering 16 mainstream CLIs
This is what I find most incredible.
claude-tap can intercept not just Claude Code, but also:
- Claude series: Claude Code (including AWS Bedrock, DeepSeek/GLM gateways)
- OpenAI series: Codex CLI, Codex App
- Google series: Gemini CLI
- xAI: Grok Build CLI
- Moonshot AI: Kimi CLI, Kimi Code
- Xiaomi: MiMo Code
- Cursor, Qoder, Antigravity, OpenCode, OpenClaw, Pi, Hermes Agent
- Tencent: CodeBuddy CLI
Count them up, 16.
Mainstream international ones, domestic big-tech ones, cutting-edge open-source ones — full coverage.

Install one tool, and you can view the requests of all AI coding CLIs. I haven't seen a second project achieve this level of coverage.
The killer feature: structured diff comparison
Just viewing requests isn't enough. What really caught my eye with claude-tap is this feature — structured diff.
What does it mean?
AI coding assistants work through multi-turn conversations — you send a message, it replies, you send another. With each request, the context accumulates and changes.
- 1st request: system prompt + your question
- 2nd request: system prompt + 1st round of conversation + tool call results + your new question
- 3rd request: adds the content of the 2nd round
But between any two requests, what exactly was added, changed, or deleted?


claude-tap's diff view gives you character-level highlighted comparison:
- The system prompt changed from v1 to v2 — which exact words were altered
- Whether the tool list was expanded or reduced
- In what order the conversation history was concatenated
- Whether any hidden instructions were secretly inserted
For people debugging prompts, this is a nuclear weapon.
Previously, adjusting prompts was all based on gut feeling — "it seems worse this time, but I don't know why." Now you can directly see the context changes, where it got worse, what changed — crystal clear.

Its implementation principle is also very simple, with two core ideas:
For tools that support custom base URLs, like Claude Code and Codex CLI, it uses reverse proxy mode: points the client's request address to the local proxy, and the proxy forwards to the real API. Completely transparent to the client.
For clients that don't support changing the address, like Gemini CLI, OpenCode, Pi, it uses forward proxy mode: routes traffic to localhost via the HTTPS_PROXY environment variable, using a self-signed CA certificate to complete TLS decryption. Also transparent once the certificate is installed.
All traffic passing through the proxy is recorded in real-time as trace files in JSONL format.
In real-time mode, records are pushed to the browser via SSE. On exit, the trace is packaged into a self-contained HTML file.
That's it. No fancy stuff — just intercept the traffic, record it, and display it.
A few other thoughtful design touches I noticed
First, automatic redaction of authentication headers.
Sensitive information like API Keys is automatically masked before being saved. You can safely share trace files without leaking secrets.
Second, self-contained HTML viewer.
The exported trace file is a single-file HTML with zero external dependencies. Send it to a colleague, drop it in an issue, embed it in a webpage — the recipient doesn't need to install anything, just open it.
Third, macOS menu bar app.
You can build a Claude Tap.app with one click, which lives in the status bar; click it for the control panel. macOS users rejoice.
Fourth, real-time mode.
Enabled by default. As you chat with the AI, the browser refreshes requests in real time — no need to wait until the session ends.
Fifth, token usage breakdown.
Input tokens, output tokens, cache reads, cache creation — clearly separated. This is the most fundamental and important data when optimizing costs.
Sixth, intelligent AWS Bedrock adaptation.
Bedrock has three access methods (Anthropic gateway, enterprise proxy, native SigV4), and claude-tap can automatically identify them and use different strategies to capture each. This level of detail shows the author really uses it.
How to use it? Literally one command.
Installation:
# Recommended
uv tool install claude-tap
# Or with pip
pip install claude-tap
Start (defaults to Claude Code):
claude-tap
That's it. It automatically starts the proxy, starts the viewer, and launches Claude Code — all in one go.
To use other CLIs, add a parameter:
# Codex CLI
claude-tap --tap-client codex
# Gemini CLI
claude-tap --tap-client gemini -- -p "hello"
# Kimi Code
claude-tap --tap-client kimi
claude-tap --tap-client kimi-code
# Cursor CLI
claude-tap --tap-client cursor -- -p --trust --model auto "hello"
# Tencent CodeBuddy
claude-tap --tap-client codebuddy
Using Claude Code as an example:
# Pass flags through to Claude Code
claude-tap -- --model claude-opus-4-6
claude-tap -c # continue last conversation
# Skip all permission prompts (auto-accept tool calls)
claude-tap -- --dangerously-skip-permissions
# Live viewer is on by default; pass Claude flags after --
claude-tap -- --dangerously-skip-permissions --model claude-sonnet-4-6
The full parameter table is in the GitHub README, I won't ramble on.
Three key use cases to highlight
Scenario 1: Studying Claude Code's system prompt.
Many people are curious — what instructions exactly make a CLI so capable? How is the system prompt organized? How are the tools defined? Run claude-tap once, and all the cards are laid out in front of you.
Scenario 2: Debugging an Agent's prompt.
You're building your own Agent, and after tweaking it for ages, the results aren't right. Use claude-tap to capture the requests, compare the diff between two adjacent requests, and you'll immediately see how the context accumulated and which step went wrong. Ten times faster than blind guessing.
Scenario 3: Connecting Claude Code to DeepSeek, comparing the difference with native Claude.
Many people use DeepSeek/GLM connected to Claude Code to save money. But have you ever wondered — when the same prompt is sent to DeepSeek versus Claude, has the request structure been altered by the gateway? Have any tool definitions been lost? Run it once with claude-tap, and it's immediately clear.
What I think this project signifies
Let me share some personal thoughts.
The emergence of a tool like claude-tap shows that the AI coding assistant ecosystem is truly maturing.
A year ago, people were still discussing "whether AI coding assistants are useful." Now, people are starting to care about "how exactly they work" — how the system prompt is written, how tools are defined, how context is managed, how tokens are spent.
Moving from "using by feel" to "using with clarity" — this is a hallmark of an ecosystem maturing.
For several types of people, this tool is almost essential:
- Prompt engineers: Debugging agent prompts, comparing adjacent requests is a core capability
- AI tool reviewers: Writing reviews, doing comparisons — without seeing the requests, you can only rely on gut feeling
- Agent developers: Learning how mainstream CLIs design system prompts, tool lists, and context management
- Enterprise tech leads: Auditing exactly what data the AI coding assistant is sending out — this is the foundation of compliance checks
But I also want to say one thing — a tool is just a tool; looking at requests is for understanding, not for reverse engineering.
Claude Code's system prompt and tool definitions are the result of careful design by Anthropic's engineers. You can look, you can learn, but directly copying them into your own product is not very decent.
Final words
If you are doing AI coding, AI Agent-related development, or prompt engineering, and want to debug API calls or troubleshoot issues, claude-tap is essentially the Wireshark of the AI Agent world. I strongly recommend checking it out on GitHub and running the demo.
Don't wait until all your peers are already using it before you catch on.
GitHub project address: github.com/liaohch3/claude-tap