<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/intercepting-and-decoding-claude-code-api-calls-using-mitm-proxy-mhcghpfxk" -->

---
title: Intercepting and Decoding Claude Code API Calls Using...
description: A hands-on walkthrough showing how to intercept and decode Claude Code&#x27;s live API calls using mitmproxy. By routing Claude Code&#x27;s HTTPS traffic through a...
canonical: https://daily.dev/posts/intercepting-and-decoding-claude-code-api-calls-using-mitm-proxy-mhcghpfxk
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Intercepting and Decoding Claude Code API Calls Using MITM Proxy | daily.dev
og:description: A hands-on walkthrough showing how to intercept and decode Claude Code&#x27;s live API calls using mitmproxy. By routing Claude Code&#x27;s HTTPS traffic through a...
og:url: https://daily.dev/posts/intercepting-and-decoding-claude-code-api-calls-using-mitm-proxy-mhcghpfxk
og:image: https://api.daily.dev/og/posts/mHCgHPFXK.png
og:image:alt: Intercepting and Decoding Claude Code API Calls Using MITM Proxy
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Intercepting and Decoding Claude Code API Calls Using MITM Proxy

**[C\# Corner](https://daily.dev/sources/csharpcorner)** · 7 min read · 0 upvotes · 0 comments

## Summary

A hands-on walkthrough showing how to intercept and decode Claude Code's live API calls using mitmproxy. By routing Claude Code's HTTPS traffic through a man-in-the-middle proxy, you can inspect the full 80 KB payload sent to Anthropic on every request. The payload breaks down into four sections: system prompt, tool definitions, CLAUDE.md content, and conversation history. Key findings include that CLAUDE.md is injected verbatim into every request (a compliance concern), the agent operates as a while loop that grows the conversation history cumulatively, and prompt caching keeps costs from scaling quadratically. The post also covers using JSONL session logs with tools like claude-replay and cclogviewer for auditing and debugging.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.csharp.com/article/intercepting-and-decoding-claude-code-api-calls-using-mitm-proxy>

## Similar posts on daily.dev

- [Using Proxies to Hide Secrets from Claude Code](https://daily.dev/posts/using-proxies-to-hide-secrets-from-claude-code-lji9p9dap) · Hacker News · 0 upvotes · 0 comments

---

Tags: [#anthropic](https://daily.dev/tags/anthropic), [#claude-code](https://daily.dev/tags/claude-code)

[View this post on daily.dev](https://daily.dev/posts/intercepting-and-decoding-claude-code-api-calls-using-mitm-proxy-mhcghpfxk)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Intercepting and Decoding Claude Code API Calls Using MITM Proxy","url":"https://daily.dev/posts/intercepting-and-decoding-claude-code-api-calls-using-mitm-proxy-mhcghpfxk","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/intercepting-and-decoding-claude-code-api-calls-using-mitm-proxy-mhcghpfxk"},"datePublished":"2026-04-26T08:09:10.124Z","dateModified":"2026-04-26T08:09:33.333Z","description":"A hands-on walkthrough showing how to intercept and decode Claude Code's live API calls using mitmproxy. By routing Claude Code's HTTPS traffic through a...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/81f698b062e81502c45df6b257ae3843?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/81f698b062e81502c45df6b257ae3843?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"C# Corner","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"C# Corner","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/ada2d584df6241748fc4e71878dc70a3","url":"https://daily.dev/sources/csharpcorner"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/intercepting-and-decoding-claude-code-api-calls-using-mitm-proxy-mhcghpfxk","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"anthropic,claude-code","timeRequired":"PT7M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"C# Corner","item":"https://daily.dev/sources/csharpcorner"},{"@type":"ListItem","position":3,"name":"Intercepting and Decoding Claude Code API Calls Using MITM Proxy"}]}
```

