ContextLens — py-spy/pprof but for what's inside your LLM prompt
ContextLens is a new open-source tool designed to diagnose and reduce wasted token usage in LLM agent context windows. It analyzes conversation turns to identify which parts of the context, such as repeated tool results or unused system prompts, are being unnecessarily re-billed. The tool provides detailed reports, including cost estimates and specific recommendations for optimization, and can work offline with saved traces. AI
IMPACT Helps developers reduce LLM API costs by identifying and fixing wasted token usage in agent loops.