claude-code-lens
Local monitor for Claude Code API traffic, logs, prompts, and tools
Claude Code Lens is a local debugging and monitoring tool for Claude Code, the AI coding assistant CLI. It works by running a proxy server between Claude Code and the Anthropic API — meaning every request and response passes through a local middleman that captures and stores it, then displays it in a browser-based visualizer. This lets developers see exactly what Claude Code is sending to the model: the system prompts, the full message history, tool definitions, tool calls, streaming output, and token usage counts.
The tool supports two usage modes. In the simpler one-shot mode, you run cclens instead of claude, and it automatically starts the proxy, opens the visualizer in a browser, and launches Claude Code. When you're done, you stop the proxy with cclens stop. In the long-running proxy mode, you start the proxy separately with cclens proxy and then point Claude Code at it explicitly, which is better for continuous monitoring across multiple sessions.
The tool is designed to be non-invasive — it does not patch Claude Code or modify your Claude Code settings files in the default one-shot mode. It also auto-discovers the correct upstream API endpoint from your existing Claude Code configuration, so there is typically nothing to configure manually.
Claude Code Lens is written in JavaScript, installed as an npm package, and stores its runtime data in a local directory. An optional Claude Code Skill is also included for AI-assisted trace analysis — the agent can search through captured sessions, inspect how sub-agents behaved, and export findings as Markdown. The full README is longer than what was provided.