How to Capture and Debug Claude Code HTTPS Traffic with Fiddler Everywhere
How to Capture and Debug Claude Code HTTPS Traffic with Fiddler Everywhere
Claude Code is Anthropic's agentic coding tool that runs in your terminal and communicates with large language models to assist with development tasks. This article explains how to configure Fiddler Everywhere to capture and inspect the HTTPS traffic generated by Claude Code, allowing you to debug API calls, analyze request/response patterns, and troubleshoot connectivity issues.
Prerequisites
Before you begin, ensure you have the following:
- Claude Code installed on Windows (not WSL)
- Fiddler Everywhere (latest version) installed on your system
- Administrative access to install certificates and set environment variables
Understanding Fiddler Capturing Modes
Fiddler Everywhere offers three different capturing modes, each suited for different scenarios:
Network Capturing Mode
Network capturing mode sets Fiddler as the system proxy at the network adapter level. This mode captures traffic from all applications on your system that respect the proxy settings.
Pros:
- Captures traffic from all proxy-aware applications simultaneously
- No need to configure individual applications
Cons:
- Captures traffic from all applications, which can create noise when you only want to monitor Claude Code
- Requires filtering to isolate Claude Code traffic
System Capturing Mode
System capturing mode configures Fiddler as the system-wide proxy through operating system settings. Similar to network mode, it affects all applications that honor the system proxy configuration.
Pros:
- System-wide coverage for all compatible applications
- Easy to enable/disable
Cons:
- Captures traffic from all applications, making it harder to focus on Claude Code specifically
- May interfere with other applications during your debugging session
Terminal Capturing Mode (Recommended)
Terminal capturing mode launches a dedicated terminal session with Fiddler's proxy settings pre-configured. Only traffic from applications running in this specific terminal will be captured.
Pros:
- Isolated capture: Only captures traffic from the specific terminal session, eliminating noise from other applications
- Focused debugging: Perfect for isolating and analyzing Claude Code traffic
- No interference: Other applications on your system continue to work normally without routing through Fiddler
Cons:
- Requires launching Claude Code from the Fiddler-configured terminal
For capturing Claude Code traffic, we strongly recommend using Terminal Capturing Mode as it provides the cleanest and most focused capture experience.
Step-by-Step Configuration
Step 1: Export the Fiddler CA Certificate
To decrypt and inspect HTTPS traffic from Claude Code, you need to export Fiddler's root certificate authority (CA) certificate and configure your system to trust it.
- Open Fiddler Everywhere
- Navigate to Settings > HTTPS
- Click Export Root Certificate
- Select PEM Format from the export options
- Save the certificate to a known location, such as:
txt
%USERPROFILE%\.claude\Fiddler_Root_Certificate_Authority.pem
Tip: Create the
.claudefolder if it doesn't exist. This keeps your Claude-related configurations organized in one location.
Step 2: Configure the CA Certificate Environment Variable
Claude Code (and Node.js applications in general) uses the NODE_EXTRA_CA_CERTS environment variable to trust additional CA certificates.
- Open System Properties > Advanced > Environment Variables
- Under User variables, click New
- Set the variable name:
NODE_EXTRA_CA_CERTS - Set the variable value to the full path of your exported certificate:
txt
%USERPROFILE%\.claude\Fiddler_Root_Certificate_Authority.pem - Click OK to save the environment variable
Important: You must start a new terminal session for the environment variable to take effect. Any terminals opened before setting this variable will not have the updated configuration.
Step 3: Enable Terminal Capturing Mode
- In Fiddler Everywhere, navigate to the Home tab or main toolbar
- Click Terminal to launch a new terminal session with Fiddler's proxy settings pre-configured
- A new command prompt or PowerShell window will open with the proxy environment variables already set
This terminal is now configured to route all HTTP/HTTPS traffic through Fiddler.
Step 4: Launch Claude Code
-
In the Fiddler-configured terminal, run:
bashclaude.exe -
Claude Code will start and be ready to accept your requests.
Optional: If you need additional logging for troubleshooting, you can run Claude Code in debug mode using
claude.exe --debug. Debug mode displays detailed logging information and the path where debug logs are written, which can be helpful when diagnosing connection or certificate issues.
Step 5: Test the Configuration
Now that everything is configured, test the setup by asking Claude Code to perform a task.
-
In the Claude Code session, enter a request, such as:
txtCreate a Python function that reads a JSON file and returns the data as a dictionary -
Claude Code will process your request, communicate with the LLM, and execute the chain of thought.
-
Switch to Fiddler Everywhere and observe the Live Traffic grid. You should immediately see HTTPS requests appearing, showing the communication between Claude Code and Anthropic's API servers.
Inspecting Claude Code Traffic
Once traffic is being captured, you can use Fiddler's powerful inspection features:
- Inspect Request/Response: Click on any session in the Live Traffic grid to view detailed request headers, body, and response data
- View JSON Payloads: Examine the prompts sent to Claude and the responses received
- Monitor Performance: Analyze response times and identify performance bottlenecks
- Filter Sessions: Use Fiddler's filtering capabilities to show only Claude Code traffic by filtering on the hostname or process name
- Save Sessions: Export sessions for later analysis or sharing with your team
Troubleshooting
Traffic Not Appearing in Fiddler
- Verify that you launched Claude Code from the Fiddler-configured terminal, not from a separate terminal window
- Confirm that the
NODE_EXTRA_CA_CERTSenvironment variable is set correctly by runningecho %NODE_EXTRA_CA_CERTS%in your terminal - Ensure HTTPS decryption is enabled in Fiddler: Settings > HTTPS > Capture HTTPS traffic
Certificate Trust Issues
- If you see certificate errors, verify that the certificate path in
NODE_EXTRA_CA_CERTSis correct and the file exists - Make sure you exported the certificate in PEM format, not CER or other formats
- Try restarting your computer to ensure all environment variables and certificate stores are properly updated
Claude Code Connection Errors
- Temporarily disable Fiddler to verify that Claude Code can connect without the proxy
- Check if your corporate firewall or antivirus is interfering with Fiddler's proxy
- Review the debug logs (path shown when you ran
claude.exe --debug) for detailed error messages
Additional Resources
- Fiddler Everywhere Terminal Capturing Mode
- Exporting Fiddler's Root Certificate
- Filtering and Organizing Traffic
Conclusion
By configuring Fiddler Everywhere to capture Claude Code traffic using Terminal Capturing Mode, you gain complete visibility into the API interactions between Claude and Anthropic's services. This enables you to debug issues, understand how Claude processes your requests, and optimize your development workflow.