claude-tap  by liaohch3

Inspect LLM API traffic and conversation flow

Created 3 months ago
845 stars

Top 41.7% on SourcePulse

GitHubView on GitHub
Project Summary

This project addresses the need for detailed inspection of API traffic generated by various large language model (LLM) command-line interfaces (CLIs), including Claude Code, Codex, Kimi, OpenCode, and Cursor. It targets developers, researchers, and power users who require visibility into how these tools construct system prompts, manage conversation history, select tools, and utilize tokens. The primary benefit is a powerful, user-friendly trace viewer that simplifies debugging and analysis of LLM interactions.

How It Works

claude-tap functions as a proxy, intercepting API calls made by supported CLIs and recording request-response pairs into JSONL trace files. It spawns the specified client, directing its traffic through an internal proxy with low overhead. Upon the client's exit, claude-tap generates a self-contained HTML trace viewer, offering features like structural and character-level diffs, token usage breakdowns, and tool inspection. An optional live mode streams these details to a browser in real-time.

Quick Start & Requirements

  • Installation: Requires Python 3.11+. Install via uv tool install claude-tap or pip install claude-tap.
  • Prerequisites: The specific CLI you intend to trace (e.g., Claude Code, Codex CLI, Kimi CLI, Cursor CLI) must also be installed.
  • Usage: Run commands like claude-tap Claude Code or claude-tap --tap-client codex. Client-specific flags are passed after --.
  • Documentation: Guides are available for specific integrations like OpenClaw and DeepSeek API, as well as Codex CLI authentication modes.

Highlighted Details

  • Trace Viewer: A single, self-contained HTML file featuring structural and character-level diff views, path filtering, model grouping, token usage breakdown, tool inspector, search, dark mode, and keyboard navigation.
  • Live Mode: Real-time browser viewer updates as traffic flows during client execution.
  • Proxy Modes: Supports reverse and forward proxy configurations, including a proxy-only mode for custom setups.
  • CLI Support: Integrates with Claude Code, Codex CLI, Kimi CLI, OpenCode, and Cursor CLI, with specific configurations for DeepSeek API and Codex CLI's OAuth/API key authentication.
  • Security: Common authentication headers are automatically redacted.

Maintenance & Community

The project is maintained by liaohch3 and acknowledges contributions from several individuals. A CONTRIBUTING.md file is provided for those interested in contributing. No specific community channels like Discord or Slack are listed in the README.

Licensing & Compatibility

The project is released under the MIT License, which permits broad use, modification, and distribution, including for commercial purposes and integration within closed-source applications.

Limitations & Caveats

Requires Python 3.11 or newer. Specific configurations may be needed for certain CLIs or custom API endpoints (e.g., using --tap-target for DeepSeek or alternative Codex endpoints). The README does not detail known bugs or alpha/beta status.

Health Check
Last Commit

1 day ago

Responsiveness

Inactive

Pull Requests (30d)
127
Issues (30d)
24
Star History
833 stars in the last 30 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), Gregor Zunic Gregor Zunic(Cofounder of Browser Use), and
15 more.

openllmetry by traceloop

0.2%
7k
Open-source observability SDK for LLM applications
Created 2 years ago
Updated 1 week ago
Feedback? Help us improve.