# claude-tap — Trace Claude/Cursor CLI API Calls > claude-tap captures API traffic from Claude Code, Codex CLI, Cursor CLI, etc., and renders prompts and tool calls in a trace viewer. Verified 321★. ## Install Copy the content below into your project: ## Quick Use ```bash uv tool install claude-tap # or: pip install claude-tap claude-tap --tap-live # Trace another client: claude-tap --tap-client codex|gemini|cursor -- ... ``` ## Intro claude-tap captures API traffic from Claude Code, Codex CLI, Cursor CLI, etc., and renders prompts and tool calls in a trace viewer. Verified 321★. **Best for:** Teams debugging agent behavior (prompts/tools/history) across multiple coding CLIs **Works with:** Claude Code, Codex CLI, Cursor CLI, Gemini CLI, OpenCode; Python 3.11+ (uv/pip install) **Setup time:** 6-12 minutes ### Key facts (verified) - GitHub: 321 stars · 46 forks · pushed 2026-05-13. - License: MIT · owner avatar + repo URL verified via GitHub API. - README-verified entrypoint: `uv tool install claude-tap && claude-tap --tap-live`. ## Main - Use it as a cross-client debugger: README lists multiple supported coding CLIs and shows how to switch via `--tap-client`. - Turn on live mode when you need to inspect traces while the agent is running (`--tap-live` in README). - Capture first, optimize later: use traces to identify prompt bloat, tool misuse, and token spikes before changing your agent policies. ### Source-backed notes - README says it intercepts API traffic from Claude Code, Codex CLI, Gemini CLI, OpenCode, and Cursor CLI and visualizes traces. - README recommends install via `uv tool install claude-tap` and also supports `pip install`. - README documents usage examples like `claude-tap --tap-client codex` and forwarding args after `--`. ### FAQ - **Do I need to modify my CLI tools?**: No — README shows running clients through `claude-tap` without patching them. - **Can I trace Codex CLI OAuth mode?**: Yes — README notes Codex auth modes and shows examples; you may set a target explicitly if needed. - **What Python version is required?**: README lists Python 3.11+ for installation and usage. ## Source & Thanks > Source: https://github.com/liaohch3/claude-tap > License: MIT > GitHub stars: 321 · forks: 46 --- ## Quick Use ```bash uv tool install claude-tap # or: pip install claude-tap claude-tap --tap-live # Trace another client: claude-tap --tap-client codex|gemini|cursor -- ... ``` ## Intro claude-tap 可拦截 Claude Code/Codex/Cursor CLI 等的 API 流量,并用可视化 viewer 展示 prompts、工具与 token。已验证 321★;约 6–12 分钟可跑通。 **Best for:** 需要跨多种编码 CLI 排查 agent 行为(prompt/工具/历史)的团队 **Works with:** Claude Code、Codex CLI、Cursor CLI、Gemini CLI、OpenCode;Python 3.11+(uv/pip 安装) **Setup time:** 6-12 minutes ### Key facts (verified) - GitHub:321 stars · 46 forks;最近更新 2026-05-13。 - 许可证:MIT;作者头像与仓库链接均已通过 GitHub API 复核。 - README 中核对过的入口命令:`uv tool install claude-tap && claude-tap --tap-live`。 ## Main - 把它当作跨客户端调试器:README 列出多种编码 CLI,并用 `--tap-client` 切换目标客户端。 - 需要边跑边看就开 live viewer:README 提供 `--tap-live`。 - 先抓包再优化:用 trace 找到 prompt 膨胀、工具误用与 token 峰值,再回头改策略更高效。 ### Source-backed notes - README 说明它可拦截 Claude Code、Codex CLI、Gemini CLI、OpenCode、Cursor CLI 等的 API 流量并可视化展示。 - README 推荐 `uv tool install claude-tap`,也支持 `pip install`。 - README 给出 `claude-tap --tap-client codex` 等示例,并说明 `--` 之后的参数会转发给目标客户端。 ### FAQ - **需要改动原来的 CLI 吗?**:不需要。README 的用法是把客户端通过 `claude-tap` 启动即可。 - **能抓 Codex 的 OAuth 模式吗?**:能。README 说明 Codex 的认证模式,并给出必要时手动指定 target 的示例。 - **需要什么 Python 版本?**:README 标注 Python 3.11+。 ## Source & Thanks > Source: https://github.com/liaohch3/claude-tap > License: MIT > GitHub stars: 321 · forks: 46 --- Source: https://tokrepo.com/en/workflows/claude-tap-trace-claude-cursor-cli-api-calls Author: Script Depot