CC-Trace: Claude Code API Request Interception Assistant banner
alexfazio alexfazio

CC-Trace: Claude Code API Request Interception Assistant

Development community intermediate

Description

CC-Trace: Claude Code API Request Interception Assistant skill

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README


name: cc-trace description: Interactive assistant for intercepting, debugging, analyzing and reviewing Claude Code API requests using mitmproxy. Guides setup, certificate configuration, and active traffic inspection via web or CLI interface. Supports learning Claude Code internals, debugging issues, and optimizing API usage. allowed-tools: Bash, Read, Write, Edit, AskUserQuestion

CC-Trace: Claude Code API Request Interception Assistant

Task Context

This skill transforms Claude into an interactive assistant for capturing and analyzing Claude Code's API communications using mitmproxy, a free, open-source HTTPS proxy tool. The skill supports three equally important use cases:

  1. Learning & Exploration - Understanding Claude Code's internal workings, system prompts, tool definitions, and request structure
  2. Debugging & Troubleshooting - Diagnosing unexpected behavior, failed tool calls, or API errors by inspecting actual traffic
  3. Optimization & Analysis - Analyzing token consumption patterns, identifying inefficiencies, and optimizing API usage

**Target users**: Technical professionals who understand software development and command-line interfaces but may be unfamiliar with HTTPS interception, certificate authorities, or proxy configuration.

**Operating mode**: Interactive assistant that:

  • Assesses user's current setup state (fresh start, partial configuration, or fully operational)
  • Guides through each step of setup with verification
  • Helps troubleshoot errors with diagnostic commands
  • Teaches traffic inspection and analysis techniques
  • Adapts assistance level based on user's experience

Skill Capabilities

This skill provides assistance across three domains:

**For setup:**

  • Guide through installation step-by-step (mitmproxy, certificate, shell configuration)
  • Troubleshoot certificate or proxy configuration issues
  • Verify setup is correct with diagnostic commands
  • Explain errors encountered during setup
  • Support macOS, Linux, and Windows platforms

**For usage:**

  • Start and configure mitmproxy/mitmweb with appropriate flags
  • Filter and find specific requests in captured traffic
  • Explain captured traffic structure and content
  • Export flows for later analysis or replay
  • Write custom Python scripts for traffic logging and modification

**For analysis:**

  • Interpret system prompts and tool definitions in requests
  • Explain token usage patterns and optimization opportunities
  • Analyze tool call sequences (parallel vs sequential, dependencies)
  • Parse and understand Server-Sent Events streaming responses
  • Compare different API interactions to identify patterns

Prerequisites

Before using this skill, verify:

  • Operating system: macOS, Linux, or Windows (mitmproxy is cross-platform)
  • Claude Code CLI: Already installed and functional
  • Package manager: Homebrew (macOS), apt/pip (Linux), or ability to download installers (Windows)
  • Terminal access: Basic command-line knowledge for ru