claude-tap
Trace AI CLI API requests via local reverse and forward proxies. Inspect system prompts, messages, tools, and token usage.
What it is and what it does
claude-tap is a local reverse and forward proxy that intercepts HTTP traffic from AI coding agents and displays it in a web-based trace viewer. It works with a wide range of agent CLIs—Claude Code, Codex, Gemini, Grok, Kimi, Cursor, and others—capturing the raw API requests and responses without requiring a hosted dashboard. You run your agent through claude-tap instead of directly, and it records system prompts, conversation history, tool schemas, tool calls, streaming responses, and token counts.
The tool is designed for developers who want to understand or debug agent behavior by seeing exactly what context and instructions the agent is working with, and how that context changes between turns. Traces stay on your machine by default, with sensitive auth headers redacted. Each run can be exported as a self-contained HTML file for review or archiving, and the same workflow works across multiple different agent clients.
Use it for:
- Debug why a Claude Code agent made a particular tool call by comparing the system prompt and messages sent in that request versus the previous one.
- Inspect token usage and streaming response reconstruction for a Cursor or Codex session to understand cost and latency.
- Export and archive a trace of an agent run as a portable HTML file for code review or incident analysis.
- Verify that a custom Claude Code upstream (DeepSeek, local proxy, etc.) is receiving the correct prompts and tool definitions.
- Compare how different agent CLIs (Kimi, Gemini, Grok) structure their API calls and context for the same task.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
claude-tap is a local proxy and trace viewer that captures and displays API traffic from AI coding agents, letting you inspect system prompts, messages, tool calls, and token usage without sending traces to a hosted service.
Yes. claude-tap fills a real need for developers working with AI agents: it provides local, privacy-preserving visibility into agent-API traffic without requiring hosted infrastructure or code changes to the agent itself. Low install friction, active maintenance, no known vulnerabilities, and broad client support make it a practical debugging tool. Install it if you regularly work with Claude Code, Cursor, or other traced agents and want to understand their behavior.
Install
claude-tap on PyPI
pip
pip install claude-tapuv
uv add claude-tappoetry
poetry add claude-tapInstalling claude-tap
Before you install
Low friction: pure Python wheel with three common async/crypto dependencies (aiohttp, backports-zstd, cryptography). Active maintenance as of 2026-08-14 with recent release. Requires Python 3.11+.
License in practice
MIT license permits commercial and private use with minimal restrictions; suitable for most development workflows.
Quickstart
pip install claude-tap
# Trace Claude Code with live viewer
claude-tap
# Or trace another client
claude-tap --tap-client codex
# Pass flags to the client after --
claude-tap -- --model claude-opus-4-6
Requires Python 3.11 or later and the target AI CLI tool (Claude Code, Codex, Gemini CLI, etc.) installed and configured.
Verify before relying
- Whether the live viewer server runs by default in all deployment contexts or only in interactive terminal mode.
- Performance overhead of the proxy on large or streaming responses from the traced agent.
- Whether trace export to HTML viewer works with all supported clients or has known limitations.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.11) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — aiohttp, backports-zstd, cryptography |
| Maintenance | actively maintained — 0 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 118,413/month — #12,120 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: claude_tap-0.1.144-py3-none-any.whl
Keywords: claude, claude-code, codex, grok, kimi, cursor, qoder, trace, proxy, api, llm, context-engineering
Tags
More Testing packages
Pluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
virtualenvvirtualenv creates isolated Python environments…
permissive · top 100 on PyPI
coverageCoverage.py measures which lines of Python code…
permissive · top 1,000 on PyPI
pytest-asynciopytest-asyncio is a pytest plugin that enables…
permissive · top 1,000 on PyPI
pytest-json-ctrfA pytest plugin that generates test reports in…
permissive · top 1,000 on PyPI
anthropicProvides Python bindings to the Claude API,…
permissive · top 1,000 on PyPI
lmnr-claude-code-proxyA thin proxy server that routes Claude Code…
unclear · top 5,000 on PyPI
openinference-instrumentation-claude-agent-sdkAuto-instruments Claude Agent SDK calls to emit…
permissive · top 15,000 on PyPI
ddapm-test-agentEmulates Datadog APM agent endpoints to test…
permissive · top 5,000 on PyPI
detect_agentDetects whether code is running in an AI agent…
unclear · top 15,000 on PyPI
trinity-agentTrinity orchestrates multiple AI coding agents…
permissive · top 15,000 on PyPI
google-agents-cliA CLI toolchain that equips coding agents…
permissive · top 15,000 on PyPI
inspect-scoutInspect Scout analyzes and visualizes…
permissive · top 15,000 on PyPI
claude-code-sdkPython SDK for querying Claude Code and…
permissive · top 15,000 on PyPI
agentrust-traceCreates and verifies cryptographically signed…
permissive · top 15,000 on PyPI