Have you ever wondered what exactly your VS Code AI extensions are whispering to your local models? By setting up a Man-in-the-Middle (MITM) proxy, you can peek behind the curtain and capture every prompt generated by your editor.
Using mitmdump, we can create a reverse proxy in front of a local Ollama instance (which runs on port 11434) and record the incoming traffic:
Bash
mitmdump --mode reverse:http://localhost:11434 -p 11435 -w ~/Documents/ollama_requests.logBy pointing your VS Code extension to localhost:11435 instead of the default port, all HTTP traffic is silently intercepted and saved to your log file.
Next, we convert this binary log into a human-readable format, cranking up the detail level to capture the full request payloads:
Bash
mitmdump -r ollama_requests.log --set flow_detail=3 > today.txtNow you have a raw text file containing every prompt and system instruction sent by VS Code. The final step is to feed today.txt back into an LLM. You can ask it to summarize your daily coding activity, analyze the hidden system prompts injected by your extensions, or extract recurring development patterns. It is a fantastic way to reverse-engineer how AI assistants structure their context.

No comments:
Post a Comment