cc-trace

Intercept and inspect Claude Code API traffic using mitmproxy.

159|17|Updated Nov 8, 2025
One-click install
npx skills add https://github.com/alexfazio/cc-trace --skill cc-trace
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cc-trace
Source: https://github.com/alexfazio/cc-trace/tree/main/.
Command: npx skills add https://github.com/alexfazio/cc-trace --skill cc-trace

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires mitmproxy, node, and includes scripts (resource) and references (resource) components.

What problem does it solve?

Claude Code's internal API interactions are often a black box. This Skill provides full transparency, allowing you to see exactly what prompts, tools, and data Claude Code sends to the API and what responses it receives. It simplifies the complex process of setting up and using an HTTPS proxy (mitmproxy) to intercept this traffic, turning a daunting technical task into a guided, interactive experience.

Core Features & Use Cases

  • Deep API Insight: Intercept and inspect every Claude Code API request and response, revealing system prompts, tool definitions, and conversation context.
  • Effortless Debugging: Quickly diagnose unexpected behavior, tool call failures, or API errors by examining the raw traffic, saving hours of guesswork.
  • Performance Optimization: Analyze token usage patterns and identify opportunities to refine prompts and tool interactions for efficiency and cost savings.
  • Use Case: If Claude Code is struggling with a complex task or a tool isn't working as expected, use this skill to capture the API calls. You can then inspect the exact system prompt, user messages, and tool parameters sent, allowing you to pinpoint the root cause of the issue and refine your approach.

Quick Start

To begin, ask me to guide you through the setup of cc-trace. I will interactively assist you with installing mitmproxy, configuring its security certificate, and setting up your shell environment to intercept Claude Code's API traffic.

Frequently Asked Questions about cc-trace

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I inspect Claude Code's API calls and see what's being sent?

API interception reveals exactly what prompts, tools, and data Claude Code sends to the API and receives back. Use mitmproxy to capture HTTPS traffic from Claude Code, then export and analyze the flows to see system prompts, tool definitions, and conversation context in raw form.

Can I debug why Claude Code's tool calls are failing or behaving unexpectedly?

Yes. Intercepting Claude Code's API traffic lets you examine the exact tool parameters, system prompt, and user messages sent in each request. Capturing and filtering mitmproxy flows pinpoints root causes of tool failures without guesswork.

What's the best way to optimize Claude Code's API usage and token efficiency?

Analyze token patterns by intercepting and inspecting Claude Code's API requests and responses through mitmproxy. Captured traffic reveals prompt structure and tool interactions, letting you identify refinements that reduce token consumption and cost.

Do I need mitmproxy to intercept Claude Code traffic, or are there other options?

mitmproxy is the primary tool for HTTPS interception of Claude Code API calls. This Skill provides guided setup for mitmproxy certificate trust, shell environment configuration, and traffic capture—simplifying what would otherwise be a complex proxy configuration task.

How difficult is setting up network interception for Claude Code debugging?

This Skill handles the complexity. Interactive setup guidance walks you through mitmproxy installation, certificate configuration, and shell environment setup. Once configured, capturing and filtering Claude Code traffic becomes straightforward with Python or TypeScript analysis tools.

Can I export and analyze Claude Code API traffic after capturing it?

Yes. mitmproxy flows captured during Claude Code sessions can be exported and analyzed using Python or TypeScript tooling. This lets you filter, search, and process API requests and responses programmatically for detailed inspection and reporting.