Show HN: Ctxdiff – Git diff for your LLM agent's context window Ctxdiff, a new open-source debugger for LLM agents' context windows, lets developers see exactly what an AI model saw turn by turn, block by block, and identify the character that broke a prompt cache. The local-first tool wraps OpenAI, Anthropic, Gemini, and Bedrock clients in one line and records content-hashed, deduplicated blocks into a single-file SQLite trace for inspection and diffing. Ctxdiff ships for Python (pip install ctxdiff) and JavaScript/TypeScript (npm i ctxdiff), sharing the same .ctrace format and CLI. Find the character that's breaking your agent's prompt cache on every turn β€” and the tool schemas you pay for on every call but never invoke. git diff for your agent's context window: see exactly what your LLM saw, turn by turn, block by block. Pick your language: 🐍 Python install Β· 🟨 JavaScript / TypeScript /salmanzafar949/ctxdiff/blob/main/js/README.md β€” same .ctrace format, same CLI, cross-compatible. ctxdiff is a local-first debugger for the context window of LLM agents. Wrap your OpenAI, Anthropic, Gemini incl. Vertex AI , or Bedrock client in one line β€” or hand a callback handler to LangChain/LangGraph β€” run your agent, and every call's context is recorded β€” as content-hashed, deduplicated blocks β€” into a single-file SQLite trace you can inspect, diff, and share. Nothing leaves your machine. Prompt wording is ~10% of the battle. The other 90% is context engineeringβ€” what the model sees, in what order, at what cost. When an agent misbehaves at turn 8, ctxdiff answers the three questions a raw JSON log can't:what exactly did the model see, what changed since turn 7, and what did it cost? πŸ“¦ Two SDKs, one format.ctxdiff ships forPython pip install ctxdiff andJavaScript/TypeScript npm i ctxdiff . Both write the same .ctrace file and share the same CLI β€” a trace captured in one language opens in the other's viewer. Code samples below aretabbed by language click to switch . 🐍 Python python from ctxdiff import trace from openai import OpenAI tracer = trace.init "customer-support-agent" client = tracer.wrap OpenAI ← the only line you add client.chat.completions.create model="gpt-4o", messages= {"role": "user", "content": "What's your refund window?"} , tracer.close writes ./customer-support-agent-