Skip to content
cccskills
FreePublished on GitHub

cc-trace

Intercept and debug Claude Code API requests using mitmproxy. Inspect system prompts, tool definitions, token usage, and streaming responses. Triggers: cc-trace, mitmproxy, API interception, Claude Code debugging, traffic inspection.

The English summary is being prepared. Showing the original description.

See how to install

Files included (6)

  • SKILL.md2.6 KB
  • CONCOMITANT_SKILLS.md892 B
  • scripts/extract-slash-commands.py1.4 KB
  • scripts/parse-streamed-response.ts5.8 KB
  • scripts/show-last-prompt.sh1.3 KB
  • scripts/verify-setup.sh5.0 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

CC-Trace: Claude Code API Interception

Capture and analyze Claude Code's API traffic using mitmproxy.

Quick Start

# Start mitmproxy filtering Claude API traffic
mitmweb --web-port 8081 --set flow_filter='~d api.anthropic.com' --save-stream-file ~/claude-flows.mitm

# In another terminal, launch Claude through the proxy
proxy_claude

Shell Function

Add to ~/.zshrc or ~/.bashrc:

proxy_claude() {
    export HTTP_PROXY=http://127.0.0.1:8080
    export HTTPS_PROXY=http://127.0.0.1:8080
    export NODE_EXTRA_CA_CERTS="$HOME/.mitmproxy/mitmproxy-ca-cert.pem"
    export NODE_TLS_REJECT_UNAUTHORIZED=0
    claude
}

Certificate Setup (macOS)

# Generate cert (start mitmproxy once, then quit)
mitmproxy --set flow_filter='~d api.anthropic.com'

# Trust cert in system keychain
sudo security add-trusted-cert -d -p ssl -p basic -k /Library/Keychains/System.keychain ~/.mitmproxy/mitmproxy-ca-cert.pem

Filter Syntax

FilterDescription
~d api.anthropic.comOnly Anthropic API
~m POSTOnly POST requests
~s "tool_use"Responses containing tool_use
~b "system"Body contains "system"
Combine~d api.anthropic.com & ~m POST & ~b "tool_use"

Programmatic Analysis

# Dump all captured requests
mitmdump -r ~/claude-flows.mitm -n --set flow_detail=2

# Show last prompt sent
bash scripts/show-last-prompt.sh

Python Addon Example

from mitmproxy import http
import json

def response(flow: http.HTTPFlow):
    if "api.anthropic.com" in flow.request.pretty_host:
        req = json.loads(flow.request.get_text())
        print(f"Model: {req.get('model')}, Messages: {len(req.get('messages', []))}, Tools: {len(req.get('tools', []))}")

Bundled Scripts

ScriptPurpose
scripts/verify-setup.shCheck mitmproxy install, cert trust, shell config
scripts/parse-streamed-response.tsParse Anthropic SSE format
scripts/extract-slash-commands.pyExtract user messages from flows
scripts/show-last-prompt.shShow most recent user prompt

Troubleshooting

security find-certificate -c mitmproxy -a  # verify cert
lsof -i :8080                               # check port
curl -x http://127.0.0.1:8080 https://api.anthropic.com 2>&1 | head -5

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Model ElevenLabs voice synthesis as an ACSet schema with Unison ability handlers for typed voice operations. Use when integrating ElevenLabs TTS into category-theoretic pipelines, building typed voice synthesis workflows, or managing multi-voice narration with GF(3) conservation.

The English summary is being prepared. Showing the original description.

plurigrid/asi70Updated Jul 10, 2026

Systematic process for analyzing and modernizing legacy applications to comply with the 12-Factor App methodology. Covers code analysis, configuration externalization, dependency management, and container/Kubernetes best practices.

The English summary is being prepared. Showing the original description.

plurigrid/asi70Updated Jul 10, 2026

13c0e3

Free

Gay MCP skill at invocation 26

The English summary is being prepared. Showing the original description.

plurigrid/asi70Updated Jul 10, 2026

19d57d

Free

Gay MCP skill at invocation 5

The English summary is being prepared. Showing the original description.

plurigrid/asi70Updated Jul 10, 2026

1ea91a

Free

Gay MCP skill at invocation 27

The English summary is being prepared. Showing the original description.

plurigrid/asi70Updated Jul 10, 2026

1eab21

Free

Gay MCP skill at invocation 3

The English summary is being prepared. Showing the original description.

plurigrid/asi70Updated Jul 10, 2026

See all skills by plurigrid

Report a problem with this skill