Repolode
liaohch3

liaohch3/claude-tap

A local proxy and trace viewer that captures API traffic from AI coding agents like Claude Code and Codex CLI to inspect prompts, tool calls, and token usage.

Stars
3,293
Forks
284
Open issues
40
Last commit
yesterday

What is it?

claude-tap runs an AI coding agent's CLI through a local proxy, or watches local transcripts for clients that cannot be proxied, and records the real API traffic. Each trace shows system prompts, conversation history, tool schemas, tool calls, streamed responses, token usage, and differences between adjacent requests.

It supports a broad set of clients, including Claude Code, Codex CLI, Gemini CLI, Kimi CLI, OpenCode, Pi, Hermes Agent, and Cursor CLI, with reverse or forward proxy modes depending on the client. Common auth headers are redacted before recording, and traces are stored locally with no hosted dashboard required.

The viewer is a self-contained HTML file that can be exported and shared for review or archiving. It includes structural diffs, search, token breakdowns, a live browser view during a run, and an iframe embed mode.

Key features

  • 01Captures streaming API requests and responses from supported coding agent CLIs.
  • 02Shows system prompts, tool definitions, tool calls, and token usage per request.
  • 03Diffs adjacent requests to highlight changed messages, prompts, or parameters.
  • 04Exports each session as a self-contained HTML viewer or compact trace bundle.
  • 05Redacts common auth headers and keeps all trace data on the local machine.

Use cases

  • Investigating why a coding agent changed its behavior between turns.
  • Auditing which tools and system prompts an agent sends to the model.
  • Comparing token usage and context growth across agent sessions.
  • Archiving or sharing a reproducible trace of an agent run for review.

Quick start

  1. 1

    Install claude-tap with uv (recommended)

    uv tool install claude-tap
  2. 2

    Run Claude Code through claude-tap

    claude-tap
  3. 3

    Or trace Codex CLI instead

    claude-tap --tap-client codex

Things to know

  • Requires Python 3.11+ and the agent client you want to trace, installed separately.
  • Some clients, such as AWS native Bedrock, need extra setup like forward proxy mode.

Topics

FAQ

What is claude-tap?
A local proxy and trace viewer that captures API traffic from AI coding agents like Claude Code and Codex CLI to inspect prompts, tool calls, and token usage. claude-tap runs an AI coding agent's CLI through a local proxy, or watches local transcripts for clients that cannot be proxied, and records the real API traffic. Each trace shows system prompts, conversation history, tool schemas, tool calls, streamed responses, token usage, and differences between adjacent requests.
Is claude-tap free to use? What license does it have?
claude-tap is open source under the MIT license. Check the license terms before using it in commercial products.
Is claude-tap still maintained?
Actively maintained. The last commit to claude-tap was on Oct 19, 2026.
What can I use claude-tap for?
Investigating why a coding agent changed its behavior between turns. Auditing which tools and system prompts an agent sends to the model. Comparing token usage and context growth across agent sessions. Archiving or sharing a reproducible trace of an agent run for review.
How do I install claude-tap?
Install claude-tap with uv (recommended): uv tool install claude-tap Run Claude Code through claude-tap: claude-tap Or trace Codex CLI instead: claude-tap --tap-client codex
Where can I get claude-tap?
The source code and installation instructions are on GitHub: https://github.com/liaohch3/claude-tap

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects