본문으로 건너뛰기
cccskills
무료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.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(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(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

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

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

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.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

plurigrid/asi702026년 7월 10일 업데이트

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.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

plurigrid/asi702026년 7월 10일 업데이트

13c0e3

무료

Gay MCP skill at invocation 26

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

plurigrid/asi702026년 7월 10일 업데이트

19d57d

무료

Gay MCP skill at invocation 5

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

plurigrid/asi702026년 7월 10일 업데이트

1ea91a

무료

Gay MCP skill at invocation 27

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

plurigrid/asi702026년 7월 10일 업데이트

1eab21

무료

Gay MCP skill at invocation 3

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

plurigrid/asi702026년 7월 10일 업데이트

plurigrid의 스킬 모두 보기

이 스킬의 문제 신고