Claude Code
Claude Code is a heavy context user - long system prompts, tool schemas, and growing conversation history. Routing it through llmprof shows exactly where its tokens go and how context grows across a session.
-
Start the proxy (one instance routes Anthropic and OpenAI automatically):
Terminal window llmprof up -
Tell Claude Code to use the proxy via
ANTHROPIC_BASE_URL, then run it as usual:Terminal window ANTHROPIC_BASE_URL=http://localhost:4000 claudeYour
ANTHROPIC_API_KEYis sent through to Anthropic unchanged. To make it persistent, exportANTHROPIC_BASE_URLin your shell profile. -
Open http://localhost:4000. Each Claude Code turn appears as a call. Switch to the timeline view to watch the context grow turn over turn within a session.
What to look for
Section titled “What to look for”- The flame graph reveals how much of each turn is tool schemas vs history.
- The timeline makes context creep visible across a coding session - the history band climbing while the system prompt stays flat.
- The waste detector flags an uncached stable prefix, which for an agent that calls the model repeatedly is often the biggest reclaimable lever.